Add support for progress bar for archived apps in AllApps view.

Working Video: https://drive.google.com/file/d/1-cSD63FQLmqyeTkUuXqcSsjb03m31ULO/view?usp=sharing

Test: TaplPromiseIconUiTest
Bug: 302115555
Bug: 317108448
Flag: ACONFIG com.android.launcher3.enable_support_for_archiving DEVELOPMENT
Change-Id: Iebaa338789430c5e0a004bd8b05bdbda87cd986e
This commit is contained in:
Rohit Goyal committed 2024-01-17 22:49:08 +05:30
1 parent 0c8439e17d
commit 04fe042e83
4 files changed
+66 -18

No files matched your search

+10 -5
View File
@@ -933,9 +933,7 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
if (mIcon instanceof PreloadIconDrawable) {
preloadIconDrawable = (PreloadIconDrawable) mIcon;
preloadIconDrawable.setLevel(progressLevel);
// TODO(b/302115555): For archived apps, show icon as disabled if active session
// exists.
preloadIconDrawable.setIsDisabled(info.getProgressLevel() == 0);
preloadIconDrawable.setIsDisabled(isIconDisabled(info));
} else {
preloadIconDrawable = makePreloadIcon();
setIcon(preloadIconDrawable);
@@ -960,11 +958,18 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
final PreloadIconDrawable preloadDrawable = newPendingIcon(getContext(), info);
preloadDrawable.setLevel(progressLevel);
// TODO(b/302115555): For archived apps, show icon as disabled if active session exists.
preloadDrawable.setIsDisabled(info.getProgressLevel() == 0);
preloadDrawable.setIsDisabled(isIconDisabled(info));
return preloadDrawable;
}
private boolean isIconDisabled(ItemInfoWithIcon info) {
if (info.isArchived()) {
return info.getProgressLevel() == 0
&& (info.runtimeStatusFlags & FLAG_INSTALL_SESSION_ACTIVE) != 0;
}
return info.getProgressLevel() == 0;
}
public void applyDotState(ItemInfo itemInfo, boolean animate) {
if (mIcon instanceof FastBitmapDrawable) {
boolean wasDotted = mDotInfo != null;