diff options
author | Jon Miranda <jonmiranda@google.com> | 2019-06-12 13:33:51 -0700 |
---|---|---|
committer | Jon Miranda <jonmiranda@google.com> | 2019-06-13 13:17:25 -0700 |
commit | 6dfa312896bf48d8e6c6d3bcc3851452ca7d6a06 (patch) | |
tree | 229f5ec05c268f675a77b59100ad95615764542c /src/com/android/launcher3/touch | |
parent | 3d6e96d5265cdea78ad4e01b0f9fde0eea539094 (diff) | |
download | android_packages_apps_Trebuchet-6dfa312896bf48d8e6c6d3bcc3851452ca7d6a06.tar.gz android_packages_apps_Trebuchet-6dfa312896bf48d8e6c6d3bcc3851452ca7d6a06.tar.bz2 android_packages_apps_Trebuchet-6dfa312896bf48d8e6c6d3bcc3851452ca7d6a06.zip |
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
Diffstat (limited to 'src/com/android/launcher3/touch')
-rw-r--r-- | src/com/android/launcher3/touch/ItemClickHandler.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/com/android/launcher3/touch/ItemClickHandler.java b/src/com/android/launcher3/touch/ItemClickHandler.java index f858dc4c6..85f763d09 100644 --- a/src/com/android/launcher3/touch/ItemClickHandler.java +++ b/src/com/android/launcher3/touch/ItemClickHandler.java @@ -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); } } |