OSDN Git Service

RTL support for Lollipop Land.
authorDan Sandler <dsandler@android.com>
Thu, 4 Dec 2014 21:07:30 +0000 (16:07 -0500)
committerDan Sandler <dsandler@android.com>
Thu, 4 Dec 2014 21:07:30 +0000 (16:07 -0500)
Since the game randomly flips horizontally anyway, forcing
the game view to LTR fixes the coordinate math without
affecting gameplay. (The score view did need to move to
start instead of left, however.)

Bug: 18628150
Change-Id: I7cf8bd1e2b9a2316d30e17a9251173598c687c2b

packages/SystemUI/res/layout/lland.xml
packages/SystemUI/src/com/android/systemui/egg/LLand.java

index 053225d..71a16c9 100644 (file)
             android:textSize="32sp"
             android:textColor="#FFAAAAAA"
             android:layout_marginTop="32dp"
-            android:layout_marginLeft="16dp"
-            android:layout_gravity="top|left"
-            android:paddingLeft="16dp"
-            android:paddingRight="16dp"
+            android:layout_marginStart="16dp"
+            android:layout_gravity="top|start"
+            android:paddingStart="16dp"
+            android:paddingEnd="16dp"
             android:paddingTop="8dp"
             android:paddingBottom="8dp"
             android:background="@drawable/scorecard"
index 5de09a3..fa257b1 100644 (file)
@@ -178,6 +178,9 @@ public class LLand extends FrameLayout {
         setFocusable(true);
         PARAMS = new Params(getResources());
         mTimeOfDay = irand(0, SKIES.length);
+
+        // we assume everything will be laid out left|top
+        setLayoutDirection(LAYOUT_DIRECTION_LTR);
     }
 
     @Override