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

Commit 1fbf3c76 authored by Tony Wickham's avatar Tony Wickham
Browse files

Fix actions view showing up when it shouldn't in a couple spots

- Replace HIDDEN_FULLSCREEN_PROGRESS with INDEX_FULLSCREEN_ALPHA
- When animating actions in after swiping to overview from an app,
  start at alpha 0 (since we setState(OVERVIEW) without animation
  when we settle, meaning alpha would already be 1).
- Fade in actions at the same duration as the icon scale when
  entering overview from an app
- Hide actions during quick switch from home

Tests:
- Start quick switch from home and swipe up back to home
- Start quick switch from home and swipe up to overview
- Go to overview from home
- Go to overview from an app
Verify actions don't appear on the first, and fade in
for the rest.

Bug: 157597385
Change-Id: I43a0be702066f91e13ce2a720278aae27160c557
parent 517cec53
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ import static com.android.launcher3.LauncherAnimUtils.SCALE_PROPERTY;
import static com.android.launcher3.LauncherState.HOTSEAT_ICONS;
import static com.android.launcher3.LauncherState.NORMAL;
import static com.android.launcher3.LauncherState.OVERVIEW;
import static com.android.launcher3.LauncherState.OVERVIEW_BUTTONS;
import static com.android.launcher3.LauncherState.QUICK_SWITCH;
import static com.android.launcher3.anim.AlphaUpdateListener.ALPHA_CUTOFF_THRESHOLD;
import static com.android.launcher3.anim.Interpolators.ACCEL_0_75;
@@ -242,6 +243,8 @@ public class NoButtonQuickSwitchTouchController implements TouchController,
        ADJACENT_PAGE_OFFSET.set(mRecentsView, 1f);
        mRecentsView.setContentAlpha(1);
        mRecentsView.setFullscreenProgress(fromState.getOverviewFullscreenProgress());
        mLauncher.getActionsView().getVisibilityAlpha().setValue(
                (fromState.getVisibleElements(mLauncher) & OVERVIEW_BUTTONS) != 0 ? 1f : 0f);

        float[] scaleAndOffset = toState.getOverviewScaleAndOffset(mLauncher);
        // As we drag right, animate the following properties:
+8 −5
Original line number Diff line number Diff line
@@ -51,8 +51,7 @@ public class OverviewActionsView<T extends OverlayUICallbacks> extends FrameLayo
            HIDDEN_NON_ZERO_ROTATION,
            HIDDEN_NO_TASKS,
            HIDDEN_GESTURE_RUNNING,
            HIDDEN_NO_RECENTS,
            HIDDEN_FULLESCREEN_PROGRESS})
            HIDDEN_NO_RECENTS})
    @Retention(RetentionPolicy.SOURCE)
    public @interface ActionsHiddenFlags { }

@@ -62,11 +61,11 @@ public class OverviewActionsView<T extends OverlayUICallbacks> extends FrameLayo
    public static final int HIDDEN_NO_TASKS = 1 << 3;
    public static final int HIDDEN_GESTURE_RUNNING = 1 << 4;
    public static final int HIDDEN_NO_RECENTS = 1 << 5;
    public static final int HIDDEN_FULLESCREEN_PROGRESS = 1 << 6;

    private static final int INDEX_CONTENT_ALPHA = 0;
    private static final int INDEX_VISIBILITY_ALPHA = 1;
    private static final int INDEX_HIDDEN_FLAGS_ALPHA = 2;
    private static final int INDEX_FULLSCREEN_ALPHA = 2;
    private static final int INDEX_HIDDEN_FLAGS_ALPHA = 3;

    private final MultiValueAlpha mMultiValueAlpha;

@@ -85,7 +84,7 @@ public class OverviewActionsView<T extends OverlayUICallbacks> extends FrameLayo

    public OverviewActionsView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr, 0);
        mMultiValueAlpha = new MultiValueAlpha(this, 3);
        mMultiValueAlpha = new MultiValueAlpha(this, 4);
    }

    @Override
@@ -143,6 +142,10 @@ public class OverviewActionsView<T extends OverlayUICallbacks> extends FrameLayo
        return mMultiValueAlpha.getProperty(INDEX_VISIBILITY_ALPHA);
    }

    public AlphaProperty getFullscreenAlpha() {
        return mMultiValueAlpha.getProperty(INDEX_FULLSCREEN_ALPHA);
    }

    /** Updates vertical margins for different navigation mode. */
    public void updateVerticalMarginForNavModeChange(Mode mode) {
        int bottomMargin = 0;
+3 −5
Original line number Diff line number Diff line
@@ -43,7 +43,6 @@ import static com.android.launcher3.userevent.nano.LauncherLogProto.ControlType.
import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
import static com.android.launcher3.util.SystemUiController.UI_STATE_OVERVIEW;
import static com.android.quickstep.TaskUtils.checkCurrentOrManagedUserId;
import static com.android.quickstep.views.OverviewActionsView.HIDDEN_FULLESCREEN_PROGRESS;
import static com.android.quickstep.views.OverviewActionsView.HIDDEN_GESTURE_RUNNING;
import static com.android.quickstep.views.OverviewActionsView.HIDDEN_NON_ZERO_ROTATION;
import static com.android.quickstep.views.OverviewActionsView.HIDDEN_NO_RECENTS;
@@ -810,9 +809,8 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
            getTaskViewAt(i).setFullscreenProgress(mFullscreenProgress);
        }
        // Fade out the actions view quickly (0.1 range)
        mActionsView.getVisibilityAlpha().setValue(
        mActionsView.getFullscreenAlpha().setValue(
                mapToRange(fullscreenProgress, 0, 0.1f, 1f, 0f, LINEAR));
        mActionsView.updateHiddenFlags(HIDDEN_FULLESCREEN_PROGRESS, fullscreenProgress == 1.0f);
    }

    private void updateTaskStackListenerState() {
@@ -1212,8 +1210,8 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
    private void animateActionsViewIn() {
        mActionsView.updateHiddenFlags(HIDDEN_GESTURE_RUNNING, false);
        ObjectAnimator anim = ObjectAnimator.ofFloat(
                mActionsView.getVisibilityAlpha(), MultiValueAlpha.VALUE, 1);
        anim.setDuration(OverviewActionsView.VISIBILITY_TRANSITION_DURATION_MS);
                mActionsView.getVisibilityAlpha(), MultiValueAlpha.VALUE, 0, 1);
        anim.setDuration(TaskView.SCALE_ICON_DURATION);
        anim.start();
    }