Fix MessageAttachmentBar rtl padding. b/11971620.

Change-Id: I55b77d5c42399a53e90e85dac638cbc73a19eccb
diff --git a/res/layout-ldrtl/conversation_message_attachment_bar_progress_bar.xml b/res/layout-ldrtl/conversation_message_attachment_bar_progress_bar.xml
new file mode 100644
index 0000000..03ec638
--- /dev/null
+++ b/res/layout-ldrtl/conversation_message_attachment_bar_progress_bar.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+    Copyright (C) 2013 Google Inc.
+    Licensed to 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.
+-->
+
+<ProgressBar
+        xmlns:android="http://schemas.android.com/apk/res/android"
+        android:id="@+id/attachment_progress"
+        style="?android:attr/progressBarStyleHorizontal"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_below="@id/attachment_title"
+        android:layout_marginEnd="@dimen/message_attachment_bar_padding"
+        android:indeterminate="true"
+        android:visibility="invisible"/>
\ No newline at end of file
diff --git a/res/layout/conversation_message_attachment_bar.xml b/res/layout/conversation_message_attachment_bar.xml
index d6032df..dc3c40e 100644
--- a/res/layout/conversation_message_attachment_bar.xml
+++ b/res/layout/conversation_message_attachment_bar.xml
@@ -31,10 +31,10 @@
             android:id="@+id/attachment_icon"
             android:layout_width="48dip"
             android:layout_height="match_parent"
-            android:layout_marginRight="8dip"
             android:background="@color/attachment_image_background_color"
             android:scaleType="center"
-            android:src="@drawable/ic_menu_attachment_holo_light" />
+            android:src="@drawable/ic_menu_attachment_holo_light"
+            style="@style/MessageAttachmentBarMarginEndStyle" />
 
         <RelativeLayout
             android:layout_width="0dip"
@@ -46,32 +46,24 @@
                 android:id="@+id/attachment_title"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:layout_marginRight="8dip"
                 android:ellipsize="end"
                 android:singleLine="true"
                 android:textColor="#333333"
-                android:textSize="14sp" />
+                android:textSize="14sp"
+                style="@style/MessageAttachmentBarMarginEndStyle" />
 
             <TextView
                 android:id="@+id/attachment_subtitle"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
                 android:layout_below="@id/attachment_title"
-                android:layout_marginRight="8dip"
                 android:ellipsize="end"
                 android:singleLine="true"
                 android:textColor="#aaaaaa"
-                android:textSize="12sp" />
+                android:textSize="12sp"
+                style="@style/MessageAttachmentBarMarginEndStyle" />
 
-            <ProgressBar
-                android:id="@+id/attachment_progress"
-                style="?android:attr/progressBarStyleHorizontal"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:layout_below="@id/attachment_title"
-                android:layout_marginRight="8dip"
-                android:indeterminate="true"
-                android:visibility="invisible" />
+            <include layout="@layout/conversation_message_attachment_bar_progress_bar"/>
         </RelativeLayout>
 
         <ImageView
diff --git a/res/layout/conversation_message_attachment_bar_progress_bar.xml b/res/layout/conversation_message_attachment_bar_progress_bar.xml
new file mode 100644
index 0000000..7340eb7
--- /dev/null
+++ b/res/layout/conversation_message_attachment_bar_progress_bar.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+    Copyright (C) 2013 Google Inc.
+    Licensed to 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.
+-->
+
+<ProgressBar
+        xmlns:android="http://schemas.android.com/apk/res/android"
+        android:id="@+id/attachment_progress"
+        style="?android:attr/progressBarStyleHorizontal"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_below="@id/attachment_title"
+        android:layout_marginRight="@dimen/message_attachment_bar_padding"
+        android:indeterminate="true"
+        android:visibility="invisible"/>
\ No newline at end of file
diff --git a/res/values-ldrtl/styles-ldrtl.xml b/res/values-ldrtl/styles-ldrtl.xml
index 39511a0..effce6c 100644
--- a/res/values-ldrtl/styles-ldrtl.xml
+++ b/res/values-ldrtl/styles-ldrtl.xml
@@ -256,4 +256,8 @@
     <style name="FolderParentIconStyle">
         <item name="android:layout_alignParentEnd">true</item>
     </style>
+
+    <style name="MessageAttachmentBarMarginEndStyle">
+        <item name="android:layout_marginEnd">@dimen/message_attachment_bar_padding</item>
+    </style>
 </resources>
diff --git a/res/values/dimen.xml b/res/values/dimen.xml
index 0aadef4..a121313 100644
--- a/res/values/dimen.xml
+++ b/res/values/dimen.xml
@@ -151,4 +151,6 @@
 
     <dimen name="new_message_button_padding">24dip</dimen>
 
+    <dimen name="message_attachment_bar_padding">8dip</dimen>
+
 </resources>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index dd780d4..42047ab 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -794,4 +794,8 @@
     <style name="ToastButtonStyle">
         <item name="android:background">?android:attr/selectableItemBackground</item>
     </style>
+
+    <style name="MessageAttachmentBarMarginEndStyle">
+        <item name="android:layout_marginRight">@dimen/message_attachment_bar_padding</item>
+    </style>
 </resources>