Skip to content

Commit 488d275

Browse files
author
Fabrice Di Meglio
committed
Fix bug #7198224 TimePicker widget shouldn't be completely RTL
- force layout direction to ltr for hours and minutes Change-Id: I56f892fba3d5c80b7848d667e123a6236eeb9ec7
1 parent 4e7b551 commit 488d275

File tree

2 files changed

+60
-46
lines changed

2 files changed

+60
-46
lines changed

core/res/res/layout/time_picker.xml

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,31 @@
2525
android:layout_width="wrap_content"
2626
android:layout_height="wrap_content">
2727

28-
<!-- hour -->
29-
<NumberPicker
30-
android:id="@+id/hour"
31-
android:layout_width="70dip"
28+
<LinearLayout android:orientation="horizontal"
29+
android:layout_width="wrap_content"
3230
android:layout_height="wrap_content"
33-
android:focusable="true"
34-
android:focusableInTouchMode="true"
35-
/>
31+
android:layoutDirection="ltr">
3632

37-
<!-- minute -->
38-
<NumberPicker
39-
android:id="@+id/minute"
40-
android:layout_width="70dip"
41-
android:layout_height="wrap_content"
42-
android:layout_marginStart="5dip"
43-
android:focusable="true"
44-
android:focusableInTouchMode="true"
45-
/>
33+
<!-- hour -->
34+
<NumberPicker
35+
android:id="@+id/hour"
36+
android:layout_width="70dip"
37+
android:layout_height="wrap_content"
38+
android:focusable="true"
39+
android:focusableInTouchMode="true"
40+
/>
41+
42+
<!-- minute -->
43+
<NumberPicker
44+
android:id="@+id/minute"
45+
android:layout_width="70dip"
46+
android:layout_height="wrap_content"
47+
android:layout_marginStart="5dip"
48+
android:focusable="true"
49+
android:focusableInTouchMode="true"
50+
/>
51+
52+
</LinearLayout>
4653

4754
<!-- AM / PM -->
4855
<Button

core/res/res/layout/time_picker_holo.xml

Lines changed: 37 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -25,40 +25,47 @@
2525
android:layout_width="wrap_content"
2626
android:layout_height="wrap_content">
2727

28-
<!-- hour -->
29-
<NumberPicker
30-
android:id="@+id/hour"
28+
<LinearLayout android:orientation="horizontal"
3129
android:layout_width="wrap_content"
3230
android:layout_height="wrap_content"
33-
android:layout_marginTop="16dip"
34-
android:layout_marginBottom="16dip"
35-
android:layout_marginStart="16dip"
36-
android:layout_marginEnd="6dip"
37-
android:focusable="true"
38-
android:focusableInTouchMode="true"
39-
/>
31+
android:layoutDirection="ltr">
4032

41-
<!-- divider -->
42-
<TextView
43-
android:id="@+id/divider"
44-
android:layout_width="wrap_content"
45-
android:layout_height="wrap_content"
46-
android:layout_gravity="center_vertical"
47-
android:importantForAccessibility="no"
48-
/>
33+
<!-- hour -->
34+
<NumberPicker
35+
android:id="@+id/hour"
36+
android:layout_width="wrap_content"
37+
android:layout_height="wrap_content"
38+
android:layout_marginTop="16dip"
39+
android:layout_marginBottom="16dip"
40+
android:layout_marginStart="16dip"
41+
android:layout_marginEnd="6dip"
42+
android:focusable="true"
43+
android:focusableInTouchMode="true"
44+
/>
4945

50-
<!-- minute -->
51-
<NumberPicker
52-
android:id="@+id/minute"
53-
android:layout_width="wrap_content"
54-
android:layout_height="wrap_content"
55-
android:layout_marginTop="16dip"
56-
android:layout_marginBottom="16dip"
57-
android:layout_marginStart="6dip"
58-
android:layout_marginEnd="8dip"
59-
android:focusable="true"
60-
android:focusableInTouchMode="true"
61-
/>
46+
<!-- divider -->
47+
<TextView
48+
android:id="@+id/divider"
49+
android:layout_width="wrap_content"
50+
android:layout_height="wrap_content"
51+
android:layout_gravity="center_vertical"
52+
android:importantForAccessibility="no"
53+
/>
54+
55+
<!-- minute -->
56+
<NumberPicker
57+
android:id="@+id/minute"
58+
android:layout_width="wrap_content"
59+
android:layout_height="wrap_content"
60+
android:layout_marginTop="16dip"
61+
android:layout_marginBottom="16dip"
62+
android:layout_marginStart="6dip"
63+
android:layout_marginEnd="8dip"
64+
android:focusable="true"
65+
android:focusableInTouchMode="true"
66+
/>
67+
68+
</LinearLayout>
6269

6370
<!-- AM / PM -->
6471
<NumberPicker

0 commit comments

Comments
 (0)