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

Commit 852a70f9 authored by Johannes Gallmann's avatar Johannes Gallmann Committed by Android (Google) Code Review
Browse files

Merge "Hide app icon during predictive back to home" into main

parents f78644b4 436b9939
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1290,7 +1290,7 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener
    /**
     * Returns view on launcher that corresponds to the closing app in the list of app targets
     */
    private @Nullable View findLauncherView(RemoteAnimationTarget[] appTargets) {
    public @Nullable View findLauncherView(RemoteAnimationTarget[] appTargets) {
        for (RemoteAnimationTarget appTarget : appTargets) {
            if (appTarget.mode == MODE_CLOSING) {
                View launcherView = findLauncherView(appTarget);
+18 −0
Original line number Diff line number Diff line
@@ -54,12 +54,14 @@ import android.window.IOnBackInvokedCallback;

import com.android.internal.view.AppearanceRegion;
import com.android.launcher3.AbstractFloatingView;
import com.android.launcher3.BubbleTextView;
import com.android.launcher3.LauncherPrefs;
import com.android.launcher3.QuickstepTransitionManager;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
import com.android.launcher3.taskbar.LauncherTaskbarUIController;
import com.android.launcher3.uioverrides.QuickstepLauncher;
import com.android.launcher3.widget.LauncherAppWidgetHostView;
import com.android.quickstep.util.RectFSpringAnim;
import com.android.systemui.shared.system.QuickStepContract;

@@ -108,6 +110,7 @@ public class LauncherBackAnimationController {
    private final PointF mInitialTouchPos = new PointF();

    private RemoteAnimationTarget mBackTarget;
    private View mLauncherTargetView;
    private SurfaceControl.Transaction mTransaction = new SurfaceControl.Transaction();
    private boolean mSpringAnimationInProgress = false;
    private boolean mAnimatorSetInProgress = false;
@@ -303,11 +306,22 @@ public class LauncherBackAnimationController {
            int insetBottom = mStartRect.bottom - appTarget.contentInsets.bottom;
            mStartRect.set(mStartRect.left, mStartRect.top, mStartRect.right, insetBottom);
        }
        mLauncherTargetView = mQuickstepTransitionManager.findLauncherView(
                new RemoteAnimationTarget[]{ mBackTarget });
        setLauncherTargetViewVisible(false);
        mCurrentRect.set(mStartRect);
        addScrimLayer();
        mTransaction.apply();
    }

    private void setLauncherTargetViewVisible(boolean isVisible) {
        if (mLauncherTargetView instanceof BubbleTextView) {
            ((BubbleTextView) mLauncherTargetView).setIconVisible(isVisible);
        } else if (mLauncherTargetView instanceof LauncherAppWidgetHostView) {
            mLauncherTargetView.setAlpha(isVisible ? 1f : 0f);
        }
    }

    void addScrimLayer() {
        ViewRootImpl viewRootImpl = mLauncher.getDragLayer().getViewRootImpl();
        SurfaceControl parent = viewRootImpl != null
@@ -436,6 +450,8 @@ public class LauncherBackAnimationController {
            mLauncher.getStateManager().moveToRestState();
        }

        setLauncherTargetViewVisible(true);

        // Explicitly close opened floating views (which is typically called from
        // Launcher#onResumed, but in the predictive back flow launcher is not resumed until
        // the transition is fully finished.)
@@ -470,6 +486,8 @@ public class LauncherBackAnimationController {
        mInitialTouchPos.set(0, 0);
        mAnimatorSetInProgress = false;
        mSpringAnimationInProgress = false;
        setLauncherTargetViewVisible(true);
        mLauncherTargetView = null;
        // We don't call customizeStatusBarAppearance here to prevent the status bar update with
        // the legacy appearance. It should be refreshed after the transition done.
        mOverridingStatusBarFlags = false;