Fixing RTL issues with Clings. (Bug 11008488)

Change-Id: I78f891eabab53d6ded18f7c843504219d71e2883
diff --git a/res/drawable-hdpi/cling.9.png b/res/drawable-hdpi/cling.9.png
index 42a889f..36fbfc8 100644
--- a/res/drawable-hdpi/cling.9.png
+++ b/res/drawable-hdpi/cling.9.png
Binary files differ
diff --git a/res/drawable-hdpi/cling_button.9.png b/res/drawable-hdpi/cling_button.9.png
index 4dbe564..e308382 100644
--- a/res/drawable-hdpi/cling_button.9.png
+++ b/res/drawable-hdpi/cling_button.9.png
Binary files differ
diff --git a/res/drawable-hdpi/cling_button_pressed.9.png b/res/drawable-hdpi/cling_button_pressed.9.png
index 2a85cab..4f9ca6f 100644
--- a/res/drawable-hdpi/cling_button_pressed.9.png
+++ b/res/drawable-hdpi/cling_button_pressed.9.png
Binary files differ
diff --git a/res/drawable-mdpi/cling.9.png b/res/drawable-mdpi/cling.9.png
index f6f730d..4c0f139 100644
--- a/res/drawable-mdpi/cling.9.png
+++ b/res/drawable-mdpi/cling.9.png
Binary files differ
diff --git a/res/drawable-mdpi/cling_button.9.png b/res/drawable-mdpi/cling_button.9.png
index 38de60a..a0b6f97 100644
--- a/res/drawable-mdpi/cling_button.9.png
+++ b/res/drawable-mdpi/cling_button.9.png
Binary files differ
diff --git a/res/drawable-mdpi/cling_button_pressed.9.png b/res/drawable-mdpi/cling_button_pressed.9.png
index c60837d..986e669 100644
--- a/res/drawable-mdpi/cling_button_pressed.9.png
+++ b/res/drawable-mdpi/cling_button_pressed.9.png
Binary files differ
diff --git a/res/drawable-xhdpi/cling.9.png b/res/drawable-xhdpi/cling.9.png
index 9cc03c9..1cb4681 100644
--- a/res/drawable-xhdpi/cling.9.png
+++ b/res/drawable-xhdpi/cling.9.png
Binary files differ
diff --git a/res/drawable-xhdpi/cling_button.9.png b/res/drawable-xhdpi/cling_button.9.png
index 1c93bc4..4192563 100644
--- a/res/drawable-xhdpi/cling_button.9.png
+++ b/res/drawable-xhdpi/cling_button.9.png
Binary files differ
diff --git a/res/drawable-xhdpi/cling_button_pressed.9.png b/res/drawable-xhdpi/cling_button_pressed.9.png
index b5d4aae..d3ce469 100644
--- a/res/drawable-xhdpi/cling_button_pressed.9.png
+++ b/res/drawable-xhdpi/cling_button_pressed.9.png
Binary files differ
diff --git a/res/drawable-xxhdpi/cling.9.png b/res/drawable-xxhdpi/cling.9.png
index 3dcf121..7beae03 100644
--- a/res/drawable-xxhdpi/cling.9.png
+++ b/res/drawable-xxhdpi/cling.9.png
Binary files differ
diff --git a/res/drawable-xxhdpi/cling_button.9.png b/res/drawable-xxhdpi/cling_button.9.png
index 4f68a03..e412876 100644
--- a/res/drawable-xxhdpi/cling_button.9.png
+++ b/res/drawable-xxhdpi/cling_button.9.png
Binary files differ
diff --git a/res/drawable-xxhdpi/cling_button_pressed.9.png b/res/drawable-xxhdpi/cling_button_pressed.9.png
index 4bc0337..55e89da 100644
--- a/res/drawable-xxhdpi/cling_button_pressed.9.png
+++ b/res/drawable-xxhdpi/cling_button_pressed.9.png
Binary files differ
diff --git a/res/drawable/cling_arrow_end.xml b/res/drawable/cling_arrow_end.xml
new file mode 100644
index 0000000..3f63c7d
--- /dev/null
+++ b/res/drawable/cling_arrow_end.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2013 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
+        android:src="@drawable/cling_arrow_right"
+        android:autoMirrored="true">
+</bitmap>
diff --git a/res/drawable/cling_arrow_start.xml b/res/drawable/cling_arrow_start.xml
new file mode 100644
index 0000000..ebe9183
--- /dev/null
+++ b/res/drawable/cling_arrow_start.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2013 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
+        android:src="@drawable/cling_arrow_left"
+        android:autoMirrored="true">
+</bitmap>
diff --git a/res/layout-port/first_run_cling.xml b/res/layout-port/first_run_cling.xml
index 9baee64..4830e5d 100644
--- a/res/layout-port/first_run_cling.xml
+++ b/res/layout-port/first_run_cling.xml
@@ -54,11 +54,13 @@
         <TextView
             style="@style/ClingHintText"
             android:id="@+id/search_bar_hint"
-            android:layout_width="160dp"
+            android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_gravity="top|end"
             android:layout_marginEnd="10dp"
             android:layout_marginTop="65dp"
+            android:gravity="center_horizontal"
+            android:maxWidth="160dp"
             android:visibility="gone"
             android:drawableTop="@drawable/cling_arrow_up"
             android:drawablePadding="5dp"
@@ -66,23 +68,26 @@
         <TextView
             style="@style/ClingHintText"
             android:id="@+id/custom_content_hint"
-            android:layout_width="160dp"
+            android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:layout_gravity="top"
+            android:layout_gravity="top|start"
             android:layout_marginStart="10dp"
