Fix bug #8133419 Android Download Manager/Installer should be mirrored for RTL languages

- update PackageInstaller layouts for supporting RTL
- enable RTL support by adding android:supportsRtl="true" in the AndroidManifest

Change-Id: I656ff6771a2f2e684e3c6e7a1302a864b12f6187
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index de11795..b135b3f 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -13,7 +13,8 @@
     <uses-permission android:name="android.permission.MANAGE_USERS" />
     <application android:label="@string/app_name"
             android:allowBackup="false"
-            android:theme="@android:style/Theme.DeviceDefault.DialogWhenLarge.NoActionBar">
+            android:theme="@android:style/Theme.DeviceDefault.DialogWhenLarge.NoActionBar"
+            android:supportsRtl="true">
         <activity android:name=".PackageInstallerActivity"
                 android:configChanges="orientation|keyboardHidden|screenSize"
                 android:excludeFromRecents="true">
diff --git a/res/layout/app_details.xml b/res/layout/app_details.xml
index 7f35d72..0e2cd07 100644
--- a/res/layout/app_details.xml
+++ b/res/layout/app_details.xml
@@ -24,17 +24,17 @@
     android:id="@+id/app_snippet"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
-    android:paddingLeft="16dip"
-    android:paddingRight="16dip"
+    android:paddingStart="16dip"
+    android:paddingEnd="16dip"
     android:paddingTop="24dip"
     >
     <ImageView android:id="@+id/app_icon"
         android:layout_width="32dip"
         android:layout_height="32dip"
-        android:layout_marginLeft="8dip"
+        android:layout_marginStart="8dip"
         android:background="@color/transparent"
-        android:layout_alignParentLeft="true"
-        android:gravity="left"
+        android:layout_alignParentStart="true"
+        android:gravity="start"
         android:scaleType="centerCrop"/>
     <TextView android:id="@+id/app_name"
         android:layout_width="wrap_content"
@@ -44,12 +44,12 @@
         android:textColor="?android:attr/textColorPrimary"
         android:shadowColor="@color/shadow"
         android:shadowRadius="2"
-        android:layout_toRightOf="@id/app_icon"
+        android:layout_toEndOf="@id/app_icon"
         android:singleLine="true"
         android:layout_centerInParent="true"
-        android:paddingRight="16dip"
+        android:paddingEnd="16dip"
         android:paddingTop="3dip"
-        android:paddingLeft="16dip"
+        android:paddingStart="16dip"
         android:ellipsize="end"/>
     <FrameLayout
         android:id="@+id/top_divider"
diff --git a/res/layout/install_confirm.xml b/res/layout/install_confirm.xml
index f9fb359..86ea165 100644
--- a/res/layout/install_confirm.xml
+++ b/res/layout/install_confirm.xml
@@ -120,7 +120,7 @@
             <Button android:id="@+id/cancel_button"
                     android:layout_width="0dip"
                     android:layout_height="wrap_content"
-                    android:layout_gravity="left"
+                    android:layout_gravity="start"
                     android:layout_weight="1"
                     android:text="@string/cancel"
                     android:maxLines="2"
@@ -129,7 +129,7 @@
             <Button android:id="@+id/ok_button"
                     android:layout_width="0dip"
                     android:layout_height="wrap_content"
-                    android:layout_gravity="right"
+                    android:layout_gravity="end"
                     android:layout_weight="1"
                     android:text="@string/next"
                     android:maxLines="2"
diff --git a/res/layout/op_progress.xml b/res/layout/op_progress.xml
index 6b26940..1c2cef5 100644
--- a/res/layout/op_progress.xml
+++ b/res/layout/op_progress.xml
@@ -45,7 +45,7 @@
             <Button android:id="@+id/done_button"
                     android:layout_width="0dip"
                     android:layout_height="wrap_content"
-                    android:layout_gravity="left"
+                    android:layout_gravity="start"
                     android:layout_weight="1"
                     android:text="@string/done"
                     android:maxLines="2"
