Merge "Fix build - move system shortcut icon colors to theme" into ub-launcher3-master
diff --git a/res/drawable/ic_info_no_shadow.xml b/res/drawable/ic_info_no_shadow.xml
index 3d0c6d6..5f145c9 100644
--- a/res/drawable/ic_info_no_shadow.xml
+++ b/res/drawable/ic_info_no_shadow.xml
@@ -19,6 +19,6 @@
         android:viewportWidth="24.0"
         android:viewportHeight="24.0">
     <path
-        android:fillColor="@color/workspace_icon_text_color"
+        android:fillColor="?android:attr/textColorPrimary"
         android:pathData="M11 17h2v-6h-2v6zm1-15C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zM11 9h2V7h-2v2z"/>
 </vector>
diff --git a/res/layout/system_shortcut.xml b/res/layout/system_shortcut.xml
index 113b1be..cd12025 100644
--- a/res/layout/system_shortcut.xml
+++ b/res/layout/system_shortcut.xml
@@ -15,6 +15,7 @@
 -->
 
 <com.android.launcher3.shortcuts.DeepShortcutView
+    android:theme="@style/IconWithTextSystemShortcut"
     xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:launcher="http://schemas.android.com/apk/res-auto"
     android:layout_width="@dimen/bg_popup_item_width"
diff --git a/res/layout/system_shortcut_icon_only.xml b/res/layout/system_shortcut_icon_only.xml
index 313c69c..2b58b92 100644
--- a/res/layout/system_shortcut_icon_only.xml
+++ b/res/layout/system_shortcut_icon_only.xml
@@ -16,6 +16,7 @@
 
 <ImageView
     xmlns:android="http://schemas.android.com/apk/res/android"
+    android:theme="@style/IconOnlySystemShortcut"
     android:layout_width="@dimen/system_shortcut_header_icon_touch_size"
     android:layout_height="@dimen/system_shortcut_header_icon_touch_size"
     android:background="?android:attr/selectableItemBackgroundBorderless"
diff --git a/res/values/colors.xml b/res/values/colors.xml
index ddf451f..a3d26e3 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -37,9 +37,6 @@
     <color name="notification_color_beneath">#E0E0E0</color> <!-- Gray 300 -->
     <color name="divider_color">@color/notification_color_beneath</color>
 
-    <!-- System shortcuts -->
-    <color name="system_shortcuts_icon_color">@android:color/tertiary_text_light</color>
-
     <color name="icon_background">#E0E0E0</color> <!-- Gray 300 -->
     <color name="legacy_icon_background">#FFFFFF</color>
 </resources>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 26ddb9c..c3d11e4 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -91,6 +91,21 @@
         <item name="android:shadowColor">#B0000000</item>
     </style>
 
+    <!-- Theme for the popup container -->
+    <style name="PopupContainer" parent="@style/LauncherTheme">
+        <!-- TODO: move hardcoded colors from colors.xml to this theme and use for popup items -->
+    </style>
+    <style name="IconOnlySystemShortcut">
+        <!-- The icons use this color, then are tinted -->
+        <item name="android:textColorPrimary">@android:color/white</item>
+        <item name="android:tint">?android:attr/textColorHint</item>
+    </style>
+    <style name="IconWithTextSystemShortcut">
+        <!-- The icons use this color, then are tinted -->
+        <item name="android:textColorPrimary">@android:color/white</item>
+        <item name="android:backgroundTint">?android:attr/textColorTertiary</item>
+    </style>
+
     <!-- Drop targets -->
     <style name="DropTargetButtonBase">
         <item name="android:drawablePadding">7.5dp</item>
diff --git a/src/com/android/launcher3/popup/PopupPopulator.java b/src/com/android/launcher3/popup/PopupPopulator.java
index 1128894..3ba4eba 100644
--- a/src/com/android/launcher3/popup/PopupPopulator.java
+++ b/src/com/android/launcher3/popup/PopupPopulator.java
@@ -297,14 +297,12 @@
             if (mSystemShortcutChild instanceof DeepShortcutView) {
                 // Expanded system shortcut, with both icon and text shown on white background.
                 final DeepShortcutView shortcutView = (DeepShortcutView) mSystemShortcutChild;
-                shortcutView.getIconView().setBackground(mSystemShortcutInfo.getIcon(context,
-                        android.R.attr.textColorTertiary));
+                shortcutView.getIconView().setBackground(mSystemShortcutInfo.getIcon(context));
                 shortcutView.getBubbleText().setText(mSystemShortcutInfo.getLabel(context));
             } else if (mSystemShortcutChild instanceof ImageView) {
                 // Only the system shortcut icon shows on a gray background header.
                 final ImageView shortcutIcon = (ImageView) mSystemShortcutChild;
-                shortcutIcon.setImageDrawable(mSystemShortcutInfo.getIcon(context,
-                        android.R.attr.textColorHint));
+                shortcutIcon.setImageDrawable(mSystemShortcutInfo.getIcon(context));
                 shortcutIcon.setContentDescription(mSystemShortcutInfo.getLabel(context));
             }
             if (!(mSystemShortcutInfo instanceof SystemShortcut.Widgets)) {
diff --git a/src/com/android/launcher3/popup/SystemShortcut.java b/src/com/android/launcher3/popup/SystemShortcut.java
index d08f876..889fc52 100644
--- a/src/com/android/launcher3/popup/SystemShortcut.java
+++ b/src/com/android/launcher3/popup/SystemShortcut.java
@@ -30,10 +30,8 @@
         mLabelResId = labelResId;
     }
 
-    public Drawable getIcon(Context context, int colorAttr) {
-        Drawable icon = context.getResources().getDrawable(mIconResId);
-        icon.setTint(Themes.getAttrColor(context, colorAttr));
-        return icon;
+    public Drawable getIcon(Context context) {
+        return context.getResources().getDrawable(mIconResId, context.getTheme());
     }
 
     public String getLabel(Context context) {