Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6dfa3128 authored by Jon Miranda's avatar Jon Miranda
Browse files

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
parent 3d6e96d5
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -59,6 +59,7 @@ import android.view.View;
import com.android.launcher3.DeviceProfile.OnDeviceProfileChangeListener;
import com.android.launcher3.allapps.AllAppsTransitionController;
import com.android.launcher3.anim.Interpolators;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.dragndrop.DragLayer;
import com.android.launcher3.shortcuts.DeepShortcutView;
import com.android.launcher3.util.MultiValueAlpha;
@@ -182,6 +183,12 @@ public abstract class QuickstepAppTransitionManagerImpl extends LauncherAppTrans
        mDeviceProfile = dp;
    }

    @Override
    public boolean supportsAdaptiveIconAnimation() {
        return hasControlRemoteAppTransitionPermission()
                && FeatureFlags.ADAPTIVE_ICON_WINDOW_ANIM.get();
    }

    /**
     * @return ActivityOptions with remote animations that controls how the window of the opening
     *         targets are displayed.
+4 −0
Original line number Diff line number Diff line
@@ -51,4 +51,8 @@ public class LauncherAppTransitionManager implements ResourceBasedOverride {
        }
        return ActivityOptions.makeClipRevealAnimation(v, left, top, width, height);
    }

    public boolean supportsAdaptiveIconAnimation() {
        return false;
    }
}
+5 −0
Original line number Diff line number Diff line
@@ -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);
    }
}
+239 −135

File changed.

Preview size limit exceeded, changes collapsed.