RTL the widget and add label colors back.

Fixes b/11128778 and b/12553867.

Change-Id: I71c5554b065e890155fceefc2d92fa6ee6ec11c5
diff --git a/res/layout/widget_conversation_list_item.xml b/res/layout/widget_conversation_list_item.xml
index 457ca2d..891db59 100644
--- a/res/layout/widget_conversation_list_item.xml
+++ b/res/layout/widget_conversation_list_item.xml
@@ -35,76 +35,73 @@
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:background="@drawable/widget_conversation_read_selector" />
-    <RelativeLayout
+    <LinearLayout
         android:id="@+id/content"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
-        android:paddingLeft="16dip"
-        android:paddingRight="16dip">
-        <RelativeLayout
-            android:id="@+id/labels"
-            android:layout_width="wrap_content"
+        android:orientation="vertical" >
+        <LinearLayout
+            android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:layout_alignParentRight="true"
-            android:gravity="right" >
-            <ImageView
-                android:id="@+id/widget_folder_0"
-                android:layout_width="32dip"
-                android:layout_height="6sp"
-                android:scaleType="fitXY" />
-            <ImageView
-                android:id="@+id/widget_folder_1"
-                android:layout_width="32dip"
-                android:layout_height="6sp"
-                android:layout_toRightOf="@id/widget_folder_0"
-                android:scaleType="fitXY" />
-            <ImageView
-                android:id="@+id/widget_folder_2"
-                android:layout_width="32dip"
-                android:layout_height="6sp"
-                android:layout_toRightOf="@id/widget_folder_1"
-                android:scaleType="fitXY" />
-        </RelativeLayout>
-        <RelativeLayout
-            android:id="@+id/widget_attachment_and_date"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_alignParentTop="true"
-            android:layout_alignParentRight="true"
             android:layout_marginTop="10sp"
+            android:layout_marginLeft="16dip"
+            android:layout_marginRight="16dip"
+            android:gravity="top"
             android:orientation="horizontal" >
+            <TextView
+                android:id="@+id/widget_senders"
+                android:layout_width="0dip"
+                android:layout_height="wrap_content"
+                android:layout_weight="1"
+                android:singleLine="true"
+                android:ellipsize="end"
+                android:textSize="@dimen/senders_font_size"
+                android:textColor="#58585b"
+                android:includeFontPadding="false"
+                style="@style/WidgetSendersStyle" />
             <!-- Use negative margins to align attachment icon with text -->
             <ImageView
                 android:id="@+id/widget_attachment"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:layout_marginTop="-4sp" />
+                android:layout_marginTop="-4sp"/>
             <TextView
                 android:id="@+id/widget_date"
                 android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_toRightOf="@id/widget_attachment" />
-        </RelativeLayout>
-        <TextView
-            android:id="@+id/widget_senders"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_alignParentTop="true"
-            android:layout_alignParentLeft="true"
-            android:layout_toLeftOf="@id/widget_attachment_and_date"
-            android:layout_marginTop="10sp"
-            android:paddingRight="16dip"
-            android:singleLine="true"
-            android:ellipsize="end"
-            android:textSize="@dimen/senders_font_size"
-            android:textColor="#58585b"
-            android:includeFontPadding="false" />
+                android:layout_height="match_parent"
+                android:gravity="top" />
+        </LinearLayout>
+
         <TextView
             android:id="@+id/widget_subject"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:layout_below="@id/widget_senders"
+            android:layout_marginLeft="16dip"
+            android:layout_marginRight="16dip"
             android:maxLines="2"
             android:includeFontPadding="false" />
-    </RelativeLayout>
+        <LinearLayout
+            android:id="@+id/labels"
+            android:layout_width="wrap_content"
+            android:layout_height="0dip"
+            android:layout_weight="1"
+            android:layout_gravity="right|end"
+            android:gravity="bottom" >
+            <ImageView
+                    android:id="@+id/widget_folder_0"
+                    android:layout_width="32dip"
+                    android:layout_height="6sp"
+                    android:scaleType="fitXY" />
+            <ImageView
+                    android:id="@+id/widget_folder_1"
+                    android:layout_width="32dip"
+                    android:layout_height="6sp"
+                    android:scaleType="fitXY" />
+            <ImageView
+                    android:id="@+id/widget_folder_2"
+                    android:layout_width="32dip"
+                    android:layout_height="6sp"
+                    android:scaleType="fitXY" />
+        </LinearLayout>
+    </LinearLayout>
 </FrameLayout>
\ No newline at end of file
diff --git a/res/values-ldrtl/styles-ldrtl.xml b/res/values-ldrtl/styles-ldrtl.xml
index 7ddfd2c..9d86240 100644
--- a/res/values-ldrtl/styles-ldrtl.xml
+++ b/res/values-ldrtl/styles-ldrtl.xml
@@ -264,4 +264,8 @@
     <style name="RecipientComposeHeading" parent="@style/AbstractRecipientComposeHeading">
         <item name="android:layout_marginEnd">@dimen/compose_recipient_heading_margin_end</item>
     </style>
+
+    <style name="WidgetSendersStyle">
+        <item name="android:paddingEnd">@dimen/widget_senders_padding_end</item>
+    </style>
 </resources>
diff --git a/res/values/constants.xml b/res/values/constants.xml
index e307446..1dd9b84 100644
--- a/res/values/constants.xml
+++ b/res/values/constants.xml
@@ -71,7 +71,7 @@
     <integer name="config_image_cache_max_bitmaps">24</integer>
 
     <!-- Whether to display folder colors in the widget -->
-    <bool name="display_folder_colors_in_widget">false</bool>
+    <bool name="display_folder_colors_in_widget">true</bool>
 
     <integer name="max_num_notification_digest_items">10</integer>
 
diff --git a/res/values/dimen.xml b/res/values/dimen.xml
index c8d2d99..c71d4b4 100644
--- a/res/values/dimen.xml
+++ b/res/values/dimen.xml
@@ -155,4 +155,6 @@
 
     <dimen name="compose_recipient_heading_margin_end">4dip</dimen>
 
+    <dimen name="widget_senders_padding_end">16dip</dimen>
+
 </resources>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index f552e2c..f3de6e4 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -801,4 +801,8 @@
     <style name="MessageAttachmentBarMarginEndStyle">
         <item name="android:layout_marginRight">@dimen/message_attachment_bar_padding</item>
     </style>
+
+    <style name="WidgetSendersStyle">
+        <item name="android:paddingRight">@dimen/widget_senders_padding_end</item>
+    </style>
 </resources>