Project

General

Profile

« Previous | Next » 

Revision bc7e49ec

Added by Leszek Koltunski over 2 years ago

Improve layout in the bandaged view.

View differences:

src/main/java/org/distorted/bandaged/BandagedCreatorActivity.java
90 90
      {
91 91
      int barHeight    = (int)(mScreenHeight*RATIO_BAR);
92 92
      int viewHeight   = (int)(mScreenHeight*RATIO_SCROLL);
93
      int objectHeight = (int)(mScreenHeight*(1-RATIO_SCROLL-RATIO_BAR));
93
      int objectHeight = (int)(mScreenHeight*(1-RATIO_SCROLL+RATIO_BAR));
94 94
      mHeightBar = barHeight;
95 95

  
96 96
      LinearLayout layout = findViewById(R.id.lowerBar);
src/main/java/org/distorted/main/RubikActivity.java
141 141

  
142 142
    private void computeBarHeights()
143 143
      {
144
      float height = getScreenHeightInPixels();
144
      float height = mScreenHeight;
145 145
      int barHeight = (int)(height*RATIO_BAR);
146 146
      mHeightLowerBar = barHeight;
147 147
      mHeightUpperBar = barHeight;
src/main/res/layout/bandaged.xml
4 4
    android:layout_width="match_parent"
5 5
    android:layout_height="match_parent" >
6 6

  
7

  
8
    <org.distorted.bandaged.BandagedCreatorView
9
        android:id="@+id/bandagedCreatorObjectView"
10
        android:layout_width="match_parent"
11
        android:layout_height="0dp"
12
        android:layout_alignParentBottom="true"
13
        android:layout_alignParentStart="true"/>
14

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

  
21
    <org.distorted.bandaged.BandagedCreatorView
22
        android:id="@+id/bandagedCreatorObjectView"
23
        android:layout_below="@+id/bandagedCreatorView"
24
        android:layout_width="match_parent"
25
        android:layout_height="0dp"
26
        android:layout_alignParentStart="true"/>
23
        <ScrollView
24
            android:id="@+id/bandagedCreatorScrollView"
25
            android:background="@color/black"
26
            android:layout_width="match_parent"
27
            android:layout_height="match_parent"/>
28

  
29
    </LinearLayout>
27 30

  
28 31
    <LinearLayout
29 32
        android:id="@+id/lowerBar"
30
        android:layout_below="@+id/bandagedCreatorObjectView"
31 33
        android:layout_alignParentBottom="true"
34
        android:layout_alignParentStart="true"
32 35
        android:layout_width="match_parent"
33 36
        android:layout_height="0dp"
34 37
        android:orientation="horizontal"
35
        android:background="@color/light_grey">
38
        android:background="@android:color/transparent">
36 39
    </LinearLayout>
37 40

  
38 41
</RelativeLayout>

Also available in: Unified diff