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

Commit 26447ddc authored by Jon Miranda's avatar Jon Miranda
Browse files

Notify home is visible when launching a translucent app.

To fix the taskbar stash delay when launching an app, ag/18875100
sets the state so that the taskbar stashes immediately after
app is launched.

Since we cannot know if the app is translucent at that point,
we have to check after the animation is started so we can update the
launcher visibility state.

Bug: 314792981
Flag: ACONFIG ENABLE_HOME_TRANSITION_LISTENER TRUNKFOOD
Test: HomeObserverTest
Change-Id: Ifc3a6559d7a8c6fda4c08a0fc2d6791da46b38d6
parent ac7c1e37
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -176,6 +176,7 @@ public class LauncherTaskbarUIController extends TaskbarUIController {
    /**
     * Should be called from onResume() and onPause(), and animates the Taskbar accordingly.
     */
    @Override
    public void onLauncherVisibilityChanged(boolean isVisible) {
        onLauncherVisibilityChanged(isVisible, false /* fromInit */);
    }
+9 −0
Original line number Diff line number Diff line
@@ -358,4 +358,13 @@ public class TaskbarUIController {

    /** Adjusts the hotseat for the bubble bar. */
    public void adjustHotseatForBubbleBar(boolean isBubbleBarVisible) {}

    /**
     * Adjusts the taskbar based on the visibility of the launcher.
     * @param isVisible True if launcher is visible, false otherwise.
     */
    public void onLauncherVisibilityChanged(boolean isVisible) {
        mControllers.taskbarStashController.updateStateForFlag(FLAG_IN_APP, !isVisible);
        mControllers.taskbarStashController.applyState();
    }
}
+16 −0
Original line number Diff line number Diff line
@@ -68,6 +68,7 @@ import com.android.launcher3.anim.PendingAnimation;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.statehandlers.DepthController;
import com.android.launcher3.statemanager.StateManager;
import com.android.launcher3.taskbar.TaskbarUIController;
import com.android.launcher3.util.DisplayController;
import com.android.quickstep.RemoteTargetGluer.RemoteTargetHandle;
import com.android.quickstep.util.MultiValueUpdateListener;
@@ -643,6 +644,21 @@ public final class TaskViewUtils {
                        recentsView.post(() -> {
                            stateManager.moveToRestState();
                            stateManager.reapplyState();

                            // We may have notified launcher is not visible so that taskbar can
                            // stash immediately. Now that the animation is over, we can update
                            // that launcher is still visible.
                            TaskbarUIController controller = recentsView.getSizeStrategy()
                                    .getTaskbarController();
                            if (controller != null) {
                                boolean launcherVisible = true;
                                for (RemoteAnimationTarget target : appTargets) {
                                    launcherVisible &= target.isTranslucent;
                                }
                                if (launcherVisible) {
                                    controller.onLauncherVisibilityChanged(true);
                                }
                            }
                        });
                    });
                }