Preloads the icon drawable for app open to reduce latency b/w swapping views.

For app close, we already load the icon as soon as we can.

Bug: 135130011
Change-Id: Ia2c45737cf24d1ab5911b222ae097d7a1f9d6a31
This commit is contained in:
Jon Miranda committed 2019-06-13 13:17:25 -07:00
1 parent 3d6e96d526
commit 6dfa312896
4 files changed
+263 -143

No files matched your search

@@ -49,6 +49,7 @@ import com.android.launcher3.folder.Folder;
import com.android.launcher3.folder.FolderIcon;
import com.android.launcher3.testing.TestProtocol;
import com.android.launcher3.util.PackageManagerHelper;
import com.android.launcher3.views.FloatingIconView;
import com.android.launcher3.widget.PendingAppWidgetHostView;
import com.android.launcher3.widget.WidgetAddFlowHandler;
@@ -259,6 +260,10 @@ public class ItemClickHandler {
intent.setPackage(null);
}
}
if (v != null && launcher.getAppTransitionManager().supportsAdaptiveIconAnimation()) {
// Preload the icon to reduce latency b/w swapping the floating view with the original.
FloatingIconView.fetchIcon(launcher, v, item, true /* isOpening */);
}
launcher.startActivitySafely(v, intent, item, sourceContainer);
}
}