Project

General

Profile

« Previous | Next » 

Revision 9f8d4c92

Added by Leszek Koltunski over 2 years ago

Bandaged 3x3: improvements to the layout.

View differences:

src/main/java/org/distorted/bandaged/BandagedCreatorActivity.java
62 62
    private static int mScreenWidth, mScreenHeight;
63 63
    private int mCurrentApiVersion;
64 64
    private BandagedCreatorScreen mScreen;
65
    private int mHeightBar;
66 65

  
67 66
///////////////////////////////////////////////////////////////////////////////////////////////////
68 67

  
......
96 95
      int barHeight    = (int)(mScreenHeight*RATIO_BAR);
97 96
      int viewHeight   = (int)(mScreenHeight*RATIO_SCROLL);
98 97
      int objectHeight = (int)(mScreenHeight*(1-RATIO_SCROLL+RATIO_BAR));
99
      mHeightBar = barHeight;
100 98

  
101 99
      LinearLayout layout = findViewById(R.id.lowerBar);
102 100
      ViewGroup.LayoutParams paramsL = layout.getLayoutParams();
103 101
      paramsL.height = barHeight;
104 102
      layout.setLayoutParams(paramsL);
105 103

  
106
      HorizontalScrollView view = findViewById(R.id.bandagedCreatorScrollView);
107
      ViewGroup.LayoutParams paramsS = view.getLayoutParams();
108
      paramsS.height = viewHeight;
104
      LinearLayout topLayout = findViewById(R.id.bandagedCreatorTopView);
105
      ViewGroup.LayoutParams paramsT = topLayout.getLayoutParams();
106
      paramsT.height = viewHeight;
109 107

  
110 108
      int p = (int)(mScreenHeight* RubikActivity.PADDING);
111
      view.setPadding(p,p,p,p);
112
      view.setLayoutParams(paramsS);
109
      topLayout.setPadding(p,p,p,p);
110
      topLayout.setLayoutParams(paramsT);
113 111

  
114 112
      BandagedCreatorView creator = findViewById(R.id.bandagedCreatorObjectView);
115 113
      ViewGroup.LayoutParams paramsC = creator.getLayoutParams();
src/main/res/layout/bandaged.xml
11 11
        android:layout_alignParentBottom="true"
12 12
        android:layout_alignParentStart="true"/>
13 13

  
14
    <HorizontalScrollView
15
        android:id="@+id/bandagedCreatorScrollView"
14
    <LinearLayout
15
        android:id="@+id/bandagedCreatorTopView"
16 16
        android:layout_width="match_parent"
17 17
        android:layout_height="0dp"
18 18
        android:background="@color/light_grey"
19
        android:orientation="horizontal"
19 20
        android:layout_alignParentStart="true"
20 21
        android:layout_alignParentTop="true">
21 22

  
22
        <LinearLayout
23
            android:id="@+id/bandagedCreatorView"
24
            android:layout_width="wrap_content"
23
        <HorizontalScrollView
24
            android:id="@+id/bandagedCreatorScrollView"
25
            android:layout_width="match_parent"
25 26
            android:layout_height="match_parent"
26
            android:background="@color/black"
27
            android:orientation="horizontal"/>
28
    </HorizontalScrollView>
27
            android:background="@color/black">
28

  
29
            <LinearLayout
30
               android:id="@+id/bandagedCreatorView"
31
               android:layout_width="wrap_content"
32
               android:layout_height="match_parent"
33
               android:background="@color/black"
34
               android:orientation="horizontal"/>
35
        </HorizontalScrollView>
36
    </LinearLayout>
29 37

  
30 38
    <LinearLayout
31 39
        android:id="@+id/lowerBar"

Also available in: Unified diff