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

Commit b4821887 authored by Tony Wickham's avatar Tony Wickham
Browse files

Some overview scrim and status bar color adjustments

- Replace UI_STATE_OVERVIEW with UI_STATE_FULLSCREEN_TASK. Overview no
  longer needs it's own status bar treatment as it's handled by
  ScrimView already. So remove instances of UI_STATE_OVERVIEW and
  replace some with UI_STATE_FULLSCREEN_TASK if a TaskView is behind
  the status bar.
- Add ScrimView to fallback recents activity.
- Remove scrim from Background state, don't fade it in until the
  gesture ends to RECENTS.

Test: watch scrim and status bar colors during the following
- Swipe up to home (no scrim, status bar matches task at first but
  then wallpaper once task isn't overlapping status bar)
- Swipe up to overview (no scrim until let go to overview, status
  bar matches task at first, then wallpaper after not overlapping,
  then scrim once it's 90% opacity)
- Quick switch from home (scrim fades in, status bar matches once
  it reaches 90% opacity)
- Quick switch from app (no scrim, status bar matches center task)
- Repeat above for 3P launcher and 2 button mode

Fixes: 185681676
Fixes: 185286870
Change-Id: I9e5c292cc734e714169b9cc8268e8dad4e868aca
parent 222b4757
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -33,6 +33,12 @@
        android:layout_height="match_parent"
        android:layout_height="match_parent"
        android:clipChildren="false">
        android:clipChildren="false">


        <com.android.launcher3.views.ScrimView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:id="@+id/scrim_view"
            android:background="@android:color/transparent" />

        <com.android.quickstep.fallback.FallbackRecentsView
        <com.android.quickstep.fallback.FallbackRecentsView
            android:id="@id/overview_panel"
            android:id="@id/overview_panel"
            android:layout_width="match_parent"
            android:layout_width="match_parent"
+6 −0
Original line number Original line Diff line number Diff line
@@ -18,6 +18,7 @@ package com.android.launcher3.uioverrides.states;
import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_BACKGROUND;
import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_BACKGROUND;


import android.content.Context;
import android.content.Context;
import android.graphics.Color;


import com.android.launcher3.BaseDraggingActivity;
import com.android.launcher3.BaseDraggingActivity;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.DeviceProfile;
@@ -86,6 +87,11 @@ public class BackgroundAppState extends OverviewState {
        return 1f;
        return 1f;
    }
    }


    @Override
    public int getWorkspaceScrimColor(Launcher launcher) {
        return Color.TRANSPARENT;
    }

    public static float[] getOverviewScaleAndOffsetForBackgroundState(
    public static float[] getOverviewScaleAndOffsetForBackgroundState(
            BaseDraggingActivity activity) {
            BaseDraggingActivity activity) {
        return new float[] {
        return new float[] {
+7 −0
Original line number Original line Diff line number Diff line
@@ -18,6 +18,8 @@ package com.android.launcher3.uioverrides.states;
import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_BACKGROUND;
import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_BACKGROUND;


import com.android.launcher3.Launcher;
import com.android.launcher3.Launcher;
import com.android.launcher3.R;
import com.android.launcher3.util.Themes;


/**
/**
 * State to indicate we are about to launch a recent task. Note that this state is only used when
 * State to indicate we are about to launch a recent task. Note that this state is only used when
@@ -38,6 +40,11 @@ public class QuickSwitchState extends BackgroundAppState {
        return new ScaleAndTranslation(0.9f, 0, translationY);
        return new ScaleAndTranslation(0.9f, 0, translationY);
    }
    }


    @Override
    public int getWorkspaceScrimColor(Launcher launcher) {
        return Themes.getAttrColor(launcher, R.attr.overviewScrimColor);
    }

    @Override
    @Override
    public float getVerticalProgress(Launcher launcher) {
    public float getVerticalProgress(Launcher launcher) {
        // Don't move all apps shelf while quick-switching (just let it fade).
        // Don't move all apps shelf while quick-switching (just let it fade).
+3 −4
Original line number Original line Diff line number Diff line
@@ -29,7 +29,7 @@ import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_TR
import static com.android.launcher3.states.StateAnimationConfig.ANIM_VERTICAL_PROGRESS;
import static com.android.launcher3.states.StateAnimationConfig.ANIM_VERTICAL_PROGRESS;
import static com.android.launcher3.states.StateAnimationConfig.ANIM_WORKSPACE_FADE;
import static com.android.launcher3.states.StateAnimationConfig.ANIM_WORKSPACE_FADE;
import static com.android.launcher3.states.StateAnimationConfig.ANIM_WORKSPACE_TRANSLATE;
import static com.android.launcher3.states.StateAnimationConfig.ANIM_WORKSPACE_TRANSLATE;
import static com.android.launcher3.util.SystemUiController.UI_STATE_OVERVIEW;
import static com.android.launcher3.util.SystemUiController.UI_STATE_FULLSCREEN_TASK;
import static com.android.quickstep.views.RecentsView.UPDATE_SYSUI_FLAGS_THRESHOLD;
import static com.android.quickstep.views.RecentsView.UPDATE_SYSUI_FLAGS_THRESHOLD;
import static com.android.systemui.shared.system.ActivityManagerWrapper.CLOSE_SYSTEM_WINDOWS_REASON_RECENTS;
import static com.android.systemui.shared.system.ActivityManagerWrapper.CLOSE_SYSTEM_WINDOWS_REASON_RECENTS;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_OVERVIEW_DISABLED;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_OVERVIEW_DISABLED;
@@ -143,10 +143,9 @@ public class QuickSwitchTouchController extends AbstractStateChangeTouchControll
            if (tv != null) {
            if (tv != null) {
                sysuiFlags = tv.getThumbnail().getSysUiStatusNavFlags();
                sysuiFlags = tv.getThumbnail().getSysUiStatusNavFlags();
            }
            }
            mLauncher.getSystemUiController().updateUiState(UI_STATE_OVERVIEW, sysuiFlags);
            mLauncher.getSystemUiController().updateUiState(UI_STATE_FULLSCREEN_TASK, sysuiFlags);
        } else {
        } else {
            mLauncher.getSystemUiController().updateUiState(
            mLauncher.getSystemUiController().updateUiState(UI_STATE_FULLSCREEN_TASK, 0);
                    UI_STATE_OVERVIEW, mOverviewPanel.hasLightBackground());
        }
        }
    }
    }


+3 −4
Original line number Original line Diff line number Diff line
@@ -34,7 +34,7 @@ import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCH
import static com.android.launcher3.util.DisplayController.getSingleFrameMs;
import static com.android.launcher3.util.DisplayController.getSingleFrameMs;
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
import static com.android.launcher3.util.SystemUiController.UI_STATE_OVERVIEW;
import static com.android.launcher3.util.SystemUiController.UI_STATE_FULLSCREEN_TASK;
import static com.android.launcher3.util.VibratorWrapper.OVERVIEW_HAPTIC;
import static com.android.launcher3.util.VibratorWrapper.OVERVIEW_HAPTIC;
import static com.android.quickstep.GestureState.GestureEndTarget.HOME;
import static com.android.quickstep.GestureState.GestureEndTarget.HOME;
import static com.android.quickstep.GestureState.GestureEndTarget.LAST_TASK;
import static com.android.quickstep.GestureState.GestureEndTarget.LAST_TASK;
@@ -664,11 +664,10 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
            mRecentsAnimationController.setSplitScreenMinimized(swipeUpThresholdPassed);
            mRecentsAnimationController.setSplitScreenMinimized(swipeUpThresholdPassed);


            if (swipeUpThresholdPassed) {
            if (swipeUpThresholdPassed) {
                mActivity.getSystemUiController().updateUiState(
                mActivity.getSystemUiController().updateUiState(UI_STATE_FULLSCREEN_TASK, 0);
                        UI_STATE_OVERVIEW, mRecentsView.hasLightBackground());
            } else {
            } else {
                mActivity.getSystemUiController().updateUiState(
                mActivity.getSystemUiController().updateUiState(
                        UI_STATE_OVERVIEW, centermostTaskFlags);
                        UI_STATE_FULLSCREEN_TASK, centermostTaskFlags);
            }
            }
        }
        }
    }
    }
Loading