mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-03 17:36:49 +00:00
Show promise app icon progress in All Apps and setup market intent
on clicking promise app icon in All Apps. Only the progress will be changed with animation on progress update, no relayout is performed. If the icon is newly bound, the progress will not be animated. Bug: 23952570 Change-Id: I98d3f945f08a2abadf53f20e6007c15e56d5d410
This commit is contained in:
@@ -51,7 +51,7 @@ public class PackageInstallStateChangedTask extends ExtendedModelTask {
|
||||
}
|
||||
|
||||
synchronized (apps) {
|
||||
final ArrayList<AppInfo> updated = new ArrayList<>();
|
||||
PromiseAppInfo updated = null;
|
||||
final ArrayList<AppInfo> removed = new ArrayList<>();
|
||||
for (int i=0; i < apps.size(); i++) {
|
||||
final AppInfo appInfo = apps.get(i);
|
||||
@@ -61,7 +61,7 @@ public class PackageInstallStateChangedTask extends ExtendedModelTask {
|
||||
final PromiseAppInfo promiseAppInfo = (PromiseAppInfo) appInfo;
|
||||
if (mInstallInfo.state == PackageInstallerCompat.STATUS_INSTALLING) {
|
||||
promiseAppInfo.level = mInstallInfo.progress;
|
||||
updated.add(appInfo);
|
||||
updated = promiseAppInfo;
|
||||
} else if (mInstallInfo.state == PackageInstallerCompat.STATUS_FAILED
|
||||
|| mInstallInfo.state == PackageInstallerCompat.STATUS_INSTALLED) {
|
||||
apps.removePromiseApp(appInfo);
|
||||
@@ -70,13 +70,12 @@ public class PackageInstallStateChangedTask extends ExtendedModelTask {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!updated.isEmpty()) {
|
||||
if (updated != null) {
|
||||
final PromiseAppInfo updatedPromiseApp = updated;
|
||||
scheduleCallbackTask(new CallbackTask() {
|
||||
@Override
|
||||
public void execute(Callbacks callbacks) {
|
||||
// TODO: this currently causes unnecessary relayouts
|
||||
// we need to introduce a new bindPromiseAppsChanged
|
||||
callbacks.bindAppsUpdated(updated);
|
||||
callbacks.bindPromiseAppProgressUpdated(updatedPromiseApp);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user