Skip to content

Commit 1cf08c5

Browse files
fix seekbar anomaly present in some devices.
1 parent 8ecf907 commit 1cf08c5

File tree

1 file changed

+51
-57
lines changed

1 file changed

+51
-57
lines changed

app/src/main/res/layout/activity_main.xml

Lines changed: 51 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
android:layout_width="72dp"
3939
android:text="Variance: "
4040
android:textColor="#212121"
41-
android:padding="4dp"
41+
android:layout_margin="4dp"
4242
android:layout_height="wrap_content" />
4343

4444
<SeekBar
@@ -47,33 +47,33 @@
4747
android:layout_toRightOf="@id/variance_textview"
4848
android:layout_width="match_parent"
4949
android:layout_height="wrap_content"
50-
android:padding="4dp"
50+
android:layout_marginTop="2dp"
5151
/>
5252

5353
<TextView
5454
android:id="@+id/cell_size_textview"
5555
android:layout_below="@id/variance_textview"
5656
android:layout_width="72dp"
5757
android:textColor="#212121"
58-
android:padding="4dp"
58+
android:layout_margin="4dp"
5959
android:text="Cell Size: "
6060
android:layout_height="wrap_content" />
6161

6262
<SeekBar
6363
android:id="@+id/cell_size_seekbar"
6464
android:layout_toRightOf="@id/cell_size_textview"
65-
android:layout_below="@+id/variance_seekbar"
65+
android:layout_below="@+id/variance_textview"
6666
android:layout_width="match_parent"
6767
android:layout_height="wrap_content"
68-
android:padding="4dp"
68+
android:layout_marginTop="2dp"
6969
/>
7070

7171
<TextView
7272
android:id="@+id/palette_textview"
7373
android:layout_below="@id/cell_size_textview"
7474
android:layout_width="72dp"
7575
android:textColor="#212121"
76-
android:padding="4dp"
76+
android:layout_margin="4dp"
7777
android:text="Palette: "
7878
android:layout_height="wrap_content" />
7979

@@ -83,66 +83,60 @@
8383
android:layout_below="@+id/cell_size_textview"
8484
android:layout_width="match_parent"
8585
android:layout_height="wrap_content"
86-
android:padding="4dp"
86+
android:layout_marginTop="2dp"
8787
/>
8888

89-
<LinearLayout
89+
<RelativeLayout
9090
android:layout_width="match_parent"
9191
android:layout_height="wrap_content"
92-
android:orientation="vertical"
93-
android:layout_below="@id/palette_seekbar"
92+
android:layout_below="@id/palette_textview"
9493
android:layout_marginTop="4dp"
9594
>
9695

97-
<LinearLayout
96+
<View
97+
android:id="@+id/layout_middle_point"
98+
android:layout_width="0dp"
99+
android:layout_height="0dp"
100+
android:layout_centerInParent="true"
101+
/>
102+
103+
<CheckBox
104+
android:id="@+id/random_coloring_checkbox"
105+
android:layout_toRightOf="@id/layout_middle_point"
106+
android:layout_width="match_parent"
107+
android:layout_height="wrap_content"
108+
android:text="Random Coloring"
109+
android:checked="false"
110+
/>
111+
112+
<CheckBox
113+
android:id="@+id/custom_palette_checkbox"
114+
android:layout_toLeftOf="@id/layout_middle_point"
115+
android:layout_width="match_parent"
116+
android:layout_height="wrap_content"
117+
android:text="Custom Palette"
118+
/>
119+
120+
<CheckBox
121+
android:id="@+id/draw_stroke_checkbox"
122+
android:layout_below="@id/custom_palette_checkbox"
123+
android:layout_toLeftOf="@id/layout_middle_point"
98124
android:layout_width="match_parent"
99-
android:layout_height="wrap_content">
100-
101-
<CheckBox
102-
android:id="@+id/random_coloring_checkbox"
103-
android:layout_below="@+id/palette_seekbar"
104-
android:layout_width="0dp"
105-
android:layout_height="wrap_content"
106-
android:text="Random Coloring"
107-
android:checked="false"
108-
android:layout_weight="1"
109-
/>
110-
111-
<CheckBox
112-
android:id="@+id/custom_palette_checkbox"
113-
android:layout_below="@+id/draw_fill_checkbox"
114-
android:layout_width="0dp"
115-
android:layout_height="wrap_content"
116-
android:text="Custom Palette"
117-
android:layout_weight="1"
118-
/>
119-
</LinearLayout>
120-
121-
<LinearLayout
125+
android:layout_height="wrap_content"
126+
android:text="Draw Strokes"
127+
/>
128+
129+
<CheckBox
130+
android:id="@+id/draw_fill_checkbox"
131+
android:layout_below="@id/random_coloring_checkbox"
132+
android:layout_toRightOf="@id/layout_middle_point"
122133
android:layout_width="match_parent"
123-
android:layout_height="wrap_content">
124-
125-
<CheckBox
126-
android:id="@+id/draw_stroke_checkbox"
127-
android:layout_below="@+id/random_coloring_checkbox"
128-
android:layout_width="0dp"
129-
android:layout_height="wrap_content"
130-
android:text="Draw Strokes"
131-
android:layout_weight="1"
132-
/>
133-
134-
<CheckBox
135-
android:id="@+id/draw_fill_checkbox"
136-
android:layout_below="@+id/draw_stroke_checkbox"
137-
android:layout_width="0dp"
138-
android:layout_height="wrap_content"
139-
android:text="Fill Triangles"
140-
android:layout_weight="1"
141-
/>
142-
143-
</LinearLayout>
144-
145-
</LinearLayout>
134+
android:layout_height="wrap_content"
135+
android:text="Fill Triangles"
136+
/>
137+
138+
</RelativeLayout>
139+
146140
</RelativeLayout>
147141

148142
</RelativeLayout>

0 commit comments

Comments
 (0)