am 59afe180: am 4be827fa: am b2485825: am 6d509eb6: Merge "Give minidrawer items an activated state background" into ub-gmail-ur14-dev

* commit '59afe1801c22a5dcb5799f77d5212940fd74ab70':
  Give minidrawer items an activated state background
diff --git a/res/drawable/folder_item.xml b/res/drawable/folder_item.xml
index 98b1588..f639396 100644
--- a/res/drawable/folder_item.xml
+++ b/res/drawable/folder_item.xml
@@ -17,6 +17,6 @@
 -->
 
 <selector xmlns:android="http://schemas.android.com/apk/res/android">
-    <item android:state_activated="true" android:drawable="@color/drawer_item_selected_background_color" />
+    <item android:state_activated="true" android:drawable="@color/drawer_item_activated_background_color" />
     <item android:drawable="@android:color/transparent" />
 </selector>
diff --git a/res/drawable/mini_drawer_folder_background.xml b/res/drawable/mini_drawer_folder_background.xml
new file mode 100644
index 0000000..295643f
--- /dev/null
+++ b/res/drawable/mini_drawer_folder_background.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+     Copyright (C) 2014 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.
+-->
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:state_activated="true">
+        <shape>
+            <corners android:radius="2dp" />
+            <solid android:color="@color/mini_drawer_activated_background_color" />
+        </shape>
+    </item>
+    <item android:drawable="@android:color/transparent" />
+</selector>
diff --git a/res/layout/mini_drawer_folder_item.xml b/res/layout/mini_drawer_folder_item.xml
index e8b9ae7..fcfeacd 100644
--- a/res/layout/mini_drawer_folder_item.xml
+++ b/res/layout/mini_drawer_folder_item.xml
@@ -15,6 +15,12 @@
      See the License for the specific language governing permissions and
      limitations under the License.
 -->
-
-<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
-    style="@style/MiniDrawerFolderStyle" />
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_height="wrap_content"
+    android:layout_width="wrap_content"
+    android:layout_gravity="center_horizontal"
+    android:background="@drawable/mini_drawer_folder_background">
+    <ImageView
+        android:id="@+id/image_view"
+        style="@style/MiniDrawerFolderStyle" />
+</FrameLayout>
diff --git a/res/values-v21/colors.xml b/res/values-v21/colors.xml
index fe91d0f..45fe3a5 100644
--- a/res/values-v21/colors.xml
+++ b/res/values-v21/colors.xml
@@ -16,6 +16,7 @@
      limitations under the License.
 -->
 <resources>
+    <color name="mini_drawer_activated_background_color">#e4e4e4</color>
     <color name="text_color_undo_notification">@color/text_color_grey</color>
     <color name="text_color_undo_notification_description">@color/text_color_black</color>
-</resources>
\ No newline at end of file
+</resources>
diff --git a/res/values/colors.xml b/res/values/colors.xml
index 7869230..74cc016 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -53,7 +53,9 @@
     <color name="account_item_selected_text_color">@color/mail_app_blue</color>
     <color name="folder_list_heading_text_color">@color/text_color_medium_grey</color>
     <color name="list_background_color">@android:color/white</color>
-    <color name="drawer_item_selected_background_color">#12000000</color>
+    <color name="drawer_item_activated_background_color">#12000000</color>
+    <color name="mini_drawer_activated_background_color">#d3d3d3</color>
+
     <!-- overridden in sw600dp -->
     <color name="folder_list_divider_color">@color/divider_color</color>
 
diff --git a/src/com/android/mail/ui/MiniDrawerView.java b/src/com/android/mail/ui/MiniDrawerView.java
index 4ebe641..4d815b8 100644
--- a/src/com/android/mail/ui/MiniDrawerView.java
+++ b/src/com/android/mail/ui/MiniDrawerView.java
@@ -22,6 +22,7 @@
 import android.util.AttributeSet;
 import android.view.LayoutInflater;
 import android.view.View;
+import android.view.ViewGroup;
 import android.widget.ImageView;
 import android.widget.LinearLayout;
 import android.widget.ListAdapter;
@@ -151,12 +152,13 @@
             while (folderCursor.moveToPosition(++pos)) {
                 final Folder f = folderCursor.getModel();
                 if (f.isInbox()) {
-                    final ImageView iv = (ImageView) mInflater.inflate(
+                    final View view = mInflater.inflate(
                             R.layout.mini_drawer_folder_item, this, false /* attachToRoot */);
+                    final ImageView iv = (ImageView) view.findViewById(R.id.image_view);
                     iv.setTag(new FolderItem(f, iv));
                     iv.setContentDescription(f.name);
-                    iv.setActivated(mController.isSelectedFolder(f));
-                    addView(iv, 1 + numInboxes);
+                    view.setActivated(mController.isSelectedFolder(f));
+                    addView(view, 1 + numInboxes);
                     numInboxes++;
                 }
             }