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

Commit ee50b5d7 authored by Daniel Norman's avatar Daniel Norman
Browse files

Remove usage of A11y FAB bugfix flags:

- floating_menu_ime_displacement_animation
- floating_menu_overlaps_nav_bars_flag

Both have been in Trunkfood for multiple months.

Bug: 281150010
Bug: 283768342
Flag: ACONFIG com.android.systemui.floating_menu_ime_displacement_animation TRUNKFOOD
Flag: ACONFIG com.android.systemui.floating_menu_overlaps_nav_bars_flag TRUNKFOOD
Test: existing SysUI FAB tests in presubmit
Change-Id: I8ccef66cdc92e92ba9956dff9a051cea3a066342
parent 00cc4305
Loading
Loading
Loading
Loading
+5 −10
Original line number Diff line number Diff line
@@ -113,13 +113,8 @@ class MenuAnimationController {

    /* Moves position without updating underlying percentage position. Can be animated. */
    void moveToPosition(PointF position, boolean animateMovement) {
        if (Flags.floatingMenuImeDisplacementAnimation()) {
        moveToPositionX(position.x, animateMovement);
        moveToPositionY(position.y, animateMovement);
        } else {
            moveToPositionX(position.x, /* animateMovement = */ false);
            moveToPositionY(position.y, /* animateMovement = */ false);
        }
    }

    void moveToPositionX(float positionX) {
@@ -127,7 +122,7 @@ class MenuAnimationController {
    }

    void moveToPositionX(float positionX, boolean animateMovement) {
        if (animateMovement && Flags.floatingMenuImeDisplacementAnimation()) {
        if (animateMovement) {
            springMenuWith(DynamicAnimation.TRANSLATION_X,
                    createSpringForce(),
                    /* velocity = */ 0,
@@ -142,7 +137,7 @@ class MenuAnimationController {
    }

    void moveToPositionY(float positionY, boolean animateMovement) {
        if (animateMovement && Flags.floatingMenuImeDisplacementAnimation()) {
        if (animateMovement) {
            springMenuWith(DynamicAnimation.TRANSLATION_Y,
                    createSpringForce(),
                    /* velocity = */ 0,
@@ -455,7 +450,7 @@ class MenuAnimationController {
                ? MIN_PERCENT
                : Math.min(MAX_PERCENT, position.y / draggableBounds.height());

        if (Flags.floatingMenuImeDisplacementAnimation() && !writeToPosition) {
        if (!writeToPosition) {
            mMenuView.onEdgeChangedIfNeeded();
        } else {
            mMenuView.persistPositionAndUpdateEdge(new Position(percentageX, percentageY));
+2 −3
Original line number Diff line number Diff line
@@ -224,8 +224,7 @@ class MenuView extends FrameLayout implements
        }

        // We can skip animating if FAB is not visible
        if (Flags.floatingMenuImeDisplacementAnimation()
                && animateMovement && getVisibility() == VISIBLE) {
        if (animateMovement && getVisibility() == VISIBLE) {
            mMenuAnimationController.moveToPosition(position, /* animateMovement = */ true);
            // onArrivalAtPosition() is called at the end of the animation.
        } else {
@@ -331,7 +330,7 @@ class MenuView extends FrameLayout implements
            mMoveToTuckedListener.onMoveToTuckedChanged(isMoveToTucked);
        }

        if (Flags.floatingMenuOverlapsNavBarsFlag() && !Flags.floatingMenuAnimatedTuck()) {
        if (!Flags.floatingMenuAnimatedTuck()) {
            if (isMoveToTucked) {
                final float halfWidth = getMenuWidth() / 2.0f;
                final boolean isOnLeftSide = mMenuAnimationController.isOnLeftSide();
+0 −6
Original line number Diff line number Diff line
@@ -34,7 +34,6 @@ import android.view.WindowMetrics;

import androidx.annotation.DimenRes;

import com.android.systemui.Flags;
import com.android.systemui.res.R;

import java.lang.annotation.Retention;
@@ -155,11 +154,6 @@ class MenuViewAppearance {
        final int margin = getMenuMargin();
        final Rect draggableBounds = new Rect(getWindowAvailableBounds());

        if (!Flags.floatingMenuOverlapsNavBarsFlag()) {
            // Initializes start position for mapping the translation of the menu view.
            draggableBounds.offsetTo(/* newLeft= */ 0, /* newTop= */ 0);
        }

        draggableBounds.top += margin;
        draggableBounds.right -= getMenuWidth();

+12 −17
Original line number Diff line number Diff line
@@ -443,7 +443,6 @@ class MenuViewLayer extends FrameLayout implements
    }

    public void onMoveToTuckedChanged(boolean moveToTuck) {
        if (Flags.floatingMenuOverlapsNavBarsFlag()) {
        if (moveToTuck) {
            final Rect bounds = mMenuViewAppearance.getWindowAvailableBounds();
            final int[] location = getLocationOnScreen();
@@ -457,8 +456,6 @@ class MenuViewLayer extends FrameLayout implements
        // Instead of clearing clip bounds when moveToTuck is false,
        // wait until the spring animation finishes.
    }
        // Function is a no-operation if flag is disabled.
    }

    private void onSpringAnimationsEndAction() {
        if (mShouldShowDockTooltip) {
@@ -475,10 +472,8 @@ class MenuViewLayer extends FrameLayout implements
                setClipBounds(null);
            }
        }
        if (Flags.floatingMenuImeDisplacementAnimation()) {
        mMenuView.onArrivalAtPosition(false);
    }
    }

    void dispatchAccessibilityAction(int id) {
        if (id == R.id.action_remove_menu) {
+3 −10
Original line number Diff line number Diff line
@@ -20,11 +20,9 @@ import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_EXCLUDE_FROM_

import android.content.Context;
import android.graphics.PixelFormat;
import android.view.WindowInsets;
import android.view.WindowManager;
import android.view.accessibility.AccessibilityManager;

import com.android.systemui.Flags;
import com.android.systemui.util.settings.SecureSettings;

/**
@@ -88,14 +86,9 @@ class MenuViewLayerController implements IAccessibilityFloatingMenu {
        params.privateFlags |= PRIVATE_FLAG_EXCLUDE_FROM_SCREEN_MAGNIFICATION;
        params.windowAnimations = android.R.style.Animation_Translucent;
        // Insets are configured to allow the menu to display over navigation and system bars.
        if (Flags.floatingMenuOverlapsNavBarsFlag()) {
        params.setFitInsetsTypes(0);
        params.layoutInDisplayCutoutMode =
                WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS;
        } else {
            params.setFitInsetsTypes(
                    WindowInsets.Type.systemBars() | WindowInsets.Type.displayCutout());
        }
        return params;
    }
}
Loading