summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJon Miranda <jonmiranda@google.com>2019-09-09 15:36:08 -0700
committerJonathan Miranda <jonmiranda@google.com>2019-09-10 15:51:25 +0000
commitbdda7251dfdf6901f495c57ba26944e88222d78f (patch)
treefb6d1bb7bb3752a9cc11d70fc44addd59e68dfe4 /src
parent01f8fb91326aba7c4c5a7193a825528dd910393f (diff)
downloadandroid_packages_apps_Trebuchet-bdda7251dfdf6901f495c57ba26944e88222d78f.tar.gz
android_packages_apps_Trebuchet-bdda7251dfdf6901f495c57ba26944e88222d78f.tar.bz2
android_packages_apps_Trebuchet-bdda7251dfdf6901f495c57ba26944e88222d78f.zip
Ensure the icon load request matches the ItemInfo for the floating view.
This fixes the bug where the wrong icon is present during the app close animation. Bug: 138195597 Change-Id: Ife2c6ad135dde54583f6f2bb2caf3b1e9325e064 Merged-In: Ib3767ec5c2b4eb22b35e5148879e11d2c1b28e3c
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher3/views/FloatingIconView.java18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/com/android/launcher3/views/FloatingIconView.java b/src/com/android/launcher3/views/FloatingIconView.java
index 15b8d4675..f728a6776 100644
--- a/src/com/android/launcher3/views/FloatingIconView.java
+++ b/src/com/android/launcher3/views/FloatingIconView.java
@@ -721,7 +721,7 @@ public class FloatingIconView extends View implements
*/
@UiThread
public static IconLoadResult fetchIcon(Launcher l, View v, ItemInfo info, boolean isOpening) {
- IconLoadResult result = new IconLoadResult();
+ IconLoadResult result = new IconLoadResult(info);
new Handler(LauncherModel.getWorkerLooper()).postAtFrontOfQueue(() -> {
RectF position = new RectF();
getLocationBoundsForView(l, v, isOpening, position);
@@ -750,10 +750,13 @@ public class FloatingIconView extends View implements
// Get the drawable on the background thread
boolean shouldLoadIcon = originalView.getTag() instanceof ItemInfo && hideOriginal;
- view.mIconLoadResult = sIconLoadResult;
- if (shouldLoadIcon && view.mIconLoadResult == null) {
- view.mIconLoadResult = fetchIcon(launcher, originalView,
- (ItemInfo) originalView.getTag(), isOpening);
+ if (shouldLoadIcon) {
+ if (sIconLoadResult != null && sIconLoadResult.itemInfo == originalView.getTag()) {
+ view.mIconLoadResult = sIconLoadResult;
+ } else {
+ view.mIconLoadResult = fetchIcon(launcher, originalView,
+ (ItemInfo) originalView.getTag(), isOpening);
+ }
}
sIconLoadResult = null;
@@ -895,10 +898,15 @@ public class FloatingIconView extends View implements
}
private static class IconLoadResult {
+ final ItemInfo itemInfo;
Drawable drawable;
Drawable badge;
int iconOffset;
Runnable onIconLoaded;
boolean isIconLoaded;
+
+ public IconLoadResult(ItemInfo itemInfo) {
+ this.itemInfo = itemInfo;
+ }
}
}