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

Commit 10c1c017 authored by Evan Rosky's avatar Evan Rosky
Browse files

Only animate to hotseat when launcher is on home screen

Was assuming that resume == home-screen; however, in shell
transitions, launcher is resumed while overview is active,
so make sure it is both resumed AND "isTaskbarAligned"
before making the to-hotseat animation

Bug: 241800590
Test: Open an app, long-press taskbar to stash, long-press again
      to unstash
Change-Id: I117afcb006c363e50205f27f014ffc30d6f2896a
parent 5166c5da
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@
package com.android.launcher3.taskbar;

import static com.android.launcher3.taskbar.TaskbarLauncherStateController.FLAG_RESUMED;
import static com.android.quickstep.TaskAnimationManager.ENABLE_SHELL_TRANSITIONS;
import static com.android.systemui.shared.system.WindowManagerWrapper.ITYPE_EXTRA_NAVIGATION_BAR;

import android.animation.Animator;
@@ -188,6 +189,13 @@ public class LauncherTaskbarUIController extends TaskbarUIController {
            }
        }

        if (ENABLE_SHELL_TRANSITIONS
                && !mLauncher.getStateManager().getState().isTaskbarAlignedWithHotseat(mLauncher)) {
            // Launcher is resumed, but in a state where taskbar is still independent, so
            // ignore the state change.
            return null;
        }

        mTaskbarLauncherStateController.updateStateForFlag(FLAG_RESUMED, isResumed);
        return mTaskbarLauncherStateController.applyState(fromInit ? 0 : duration, startAnimation);
    }
+7 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@
package com.android.launcher3.uioverrides.states;

import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_BACKGROUND;
import static com.android.quickstep.TaskAnimationManager.ENABLE_SHELL_TRANSITIONS;

import android.content.Context;
import android.graphics.Color;
@@ -101,6 +102,12 @@ public class BackgroundAppState extends OverviewState {
        return Color.TRANSPARENT;
    }

    @Override
    public boolean isTaskbarAlignedWithHotseat(Launcher launcher) {
        if (ENABLE_SHELL_TRANSITIONS) return false;
        return super.isTaskbarAlignedWithHotseat(launcher);
    }

    public static float[] getOverviewScaleAndOffsetForBackgroundState(
            BaseDraggingActivity activity) {
        return new float[] {