diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2017-04-13 19:54:56 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2017-04-13 19:54:56 +0000 |
commit | 5474521b759cb2f78f8f44f7c057b2a7e730677c (patch) | |
tree | 46c192537b08cdb3e075fdc0fc3d14476e034407 | |
parent | 971ef4568d4381025c18ceeb193ad31ab38d0043 (diff) | |
parent | c66c3e2ba4876c9d383c1d7deddeee474f1c4859 (diff) | |
download | android_packages_apps_Trebuchet-5474521b759cb2f78f8f44f7c057b2a7e730677c.tar.gz android_packages_apps_Trebuchet-5474521b759cb2f78f8f44f7c057b2a7e730677c.tar.bz2 android_packages_apps_Trebuchet-5474521b759cb2f78f8f44f7c057b2a7e730677c.zip |
Merge "Fix build - move system shortcut icon colors to theme" into ub-launcher3-master
-rw-r--r-- | res/drawable/ic_info_no_shadow.xml | 2 | ||||
-rw-r--r-- | res/layout/system_shortcut.xml | 1 | ||||
-rw-r--r-- | res/layout/system_shortcut_icon_only.xml | 1 | ||||
-rw-r--r-- | res/values/colors.xml | 3 | ||||
-rw-r--r-- | res/values/styles.xml | 15 | ||||
-rw-r--r-- | src/com/android/launcher3/popup/PopupPopulator.java | 6 | ||||
-rw-r--r-- | src/com/android/launcher3/popup/SystemShortcut.java | 6 |
7 files changed, 22 insertions, 12 deletions
diff --git a/res/drawable/ic_info_no_shadow.xml b/res/drawable/ic_info_no_shadow.xml index 3d0c6d6e4..5f145c9f1 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 113b1bed1..cd1202588 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 313c69c69..2b58b92ee 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 ddf451f72..a3d26e34a 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 26ddb9c6a..c3d11e446 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 112889474..3ba4ebafd 100644 --- a/src/com/android/launcher3/popup/PopupPopulator.java +++ b/src/com/android/launcher3/popup/PopupPopulator.java @@ -297,14 +297,12 @@ public class PopupPopulator { 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 d08f876d7..889fc5278 100644 --- a/src/com/android/launcher3/popup/SystemShortcut.java +++ b/src/com/android/launcher3/popup/SystemShortcut.java @@ -30,10 +30,8 @@ public abstract class SystemShortcut { 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) { |