Project

General

Profile

« Previous | Next » 

Revision 48314d6a

Added by Leszek Koltunski over 2 years ago

Progress with 'bandaged UI'

View differences:

src/main/java/org/distorted/bandaged/BandagedCreatorActivity.java
26 26
import android.view.ViewGroup;
27 27
import android.view.WindowManager;
28 28
import android.widget.LinearLayout;
29
import android.widget.ScrollView;
30 29

  
31 30
import androidx.appcompat.app.AppCompatActivity;
32 31

  
......
35 34
import org.distorted.dialogs.RubikDialogError;
36 35
import org.distorted.library.main.DistortedLibrary;
37 36
import org.distorted.main.R;
37
import org.distorted.main.RubikActivity;
38 38
import org.distorted.objectlib.main.ObjectControl;
39 39
import org.distorted.objects.RubikObject;
40 40
import org.distorted.objects.RubikObjectList;
......
95 95
    private void computeHeights()
96 96
      {
97 97
      int barHeight    = (int)(mScreenHeight*RATIO_BAR);
98
      int scrollHeight = (int)(mScreenHeight*RATIO_SCROLL);
99
      int viewHeight   = (int)(mScreenHeight*(1-RATIO_SCROLL));
98
      int viewHeight   = (int)(mScreenHeight*RATIO_SCROLL);
99
      int objectHeight = (int)(mScreenHeight*(1-RATIO_SCROLL));
100 100
      mHeightBar = barHeight;
101 101

  
102 102
      LinearLayout layout = findViewById(R.id.lowerBar);
......
104 104
      paramsL.height = barHeight;
105 105
      layout.setLayoutParams(paramsL);
106 106

  
107
      ScrollView scroll = findViewById(R.id.bandagedCreatorScrollView);
108
      ViewGroup.LayoutParams paramsS = scroll.getLayoutParams();
109
      paramsS.height = scrollHeight;
110
      scroll.setLayoutParams(paramsS);
107
      LinearLayout view = findViewById(R.id.bandagedCreatorView);
108
      ViewGroup.LayoutParams paramsS = view.getLayoutParams();
109
      paramsS.height = viewHeight;
111 110

  
112
      BandagedCreatorView view = findViewById(R.id.bandagedCreatorView);
113
      ViewGroup.LayoutParams paramsV = view.getLayoutParams();
114
      paramsV.height = viewHeight;
115
      view.setLayoutParams(paramsV);
111
      int p = (int)(mScreenHeight* RubikActivity.PADDING);
112
      view.setPadding(p,p,p,p);
113
      view.setLayoutParams(paramsS);
114

  
115
      BandagedCreatorView creator = findViewById(R.id.bandagedCreatorObjectView);
116
      ViewGroup.LayoutParams paramsC = creator.getLayoutParams();
117
      paramsC.height = objectHeight;
118
      creator.setLayoutParams(paramsC);
116 119
      }
117 120

  
118 121
///////////////////////////////////////////////////////////////////////////////////////////////////
......
171 174
    protected void onPause() 
172 175
      {
173 176
      super.onPause();
174
      BandagedCreatorView view = findViewById(R.id.bandagedCreatorView);
177
      BandagedCreatorView view = findViewById(R.id.bandagedCreatorObjectView);
175 178
      view.onPause();
176 179
      DistortedLibrary.onPause(ACTIVITY_NUMBER);
177 180
      }
......
183 186
      {
184 187
      super.onResume();
185 188
      DistortedLibrary.onResume(ACTIVITY_NUMBER);
186
      BandagedCreatorView view = findViewById(R.id.bandagedCreatorView);
189
      BandagedCreatorView view = findViewById(R.id.bandagedCreatorObjectView);
187 190
      view.onResume();
188 191

  
189 192
      if( mScreen==null ) mScreen = new BandagedCreatorScreen();
src/main/res/layout/bandaged.xml
4 4
    android:layout_width="match_parent"
5 5
    android:layout_height="match_parent" >
6 6

  
7
    <LinearLayout
8
        android:id="@+id/bandagedCreatorView"
9
        android:layout_width="match_parent"
10
        android:layout_height="0dp"
11
        android:background="@color/light_grey"
12
        android:layout_alignParentStart="true"
13
        android:layout_alignParentTop="true">
7 14
    <ScrollView
8 15
        android:id="@+id/bandagedCreatorScrollView"
9 16
        android:background="@color/black"
10 17
        android:layout_width="match_parent"
11
        android:layout_height="0dp"
12
        android:layout_alignParentStart="true"
13
        android:layout_alignParentTop="true"/>
18
        android:layout_height="match_parent"/>
19
    </LinearLayout>
14 20

  
15 21
    <org.distorted.bandaged.BandagedCreatorView
16
        android:id="@+id/bandagedCreatorView"
17
        android:layout_below="@+id/bandagedCreatorScrollView"
22
        android:id="@+id/bandagedCreatorObjectView"
23
        android:layout_below="@+id/bandagedCreatorView"
18 24
        android:layout_width="match_parent"
19 25
        android:layout_height="0dp"
20 26
        android:layout_alignParentStart="true"/>

Also available in: Unified diff