+            android:layout_marginEnd="10dp"
             android:layout_marginTop="100dp"
+            android:maxWidth="160dp"
             android:visibility="gone"
-            android:drawableStart="@drawable/cling_arrow_left"
+            android:drawableStart="@drawable/cling_arrow_start"
             android:drawablePadding="10dp"
             android:text="@string/first_run_cling_custom_content_hint" />
         <TextView
             style="@style/ClingHintText"
-            android:layout_width="160dp"
+            android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_gravity="bottom|end"
             android:layout_marginEnd="10dp"
             android:layout_marginBottom="85dp"
-            android:drawableEnd="@drawable/cling_arrow_right"
+            android:maxWidth="180dp"
+            android:drawableEnd="@drawable/cling_arrow_end"
             android:drawablePadding="5dp"
             android:text="@string/first_run_cling_create_screens_hint" />
     </FrameLayout>
diff --git a/res/layout-port/workspace_cling.xml b/res/layout-port/workspace_cling.xml
index e61340e..9c000cb 100644
--- a/res/layout-port/workspace_cling.xml
+++ b/res/layout-port/workspace_cling.xml
@@ -62,9 +62,9 @@
             android:id="@+id/focused_hotseat_app_bubble"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:layout_gravity="bottom|end"
-            android:layout_marginEnd="25dp"
-            android:layout_marginBottom="100dp"
+            android:layout_gravity="bottom|right"
+            android:layout_marginRight="25dp"
+            android:layout_marginBottom="90dp"
             android:orientation="vertical"
             android:visibility="gone">
             <LinearLayout
@@ -90,8 +90,8 @@
             <ImageView
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:layout_gravity="end"
-                android:layout_marginEnd="80dp"
+                android:layout_gravity="right"
+                android:layout_marginRight="80dp"
                 android:src="@drawable/cling_arrow_down" />
         </LinearLayout>
     </FrameLayout>
@@ -101,7 +101,7 @@
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_marginBottom="15dp"
-        android:layout_marginStart="20dp"
-        android:layout_gravity="bottom|start"
+        android:layout_marginLeft="20dp"
+        android:layout_gravity="bottom|left"
         android:onClick="dismissWorkspaceCling" />
 </com.android.launcher3.Cling>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 3e2ffce..d26a73b 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -230,29 +230,29 @@
     <string name="apps_customize_widgets_scroll_format">Widgets page %1$d of %2$d</string>
 
     <!-- Clings -->
-    <!-- The title text for the workspace cling [CHAR_LIMIT=none] -->
+    <!-- The title text for the workspace cling [CHAR_LIMIT=60] -->
     <string name="first_run_cling_title">Welcome!</string>
-    <!-- The description of how to use the workspace [CHAR_LIMIT=none] -->
+    <!-- The description of how to use the workspace [CHAR_LIMIT=60] -->
     <string name="first_run_cling_description">Make yourself at home.</string>
-    <!-- The description of how to use the workspace [CHAR_LIMIT=none] -->
+    <!-- The description of how to use the workspace [CHAR_LIMIT=60] -->
     <string name="first_run_cling_custom_content_hint"></string>
-    <!-- The description of how to use the workspace [CHAR_LIMIT=none] -->
+    <!-- The description of how to use the workspace [CHAR_LIMIT=60] -->
     <string name="first_run_cling_search_bar_hint"></string>
-    <!-- The description of how to use the workspace [CHAR_LIMIT=none] -->
+    <!-- The description of how to use the workspace [CHAR_LIMIT=60] -->
     <string name="first_run_cling_create_screens_hint">Create more screens for apps and folders</string>
-    <!-- The title text for the workspace cling [CHAR_LIMIT=none] -->
+    <!-- The title text for the workspace cling [CHAR_LIMIT=60] -->
     <string name="workspace_cling_title">Organize your space</string>
-    <!-- The description of how to use the workspace [CHAR_LIMIT=none] -->
+    <!-- The description of how to use the workspace [CHAR_LIMIT=160] -->
     <string name="workspace_cling_move_item">Touch &amp; hold background to manage wallpaper, widgets and settings.</string>
-    <!-- The title text for the All Apps cling [CHAR_LIMIT=none] -->
+    <!-- The title text for the All Apps cling [CHAR_LIMIT=60] -->
     <string name="all_apps_cling_title">Choose some apps</string>
-    <!-- The description of how to pick up and add an item to the workspace [CHAR_LIMIT=none] -->
+    <!-- The description of how to pick up and add an item to the workspace [CHAR_LIMIT=160] -->
     <string name="all_apps_cling_add_item">To add an app to your Home screen, touch &amp; hold it.</string>
-    <!-- The title text for the Folder cling [CHAR_LIMIT=none] -->
+    <!-- The title text for the Folder cling [CHAR_LIMIT=60] -->
     <string name="folder_cling_title">Here\'s a folder</string>
-    <!-- The description of how to create a folder [CHAR_LIMIT=none] -->
+    <!-- The description of how to create a folder [CHAR_LIMIT=160] -->
     <string name="folder_cling_create_folder">To create one like this, touch &amp; hold an app, then move it over another.</string>
-    <!-- The text on the button to dismiss a cling [CHAR_LIMIT=none] -->
+    <!-- The text on the button to dismiss a cling [CHAR_LIMIT=30] -->
     <string name="cling_dismiss">OK</string>
     <!-- Error message on dummy custom cling layout [DO NOT TRANSLATE] -->
     <string name="dummy_custom_cling_error_message">Error: custom workspace layout passed in but custom cling was not overwritten</string>