summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2017-06-23 00:21:01 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2017-06-23 00:21:02 +0000
commit9e83ba5a5bdf96b0b0872001df8f1f15348e06c0 (patch)
treec442b54ddd9200e78190bf3a55bd3688147db4f2 /src/com/android/launcher3
parentb715701554c19e15ff7c2a762a6f58b9987295d9 (diff)
parent1da138903bc8412615edacd7a447c6ffc25851d4 (diff)
downloadandroid_packages_apps_Trebuchet-9e83ba5a5bdf96b0b0872001df8f1f15348e06c0.tar.gz
android_packages_apps_Trebuchet-9e83ba5a5bdf96b0b0872001df8f1f15348e06c0.tar.bz2
android_packages_apps_Trebuchet-9e83ba5a5bdf96b0b0872001df8f1f15348e06c0.zip
Merge "Adding support in IconProvider for loading different icons for UI and model use" into ub-launcher3-dorval-polish
Diffstat (limited to 'src/com/android/launcher3')
-rw-r--r--src/com/android/launcher3/IconCache.java6
-rw-r--r--src/com/android/launcher3/IconProvider.java7
-rw-r--r--src/com/android/launcher3/dragndrop/DragView.java2
3 files changed, 11 insertions, 4 deletions
diff --git a/src/com/android/launcher3/IconCache.java b/src/com/android/launcher3/IconCache.java
index 09ca5c5cd..ec30de834 100644
--- a/src/com/android/launcher3/IconCache.java
+++ b/src/com/android/launcher3/IconCache.java
@@ -170,7 +170,11 @@ public class IconCache {
}
public Drawable getFullResIcon(LauncherActivityInfo info) {
- return mIconProvider.getIcon(info, mIconDpi);
+ return getFullResIcon(info, true);
+ }
+
+ public Drawable getFullResIcon(LauncherActivityInfo info, boolean flattenDrawable) {
+ return mIconProvider.getIcon(info, mIconDpi, flattenDrawable);
}
protected Bitmap makeDefaultIcon(UserHandle user) {
diff --git a/src/com/android/launcher3/IconProvider.java b/src/com/android/launcher3/IconProvider.java
index a5d399013..687251514 100644
--- a/src/com/android/launcher3/IconProvider.java
+++ b/src/com/android/launcher3/IconProvider.java
@@ -24,8 +24,11 @@ public class IconProvider {
return mSystemState;
}
-
- public Drawable getIcon(LauncherActivityInfo info, int iconDpi) {
+ /**
+ * @param flattenDrawable true if the caller does not care about the specification of the
+ * original icon as long as the flattened version looks the same.
+ */
+ public Drawable getIcon(LauncherActivityInfo info, int iconDpi, boolean flattenDrawable) {
return info.getIcon(iconDpi);
}
}
diff --git a/src/com/android/launcher3/dragndrop/DragView.java b/src/com/android/launcher3/dragndrop/DragView.java
index ab2f10036..022b3b8b1 100644
--- a/src/com/android/launcher3/dragndrop/DragView.java
+++ b/src/com/android/launcher3/dragndrop/DragView.java
@@ -272,7 +272,7 @@ public class DragView extends FrameLayout {
.resolveActivity(info.getIntent(), info.user);
outObj[0] = activityInfo;
return (activityInfo != null) ? appState.getIconCache()
- .getFullResIcon(activityInfo) : null;
+ .getFullResIcon(activityInfo, false) : null;
} else if (info.itemType == LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT) {
if (info instanceof PendingAddShortcutInfo) {
ShortcutConfigActivityInfo activityInfo =