Fix overlapping unread and name in drawer

For both folders and accounts, there were issues
with overlapping views and layout. Had to revert
back to a 2-deep heirarchy for the folder and
account item views.

Bug: 8765425 Overlapping unread counts and account name
Change-Id: I9e791cd7b4ce36e70032dcf9900df47121ac2a98
diff --git a/res/layout/account_item.xml b/res/layout/account_item.xml
index 9db0f9c..c861970 100644
--- a/res/layout/account_item.xml
+++ b/res/layout/account_item.xml
@@ -38,10 +38,18 @@
         android:layout_centerVertical="true"/>
 
     <TextView
+        android:id="@+id/unread"
+        style="@style/UnreadCount"
+        android:layout_marginRight="@dimen/account_item_right_margin"
+        android:layout_alignParentRight="true"
+        android:textColor="@color/account_item_text_color" />
+
+    <TextView
         android:id="@+id/name"
         android:layout_height="wrap_content"
         android:layout_width="wrap_content"
         android:layout_toRightOf="@id/account_radio_button"
+        android:layout_toLeftOf="@id/unread"
         android:layout_alignWithParentIfMissing="true"
         android:layout_marginLeft="@dimen/account_item_left_margin"
         android:layout_marginRight="@dimen/account_item_right_margin"
@@ -52,11 +60,4 @@
         android:textColor="@color/account_item_text_color"
         android:textAppearance="?android:attr/textAppearanceMedium" />
 
-    <TextView
-        android:id="@+id/unread"
-        style="@style/UnreadCount"
-        android:layout_marginRight="@dimen/account_item_right_margin"
-        android:layout_alignParentRight="true"
-        android:textColor="@color/account_item_text_color" />
-
 </com.android.mail.ui.AccountItemView>
diff --git a/res/layout/folder_item.xml b/res/layout/folder_item.xml
index 40f952e..c36d272 100644
--- a/res/layout/folder_item.xml
+++ b/res/layout/folder_item.xml
@@ -38,12 +38,31 @@
         android:layout_alignParentLeft="true"
         android:layout_alignParentTop="true" />
 
+    <FrameLayout
+        android:id="@+id/message_counts"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_centerVertical="true"
+        android:layout_marginRight="@dimen/folder_list_item_right_margin"
+        android:layout_alignParentRight="true">
+
+        <TextView
+            android:id="@+id/unread"
+            style="@style/UnreadCount" />
+
+        <TextView
+            android:id="@+id/unseen"
+            style="@style/UnseenCount" />
+
+    </FrameLayout>
+
     <ImageView
         android:id="@+id/folder_icon"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_centerVertical="true"
         android:layout_marginLeft="@dimen/folder_list_item_left_margin"
+        android:layout_alignParentLeft="true"
         android:visibility="gone" />
 
     <TextView
@@ -52,6 +71,7 @@
         android:layout_width="wrap_content"
         android:layout_centerVertical="true"
         android:layout_toRightOf="@id/folder_icon"
+        android:layout_toLeftOf="@id/message_counts"
         android:layout_alignWithParentIfMissing="true"
         android:layout_marginLeft="@dimen/folder_list_item_left_margin"
         android:layout_marginRight="@dimen/folder_list_item_right_margin"
@@ -61,17 +81,4 @@
         android:textColor="@color/folder_item_text_color"
         android:textAppearance="?android:attr/textAppearanceMedium" />
 
-    <TextView
-        android:id="@+id/unread"
-        style="@style/UnreadCount"
-        android:layout_marginRight="@dimen/folder_list_item_right_margin"
-        android:layout_alignParentRight="true"
-        android:textColor="@color/folder_item_text_color" />
-
-    <TextView
-        android:id="@+id/unseen"
-        style="@style/UnseenCount"
-        android:layout_marginRight="@dimen/folder_list_item_right_margin"
-        android:layout_alignParentRight="true"/>
-
 </com.android.mail.ui.FolderItemView>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index cd4f70b..4d3836d 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -157,6 +157,7 @@
         <item name="android:singleLine">true</item>
         <item name="android:includeFontPadding">true</item>
         <item name="android:textSize">14sp</item>
+        <item name="android:textColor">@color/folder_item_text_color</item>
         <item name="android:paddingTop">4dp</item>
         <item name="android:paddingBottom">4dp</item>
     </style>