summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTony Wickham <twickham@google.com>2017-04-12 22:47:13 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-04-12 22:47:13 +0000
commit5a2a655475fb95d967a5468f98a3ea8fb82e3df9 (patch)
treef29b5ce542443e40da5d48f67f06025b7820688b /src
parent616bb65051f686906323b77593b69edbeee32616 (diff)
parent25e8f6d83e41e80a49d31fbbe4d9a94d854f726d (diff)
downloadandroid_packages_apps_Trebuchet-5a2a655475fb95d967a5468f98a3ea8fb82e3df9.tar.gz
android_packages_apps_Trebuchet-5a2a655475fb95d967a5468f98a3ea8fb82e3df9.tar.bz2
android_packages_apps_Trebuchet-5a2a655475fb95d967a5468f98a3ea8fb82e3df9.zip
Merge "Add app info icon with no shadow for popup" into ub-launcher3-dorval
am: 25e8f6d83e Change-Id: I8ea2798c98033d395e4afbbb5d86957518f33c22
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher3/popup/PopupPopulator.java16
-rw-r--r--src/com/android/launcher3/popup/SystemShortcut.java15
-rw-r--r--src/com/android/launcher3/widget/WidgetsAndMore.java2
3 files changed, 18 insertions, 15 deletions
diff --git a/src/com/android/launcher3/popup/PopupPopulator.java b/src/com/android/launcher3/popup/PopupPopulator.java
index 6349819a5..112889474 100644
--- a/src/com/android/launcher3/popup/PopupPopulator.java
+++ b/src/com/android/launcher3/popup/PopupPopulator.java
@@ -17,7 +17,7 @@
package com.android.launcher3.popup;
import android.content.ComponentName;
-import android.content.res.Resources;
+import android.content.Context;
import android.os.Handler;
import android.os.UserHandle;
import android.service.notification.StatusBarNotification;
@@ -293,15 +293,19 @@ public class PopupPopulator {
@Override
public void run() {
- final Resources res = mSystemShortcutChild.getResources();
+ final Context context = mSystemShortcutChild.getContext();
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(res));
- shortcutView.getBubbleText().setText(mSystemShortcutInfo.getLabel(res));
+ shortcutView.getIconView().setBackground(mSystemShortcutInfo.getIcon(context,
+ android.R.attr.textColorTertiary));
+ 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(res));
- shortcutIcon.setContentDescription(mSystemShortcutInfo.getLabel(res));
+ shortcutIcon.setImageDrawable(mSystemShortcutInfo.getIcon(context,
+ android.R.attr.textColorHint));
+ shortcutIcon.setContentDescription(mSystemShortcutInfo.getLabel(context));
}
if (!(mSystemShortcutInfo instanceof SystemShortcut.Widgets)) {
mSystemShortcutChild.setOnClickListener(mSystemShortcutInfo
diff --git a/src/com/android/launcher3/popup/SystemShortcut.java b/src/com/android/launcher3/popup/SystemShortcut.java
index d94db43b8..d08f876d7 100644
--- a/src/com/android/launcher3/popup/SystemShortcut.java
+++ b/src/com/android/launcher3/popup/SystemShortcut.java
@@ -1,6 +1,6 @@
package com.android.launcher3.popup;
-import android.content.res.Resources;
+import android.content.Context;
import android.graphics.drawable.Drawable;
import android.view.View;
@@ -10,6 +10,7 @@ import com.android.launcher3.Launcher;
import com.android.launcher3.R;
import com.android.launcher3.model.WidgetItem;
import com.android.launcher3.util.PackageUserKey;
+import com.android.launcher3.util.Themes;
import com.android.launcher3.widget.WidgetsAndMore;
import java.util.List;
@@ -29,14 +30,14 @@ public abstract class SystemShortcut {
mLabelResId = labelResId;
}
- public Drawable getIcon(Resources resources) {
- Drawable icon = resources.getDrawable(mIconResId);
- icon.setTint(resources.getColor(R.color.system_shortcuts_icon_color));
+ public Drawable getIcon(Context context, int colorAttr) {
+ Drawable icon = context.getResources().getDrawable(mIconResId);
+ icon.setTint(Themes.getAttrColor(context, colorAttr));
return icon;
}
- public String getLabel(Resources resources) {
- return resources.getString(mLabelResId);
+ public String getLabel(Context context) {
+ return context.getString(mLabelResId);
}
public abstract View.OnClickListener getOnClickListener(final Launcher launcher,
@@ -72,7 +73,7 @@ public abstract class SystemShortcut {
public static class AppInfo extends SystemShortcut {
public AppInfo() {
- super(R.drawable.ic_info_launcher, R.string.app_info_drop_target_label);
+ super(R.drawable.ic_info_no_shadow, R.string.app_info_drop_target_label);
}
@Override
diff --git a/src/com/android/launcher3/widget/WidgetsAndMore.java b/src/com/android/launcher3/widget/WidgetsAndMore.java
index 1aea534fd..a8e7e3826 100644
--- a/src/com/android/launcher3/widget/WidgetsAndMore.java
+++ b/src/com/android/launcher3/widget/WidgetsAndMore.java
@@ -53,8 +53,6 @@ import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
-import static android.R.attr.bottom;
-
/**
* Bottom sheet for the "Widgets & more" long-press option.
*/