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

Commit 7f534cf2 authored by Winson Chung's avatar Winson Chung Committed by Android (Google) Code Review
Browse files

Merge "Fix issue with quickswitch not updating system bar flags" into ub-launcher3-rvc-dev

parents 403640c3 a7ac7192
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -215,7 +215,7 @@ public final class FallbackActivityInterface implements
    }
    }


    @Override
    @Override
    public boolean shouldMinimizeSplitScreen() {
    public boolean allowMinimizeSplitScreen() {
        // TODO: Remove this once b/77875376 is fixed
        // TODO: Remove this once b/77875376 is fixed
        return false;
        return false;
    }
    }
+5 −2
Original line number Original line Diff line number Diff line
@@ -250,8 +250,11 @@ public class FallbackSwipeHandler extends BaseSwipeUpHandler<RecentsActivity, Fa
    public void updateFinalShift() {
    public void updateFinalShift() {
        mTransformParams.setProgress(mCurrentShift.value);
        mTransformParams.setProgress(mCurrentShift.value);
        if (mRecentsAnimationController != null) {
        if (mRecentsAnimationController != null) {
            mRecentsAnimationController.setWindowThresholdCrossed(!mInQuickSwitchMode
            boolean swipeUpThresholdPassed = mCurrentShift.value > 1 - UPDATE_SYSUI_FLAGS_THRESHOLD;
                    && (mCurrentShift.value > 1 - UPDATE_SYSUI_FLAGS_THRESHOLD));
            mRecentsAnimationController.setUseLauncherSystemBarFlags(mInQuickSwitchMode
                    || swipeUpThresholdPassed);
            mRecentsAnimationController.setSplitScreenMinimized(!mInQuickSwitchMode
                    && swipeUpThresholdPassed);
        }
        }


        if (!mInQuickSwitchMode && !mDeviceState.isFullyGesturalNavMode()) {
        if (!mInQuickSwitchMode && !mDeviceState.isFullyGesturalNavMode()) {
+1 −1
Original line number Original line Diff line number Diff line
@@ -408,7 +408,7 @@ public final class LauncherActivityInterface implements BaseActivityInterface<La
    }
    }


    @Override
    @Override
    public boolean shouldMinimizeSplitScreen() {
    public boolean allowMinimizeSplitScreen() {
        return true;
        return true;
    }
    }


+11 −7
Original line number Original line Diff line number Diff line
@@ -630,17 +630,21 @@ public class LauncherSwipeHandler<T extends BaseDraggingActivity>
     * @param windowProgress 0 == app, 1 == overview
     * @param windowProgress 0 == app, 1 == overview
     */
     */
    private void updateSysUiFlags(float windowProgress) {
    private void updateSysUiFlags(float windowProgress) {
        if (mRecentsView != null) {
        if (mRecentsAnimationController != null && mRecentsView != null) {
            TaskView runningTask = mRecentsView.getRunningTaskView();
            TaskView centermostTask = mRecentsView.getTaskViewNearestToCenterOfScreen();
            TaskView centermostTask = mRecentsView.getTaskViewNearestToCenterOfScreen();
            int centermostTaskFlags = centermostTask == null ? 0
            int centermostTaskFlags = centermostTask == null ? 0
                    : centermostTask.getThumbnail().getSysUiStatusNavFlags();
                    : centermostTask.getThumbnail().getSysUiStatusNavFlags();
            boolean useHomeScreenFlags = windowProgress > 1 - UPDATE_SYSUI_FLAGS_THRESHOLD;
            boolean swipeUpThresholdPassed = windowProgress > 1 - UPDATE_SYSUI_FLAGS_THRESHOLD;
            boolean quickswitchThresholdPassed = centermostTask != runningTask;

            // We will handle the sysui flags based on the centermost task view.
            // We will handle the sysui flags based on the centermost task view.
            if (mRecentsAnimationController != null) {
            mRecentsAnimationController.setUseLauncherSystemBarFlags(
                mRecentsAnimationController.setWindowThresholdCrossed(centermostTaskFlags != 0
                    (swipeUpThresholdPassed || quickswitchThresholdPassed)
                        && useHomeScreenFlags);
                            && centermostTaskFlags != 0);
            }
            mRecentsAnimationController.setSplitScreenMinimized(swipeUpThresholdPassed);
            int sysuiFlags = useHomeScreenFlags ? 0 : centermostTaskFlags;

            int sysuiFlags = swipeUpThresholdPassed ? 0 : centermostTaskFlags;
            mActivity.getSystemUiController().updateUiState(UI_STATE_OVERVIEW, sysuiFlags);
            mActivity.getSystemUiController().updateUiState(UI_STATE_OVERVIEW, sysuiFlags);
        }
        }
    }
    }
+1 −1
Original line number Original line Diff line number Diff line
@@ -105,7 +105,7 @@ public interface BaseActivityInterface<T extends BaseDraggingActivity> {


    Rect getOverviewWindowBounds(Rect homeBounds, RemoteAnimationTargetCompat target);
    Rect getOverviewWindowBounds(Rect homeBounds, RemoteAnimationTargetCompat target);


    boolean shouldMinimizeSplitScreen();
    boolean allowMinimizeSplitScreen();


    default boolean deferStartingActivity(RecentsAnimationDeviceState deviceState, MotionEvent ev) {
    default boolean deferStartingActivity(RecentsAnimationDeviceState deviceState, MotionEvent ev) {
        return true;
        return true;
Loading