@@ -54,7 +54,7 @@
             <Button android:id="@+id/launch_button"
                     android:layout_width="0dip"
                     android:layout_height="wrap_content"
-                    android:layout_gravity="right"
+                    android:layout_gravity="end"
                     android:layout_weight="1"
                     android:text="@string/launch"
                     android:maxLines="2"
@@ -82,11 +82,11 @@
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:layout_below="@id/app_snippet"
-            android:gravity="left"
+            android:gravity="start"
             android:text="@string/installing"
             android:paddingTop="16dip"
-            android:paddingLeft="32dip"
-            android:paddingRight="32dip"
+            android:paddingStart="32dip"
+            android:paddingEnd="32dip"
             android:textAppearance="?android:attr/textAppearanceMedium" />
 
     <!-- This explanation text is shown only after the progress bar below goes away. -->
@@ -96,7 +96,7 @@
             android:layout_above="@id/buttons_panel"
             android:layout_below="@id/center_text"
             android:paddingTop="8dip"
-            android:paddingLeft="16dip"
+            android:paddingStart="16dip"
             android:paddingBottom="16dip">
         <TextView
                 android:id="@+id/center_explanation"
diff --git a/res/layout/uninstall_confirm.xml b/res/layout/uninstall_confirm.xml
index 9ef0036..f604023 100644
--- a/res/layout/uninstall_confirm.xml
+++ b/res/layout/uninstall_confirm.xml
@@ -57,8 +57,8 @@
             android:layout_height="wrap_content"
             android:textColor="?android:attr/textColorSecondary"
             android:textAppearance="?android:attr/textAppearanceMedium"
-            android:paddingLeft="24dip"
-            android:paddingRight="24dip" />
+            android:paddingStart="24dip"
+            android:paddingEnd="24dip" />
 
     </LinearLayout>
 
@@ -88,7 +88,7 @@
             <Button android:id="@+id/cancel_button"
                 android:layout_width="0dip"
                 android:layout_height="wrap_content"
-                android:layout_gravity="left"
+                android:layout_gravity="start"
                 android:layout_weight="1"
                 android:text="@string/cancel"
                 android:maxLines="2"
@@ -97,7 +97,7 @@
             <Button android:id="@+id/ok_button"
                 android:layout_width="0dip"
                 android:layout_height="wrap_content"
-                android:layout_gravity="right"
+                android:layout_gravity="end"
                 android:layout_weight="1"
                 android:text="@string/ok"
                 android:maxLines="2"
diff --git a/res/layout/uninstall_progress.xml b/res/layout/uninstall_progress.xml
index bd1854b..ff80fe1 100644
--- a/res/layout/uninstall_progress.xml
+++ b/res/layout/uninstall_progress.xml
@@ -82,8 +82,8 @@
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
                 android:layout_alignParentTop="true"
-                android:paddingLeft="24dip"
-                android:paddingRight="24dip"
+                android:paddingStart="24dip"
+                android:paddingEnd="24dip"
                 android:paddingTop="8dip"
                 android:paddingBottom="8dip"
                 android:fillViewport="false">
@@ -92,7 +92,7 @@
                     android:id="@+id/center_text"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
-                    android:gravity="left"
+                    android:gravity="start"
                     android:text="@string/uninstalling"
                     android:textAppearance="?android:attr/textAppearanceMedium"/>
         </ScrollView>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 5a5cb7e..f935675 100755
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -16,8 +16,8 @@
 
 <resources>
     <style name="padded">
-        <item name="android:paddingLeft">16dip</item>
-        <item name="android:paddingRight">16dip</item>
+        <item name="android:paddingStart">16dip</item>
+        <item name="android:paddingEnd">16dip</item>
     </style>
     <style name="DialogWhenLarge" parent="@android:style/Theme.DeviceDefault.NoActionBar">
     </style>