For archived apps, reset icon span as soon as BubbleTextView starts unarchiving

Bug: 350758155
Test: locally verify
Flag: com.android.launcher3.use_new_icon_for_archived_apps
Change-Id: Icc76c1bf300b2aa7883e571333bef1d33698f899
This commit is contained in:
Charlie Anderson
2024-08-21 15:51:16 -04:00
parent cafe06f63d
commit 1a30d3ab8c
@@ -1043,12 +1043,11 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
/** Applies the given progress level to the this icon's progress bar. */
@Nullable
public PreloadIconDrawable applyProgressLevel() {
if (!(getTag() instanceof ItemInfoWithIcon)
if (!(getTag() instanceof ItemInfoWithIcon info)
|| ((ItemInfoWithIcon) getTag()).isInactiveArchive()) {
return null;
}
ItemInfoWithIcon info = (ItemInfoWithIcon) getTag();
int progressLevel = info.getProgressLevel();
if (progressLevel >= 100) {
setContentDescription(info.contentDescription != null
@@ -1068,6 +1067,10 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
} else {
preloadIconDrawable = makePreloadIcon();
setIcon(preloadIconDrawable);
if (info.isArchived() && Flags.useNewIconForArchivedApps()) {
// reapply text without cloud icon as soon as unarchiving is triggered
applyLabel(info);
}
}
return preloadIconDrawable;
}