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

Commit a8664d2d authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 9794482 from f93aa98e to tm-qpr3-release

Change-Id: I11a6c6b8f28013ededb440ef2dc707eb60f86c44
parents 7a695bba f93aa98e
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -300,6 +300,8 @@
    <dimen name="transient_taskbar_key_shadow_distance">10dp</dimen>
    <dimen name="transient_taskbar_stashed_size">32dp</dimen>
    <dimen name="transient_taskbar_all_apps_button_translation_x_offset">4dp</dimen>
    <dimen name="transient_taskbar_stash_spring_velocity_dp_per_s">400dp</dimen>

    <!-- An additional touch slop to prevent x-axis movement during the swipe up to show taskbar -->
    <dimen name="transient_taskbar_clamped_offset_bound">16dp</dimen>
    <!-- Taskbar swipe up thresholds -->
+6 −0
Original line number Diff line number Diff line
@@ -65,4 +65,10 @@ public abstract class BaseTaskbarContext extends ContextThemeWrapper implements

    /** Callback invoked when a popup is shown or closed within this context. */
    public abstract void onPopupVisibilityChanged(boolean isVisible);

    /**
     * Callback invoked when user attempts to split the screen through a long-press menu in Taskbar
     * or AllApps.
     */
    public abstract void onSplitScreenMenuButtonClicked();
}
+32 −16
Original line number Diff line number Diff line
@@ -66,9 +66,10 @@ public class LauncherTaskbarUIController extends TaskbarUIController {
    public static final int WIDGETS_PAGE_PROGRESS_INDEX = 2;
    public static final int SYSUI_SURFACE_PROGRESS_INDEX = 3;

    private static final int DISPLAY_PROGRESS_COUNT = 4;
    public static final int DISPLAY_PROGRESS_COUNT = 4;

    private final AnimatedFloat mTaskbarInAppDisplayProgress = new AnimatedFloat();
    private final AnimatedFloat mTaskbarInAppDisplayProgress = new AnimatedFloat(
            this::onInAppDisplayProgressChanged);
    private final MultiPropertyFactory<AnimatedFloat> mTaskbarInAppDisplayProgressMultiProp =
            new MultiPropertyFactory<>(mTaskbarInAppDisplayProgress,
                    AnimatedFloat.VALUE, DISPLAY_PROGRESS_COUNT, Float::max);
@@ -84,7 +85,6 @@ public class LauncherTaskbarUIController extends TaskbarUIController {
            };

    // Initialized in init.
    private TaskbarKeyguardController mKeyguardController;
    private final TaskbarLauncherStateController
            mTaskbarLauncherStateController = new TaskbarLauncherStateController();

@@ -99,12 +99,19 @@ public class LauncherTaskbarUIController extends TaskbarUIController {
        mTaskbarLauncherStateController.init(mControllers, mLauncher);

        mLauncher.setTaskbarUIController(this);
        mKeyguardController = taskbarControllers.taskbarKeyguardController;

        onLauncherResumedOrPaused(mLauncher.hasBeenResumed(), true /* fromInit */);

        onStashedInAppChanged(mLauncher.getDeviceProfile());
        mTaskbarLauncherStateController.updateStateForSysuiFlags(
                mControllers.getSharedState().sysuiStateFlags, true /* fromInit */);
        mLauncher.addOnDeviceProfileChangeListener(mOnDeviceProfileChangeListener);

        // Restore the in-app display progress from before Taskbar was recreated.
        float[] prevProgresses = mControllers.getSharedState().inAppDisplayProgressMultiPropValues;
        for (int i = 0; i < prevProgresses.length; i++) {
            mTaskbarInAppDisplayProgressMultiProp.get(i).setValue(prevProgresses[i]);
        }
    }

    @Override
@@ -118,10 +125,22 @@ public class LauncherTaskbarUIController extends TaskbarUIController {
        updateTaskTransitionSpec(true);
    }

    private void onInAppDisplayProgressChanged() {
        if (mControllers != null) {
            // Update our shared state so we can restore it if taskbar gets recreated.
            for (int i = 0; i < DISPLAY_PROGRESS_COUNT; i++) {
                mControllers.getSharedState().inAppDisplayProgressMultiPropValues[i] =
                        mTaskbarInAppDisplayProgressMultiProp.get(i).getValue();
            }
            // Ensure nav buttons react to our latest state if necessary.
            mControllers.navbarButtonsViewController.updateNavButtonTranslationY();
        }
    }

    @Override
    protected boolean isTaskbarTouchable() {
        return !(mTaskbarLauncherStateController.isAnimatingToLauncher()
                && mTaskbarLauncherStateController.goingToAlignedLauncherState());
                && mTaskbarLauncherStateController.isTaskbarAlignedWithHotseat());
    }

    public void setShouldDelayLauncherStateAnim(boolean shouldDelayLauncherStateAnim) {
@@ -169,15 +188,6 @@ public class LauncherTaskbarUIController extends TaskbarUIController {
    @Nullable
    private Animator onLauncherResumedOrPaused(
            boolean isResumed, boolean fromInit, boolean startAnimation, int duration) {
        if (mKeyguardController.isScreenOff()) {
            if (!isResumed) {
                return null;
            } else {
                // Resuming implicitly means device unlocked
                mKeyguardController.setScreenOn();
            }
        }

        if (ENABLE_SHELL_TRANSITIONS && isResumed
                && !mLauncher.getStateManager().getState().isTaskbarAlignedWithHotseat(mLauncher)) {
            // Launcher is resumed, but in a state where taskbar is still independent, so
@@ -328,6 +338,11 @@ public class LauncherTaskbarUIController extends TaskbarUIController {
        mTaskbarLauncherStateController.applyState();
    }

    @Override
    public void updateStateForSysuiFlags(int sysuiFlags, boolean skipAnim) {
        mTaskbarLauncherStateController.updateStateForSysuiFlags(sysuiFlags, skipAnim);
    }

    @Override
    public boolean isIconAlignedWithHotseat() {
        return mTaskbarLauncherStateController.isIconAlignedWithHotseat();
@@ -364,9 +379,10 @@ public class LauncherTaskbarUIController extends TaskbarUIController {
    public void dumpLogs(String prefix, PrintWriter pw) {
        super.dumpLogs(prefix, pw);

        pw.println(String.format("%s\tTaskbar in-app display progress:", prefix));
        pw.println(String.format("%s\tTaskbar in-app display progress: %.2f", prefix,
                mTaskbarInAppDisplayProgress.value));
        mTaskbarInAppDisplayProgressMultiProp.dump(
                prefix + "\t",
                prefix + "\t\t",
                pw,
                "mTaskbarInAppDisplayProgressMultiProp",
                "MINUS_ONE_PAGE_PROGRESS_INDEX",
+15 −3
Original line number Diff line number Diff line
@@ -159,6 +159,7 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
            this::updateNavButtonTranslationY);
    private final AnimatedFloat mTaskbarNavButtonTranslationYForIme = new AnimatedFloat(
            this::updateNavButtonTranslationY);
    private float mLastSetNavButtonTranslationY;
    // Used for System UI state updates that should translate the nav button for in-app display.
    private final AnimatedFloat mNavButtonInAppDisplayProgressForSysui = new AnimatedFloat(
            this::updateNavButtonInAppDisplayProgressForSysui);
@@ -606,7 +607,10 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
        }
    }

    private void updateNavButtonTranslationY() {
    /**
     * Sets the translationY of the nav buttons based on the current device state.
     */
    public void updateNavButtonTranslationY() {
        if (isPhoneButtonNavMode(mContext)) {
            return;
        }
@@ -618,9 +622,10 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
                        && ((LauncherTaskbarUIController) uiController).shouldUseInAppLayout())
                        ? mTaskbarNavButtonTranslationYForInAppDisplay.value : 0;

        mNavButtonsView.setTranslationY(normalTranslationY
        mLastSetNavButtonTranslationY = normalTranslationY
                + imeAdjustmentTranslationY
                + inAppDisplayAdjustmentTranslationY);
                + inAppDisplayAdjustmentTranslationY;
        mNavButtonsView.setTranslationY(mLastSetNavButtonTranslationY);
    }

    private void updateNavButtonColor() {
@@ -924,6 +929,13 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
        pw.println(prefix + "\tmFloatingRotationButtonBounds=" + mFloatingRotationButtonBounds);
        pw.println(prefix + "\tmSysuiStateFlags=" + QuickStepContract.getSystemUiStateString(
                mSysuiStateFlags));
        pw.println(prefix + "\tLast set nav button translationY=" + mLastSetNavButtonTranslationY);
        pw.println(prefix + "\t\tmTaskbarNavButtonTranslationY="
                + mTaskbarNavButtonTranslationY.value);
        pw.println(prefix + "\t\tmTaskbarNavButtonTranslationYForInAppDisplay="
                + mTaskbarNavButtonTranslationYForInAppDisplay.value);
        pw.println(prefix + "\t\tmTaskbarNavButtonTranslationYForIme="
                + mTaskbarNavButtonTranslationYForIme.value);
    }

    private static String getStateString(int flags) {
+17 −1
Original line number Diff line number Diff line
@@ -84,6 +84,9 @@ public class StashedHandleViewController implements TaskbarControllers.LoggableT
    private boolean mIsStashed;
    private boolean mTaskbarHidden;

    private float mTranslationYForSwipe;
    private float mTranslationYForStash;

    public StashedHandleViewController(TaskbarActivityContext activity,
            StashedHandleView stashedHandleView) {
        mActivity = activity;
@@ -254,7 +257,20 @@ public class StashedHandleViewController implements TaskbarControllers.LoggableT
     * Sets the translation of the stashed handle during the swipe up gesture.
     */
    protected void setTranslationYForSwipe(float transY) {
        mStashedHandleView.setTranslationY(transY);
        mTranslationYForSwipe = transY;
        updateTranslationY();
    }

    /**
     * Sets the translation of the stashed handle during the spring on stash animation.
     */
    protected void setTranslationYForStash(float transY) {
        mTranslationYForStash = transY;
        updateTranslationY();
    }

    private void updateTranslationY() {
        mStashedHandleView.setTranslationY(mTranslationYForSwipe + mTranslationYForStash);
    }

    /**
Loading