OSDN Git Service

Fix TimePicker RTL issues
authorChet Haase <chet@google.com>
Mon, 26 Jun 2017 13:44:57 +0000 (06:44 -0700)
committerandroid-build-team Robot <android-build-team-robot@google.com>
Mon, 26 Jun 2017 20:44:43 +0000 (20:44 +0000)
The TimePicker (seen when creating an alarm in the Clock app) has
two bugs in landscape mode:
- The hours/minutes switch places (hours should always be to the left
of minutes, regardless of RTL)
- The layout is completely messed up in 12-hour mode (the radial time picker
does not appear on the screen)

This fix addresses both issues by setting the layoutDirection="ltr"
attribute to force a couple of the layouts to be unaffected in RTL mode.
Specifically, the hours/minutes layout and the overall layout will always be
presented left-to-right.

Bug: 62846484  TimePicker layout is broken in RTL landscape mode
Test: manual (tested with/without fix in normal, forded-RTL mode, and
with Hebrew as the first locale).

Change-Id: I8ef3f2706660f60c162ba3d324a18b8f370f67f8
(cherry picked from commit e2dfa0e343b5a0babb050b08355e781da3bbd516)

core/res/res/layout-land/time_picker_material.xml

index 863efef..d83ccb2 100644 (file)
@@ -17,6 +17,7 @@
 
 <LinearLayout
     xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layoutDirection="ltr"
     android:layout_width="match_parent"
     android:layout_height="wrap_content">
 
@@ -30,6 +31,7 @@
 
         <LinearLayout
             android:id="@+id/time_layout"
+            android:layoutDirection="ltr"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:paddingTop="@dimen/timepicker_radial_picker_top_margin"