OSDN Git Service

Fix bug #7198585 Settings > Display > Dream completely broken in RTL
authorFabrice Di Meglio <fdimeglio@google.com>
Thu, 20 Sep 2012 22:30:49 +0000 (15:30 -0700)
committerFabrice Di Meglio <fdimeglio@google.com>
Thu, 20 Sep 2012 22:30:49 +0000 (15:30 -0700)
- use start/end instead of left/right
- use android:textDirection="locale" on the TextView for forcing the
correct position of the title text

Change-Id: I968798dcd4ac9307ffc3e48369990b73d3d1b4db

res/layout/dream_info_row.xml

index 356a82a..c2d90fb 100644 (file)
@@ -23,7 +23,7 @@
         android:id="@android:id/widget_frame"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:layout_toLeftOf="@+id/divider"
+        android:layout_toStartOf="@+id/divider"
         android:background="?android:attr/selectableItemBackground" >
 
         <!-- Dream icon -->
@@ -34,8 +34,8 @@
             android:layout_height="@android:dimen/app_icon_size"
             android:layout_centerVertical="true"
             android:layout_marginBottom="10dp"
-            android:layout_marginLeft="0dp"
-            android:layout_marginRight="6dp"
+            android:layout_marginStart="0dp"
+            android:layout_marginEnd="6dp"
             android:layout_marginTop="10dp"
             android:contentDescription="@null"
             android:maxHeight="@android:dimen/app_icon_size"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:layout_centerVertical="true"
-            android:layout_toLeftOf="@android:id/button1"
-            android:layout_toRightOf="@android:id/icon"
+            android:layout_toStartOf="@android:id/button1"
+            android:layout_toEndOf="@android:id/icon"
             android:ellipsize="end"
             android:singleLine="true"
-            android:textAppearance="?android:attr/textAppearanceMedium" />
+            android:textAppearance="?android:attr/textAppearanceMedium"
+            android:textDirection="locale" />
 
         <!-- Dream radio button -->
 
@@ -61,7 +62,7 @@
             android:id="@android:id/button1"
             android:layout_width="wrap_content"
             android:layout_height="match_parent"
-            android:layout_alignParentRight="true"
+            android:layout_alignParentEnd="true"
             android:layout_centerVertical="true"
             android:duplicateParentState="true" />
     </RelativeLayout>
@@ -73,7 +74,7 @@
         android:layout_width="wrap_content"
         android:layout_height="match_parent"
         android:layout_centerVertical="true"
-        android:layout_toLeftOf="@android:id/button2"
+        android:layout_toStartOf="@android:id/button2"
         android:contentDescription="@null"
         android:src="@drawable/nav_divider" />
 
@@ -84,7 +85,7 @@
         android:layout_width="wrap_content"
         android:layout_height="match_parent"
         android:layout_alignBottom="@android:id/widget_frame"
-        android:layout_alignParentRight="true"
+        android:layout_alignParentEnd="true"
         android:layout_alignTop="@android:id/widget_frame"
         android:layout_centerVertical="true"
         android:layout_margin="0dip"