mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-03 09:26:51 +00:00
Add UI updates for incremental app installs.
1. Changed Preload Icon UI to be grayscale while the app is not startable. 2. Added progress bar for when app is installed but still ownloading. 3. Updated Preload Icon progress and click handling to use new incremental api. Progress bar color updates will follow in a separate CL. Demo: https://drive.google.com/file/d/1H1EvtTorLeJwC1eiq10tm-TT81YZ6osk/view?usp=sharing Bug: 171008815 Test: manual Change-Id: I5874a5146d79a8c91d7d90ff0b9c1c427a3c95dd
This commit is contained in:
@@ -57,21 +57,15 @@ public class WorkspaceItemInfo extends ItemInfoWithIcon {
|
||||
*/
|
||||
public static final int FLAG_AUTOINSTALL_ICON = 1 << 1;
|
||||
|
||||
/**
|
||||
* The icon is being installed. If {@link #FLAG_RESTORED_ICON} or {@link #FLAG_AUTOINSTALL_ICON}
|
||||
* is set, then the icon is either being installed or is in a broken state.
|
||||
*/
|
||||
public static final int FLAG_INSTALL_SESSION_ACTIVE = 1 << 2;
|
||||
|
||||
/**
|
||||
* Indicates that the widget restore has started.
|
||||
*/
|
||||
public static final int FLAG_RESTORE_STARTED = 1 << 3;
|
||||
public static final int FLAG_RESTORE_STARTED = 1 << 2;
|
||||
|
||||
/**
|
||||
* Web UI supported.
|
||||
*/
|
||||
public static final int FLAG_SUPPORTS_WEB_UI = 1 << 4;
|
||||
public static final int FLAG_SUPPORTS_WEB_UI = 1 << 3;
|
||||
|
||||
/**
|
||||
* The intent used to start the application.
|
||||
@@ -98,11 +92,6 @@ public class WorkspaceItemInfo extends ItemInfoWithIcon {
|
||||
*/
|
||||
@NonNull private String[] personKeys = Utilities.EMPTY_STRING_ARRAY;
|
||||
|
||||
/**
|
||||
* The installation progress [0-100] of the package that this shortcut represents.
|
||||
*/
|
||||
private int mInstallProgress;
|
||||
|
||||
|
||||
public WorkspaceItemInfo() {
|
||||
itemType = LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT;
|
||||
@@ -114,7 +103,6 @@ public class WorkspaceItemInfo extends ItemInfoWithIcon {
|
||||
intent = new Intent(info.intent);
|
||||
iconResource = info.iconResource;
|
||||
status = info.status;
|
||||
mInstallProgress = info.mInstallProgress;
|
||||
personKeys = info.personKeys.clone();
|
||||
}
|
||||
|
||||
@@ -168,15 +156,6 @@ public class WorkspaceItemInfo extends ItemInfoWithIcon {
|
||||
return isPromise() && !hasStatusFlag(FLAG_SUPPORTS_WEB_UI);
|
||||
}
|
||||
|
||||
public int getInstallProgress() {
|
||||
return mInstallProgress;
|
||||
}
|
||||
|
||||
public void setInstallProgress(int progress) {
|
||||
mInstallProgress = progress;
|
||||
status |= FLAG_INSTALL_SESSION_ACTIVE;
|
||||
}
|
||||
|
||||
public void updateFromDeepShortcutInfo(ShortcutInfo shortcutInfo, Context context) {
|
||||
// {@link ShortcutInfo#getActivity} can change during an update. Recreate the intent
|
||||
intent = ShortcutKey.makeIntent(shortcutInfo);
|
||||
|
||||
Reference in New Issue
Block a user