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

Commit 3d52ee4d authored by Jonathan Miranda's avatar Jonathan Miranda
Browse files

[automerger] Optimizations to reduce all apps jank. am: 7f522a25 am: 00abdaca

Change-Id: I3a79d31b61488e51d149a1585ad2b5f8010e878b
parents 36802d5f 00abdaca
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -592,6 +592,9 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver {
            mIconLoadRequest = null;
            mIconLoadRequest = null;
            mDisableRelayout = true;
            mDisableRelayout = true;


            // Optimization: Starting in N, pre-uploads the bitmap to RenderThread.
            info.iconBitmap.prepareToDraw();

            if (info instanceof AppInfo) {
            if (info instanceof AppInfo) {
                applyFromApplicationInfo((AppInfo) info);
                applyFromApplicationInfo((AppInfo) info);
            } else if (info instanceof ShortcutInfo) {
            } else if (info instanceof ShortcutInfo) {
+4 −2
Original line number Original line Diff line number Diff line
@@ -338,8 +338,10 @@ public class LauncherStateTransitionAnimation {
            toView.post(new StartAnimRunnable(animation, toView));
            toView.post(new StartAnimRunnable(animation, toView));
            mCurrentAnimation = animation;
            mCurrentAnimation = animation;
        } else if (animType == PULLUP) {
        } else if (animType == PULLUP) {
            // We are animating the content view alpha, so ensure we have a layer for it
            if (!FeatureFlags.LAUNCHER3_PHYSICS) {
                // We are animating the content view alpha, so ensure we have a layer for it.
                layerViews.addView(contentView);
                layerViews.addView(contentView);
            }


            animation.addListener(new AnimatorListenerAdapter() {
            animation.addListener(new AnimatorListenerAdapter() {
                @Override
                @Override
+22 −14
Original line number Original line Diff line number Diff line
@@ -274,7 +274,6 @@ public class WorkspaceStateTransitionAnimation {
                1.0f : 0f;
                1.0f : 0f;
        float finalHotseatAlpha = (states.stateIsNormal || states.stateIsSpringLoaded ||
        float finalHotseatAlpha = (states.stateIsNormal || states.stateIsSpringLoaded ||
                (FeatureFlags.LAUNCHER3_ALL_APPS_PULL_UP && states.stateIsNormalHidden)) ? 1f : 0f;
                (FeatureFlags.LAUNCHER3_ALL_APPS_PULL_UP && states.stateIsNormalHidden)) ? 1f : 0f;
        float finalOverviewPanelAlpha = states.stateIsOverview ? 1f : 0f;
        float finalQsbAlpha = (states.stateIsNormal ||
        float finalQsbAlpha = (states.stateIsNormal ||
                (FeatureFlags.LAUNCHER3_ALL_APPS_PULL_UP && states.stateIsNormalHidden)) ? 1f : 0f;
                (FeatureFlags.LAUNCHER3_ALL_APPS_PULL_UP && states.stateIsNormalHidden)) ? 1f : 0f;


@@ -359,38 +358,47 @@ public class WorkspaceStateTransitionAnimation {


        final ViewGroup overviewPanel = mLauncher.getOverviewPanel();
        final ViewGroup overviewPanel = mLauncher.getOverviewPanel();


        float finalOverviewPanelAlpha = states.stateIsOverview ? 1f : 0f;
        if (animated) {
        if (animated) {
            // This is true when transitioning between:
            // - Overview <-> Workspace
            // - Overview <-> Widget Tray
            if (finalOverviewPanelAlpha != overviewPanel.getAlpha()) {
                Animator overviewPanelAlpha = ObjectAnimator.ofFloat(
                        overviewPanel, View.ALPHA, finalOverviewPanelAlpha);
                overviewPanelAlpha.addListener(new AlphaUpdateListener(overviewPanel,
                        accessibilityEnabled));
                layerViews.addView(overviewPanel);

                if (states.overviewToWorkspace) {
                    overviewPanelAlpha.setInterpolator(new DecelerateInterpolator(2));
                } else if (states.workspaceToOverview) {
                    overviewPanelAlpha.setInterpolator(null);
                }

                overviewPanelAlpha.setDuration(duration);
                mStateAnimator.play(overviewPanelAlpha);
            }

            Animator scale = LauncherAnimUtils.ofPropertyValuesHolder(mWorkspace,
            Animator scale = LauncherAnimUtils.ofPropertyValuesHolder(mWorkspace,
                    new PropertyListBuilder().scale(mNewScale)
                    new PropertyListBuilder().scale(mNewScale)
                            .translationY(finalWorkspaceTranslationY).build())
                            .translationY(finalWorkspaceTranslationY).build())
                    .setDuration(duration);
                    .setDuration(duration);
            scale.setInterpolator(mZoomInInterpolator);
            scale.setInterpolator(mZoomInInterpolator);
            mStateAnimator.play(scale);
            mStateAnimator.play(scale);
            Animator hotseatAlpha = mWorkspace.createHotseatAlphaAnimator(finalHotseatAlpha);

            Animator overviewPanelAlpha = ObjectAnimator.ofFloat(
                    overviewPanel, View.ALPHA, finalOverviewPanelAlpha);
            overviewPanelAlpha.addListener(new AlphaUpdateListener(overviewPanel,
                    accessibilityEnabled));


            // For animation optimization, we may need to provide the Launcher transition
            // For animation optimization, we may need to provide the Launcher transition
            // with a set of views on which to force build and manage layers in certain scenarios.
            // with a set of views on which to force build and manage layers in certain scenarios.
            layerViews.addView(overviewPanel);
            layerViews.addView(mLauncher.getHotseat());
            layerViews.addView(mLauncher.getHotseat());
            layerViews.addView(mWorkspace.getPageIndicator());
            layerViews.addView(mWorkspace.getPageIndicator());


            Animator hotseatAlpha = mWorkspace.createHotseatAlphaAnimator(finalHotseatAlpha);
            if (states.workspaceToOverview) {
            if (states.workspaceToOverview) {
                hotseatAlpha.setInterpolator(new DecelerateInterpolator(2));
                hotseatAlpha.setInterpolator(new DecelerateInterpolator(2));
                overviewPanelAlpha.setInterpolator(null);
            } else if (states.overviewToWorkspace) {
            } else if (states.overviewToWorkspace) {
                hotseatAlpha.setInterpolator(null);
                hotseatAlpha.setInterpolator(null);
                overviewPanelAlpha.setInterpolator(new DecelerateInterpolator(2));
            }
            }

            overviewPanelAlpha.setDuration(duration);
            hotseatAlpha.setDuration(duration);
            hotseatAlpha.setDuration(duration);

            mStateAnimator.play(overviewPanelAlpha);
            mStateAnimator.play(hotseatAlpha);
            mStateAnimator.play(hotseatAlpha);
            mStateAnimator.addListener(new AnimatorListenerAdapter() {
            mStateAnimator.addListener(new AnimatorListenerAdapter() {
                boolean canceled = false;
                boolean canceled = false;