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

Commit 1282050f authored by Tony Wickham's avatar Tony Wickham Committed by Android (Google) Code Review
Browse files

Merge changes I9749124a,Ic59b877c,Ibe8734e8 into sc-dev

* changes:
  Fix running task damped by overscroll when other tasks are offscreen
  When overview appears from motion pause, come up from bottom
  Align home/back button from overview with tap outside
parents c9744631 48d6dc77
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -19,6 +19,7 @@ import static com.android.launcher3.AbstractFloatingView.TYPE_ALL;
import static com.android.launcher3.AbstractFloatingView.TYPE_HIDE_BACK_BUTTON;
import static com.android.launcher3.AbstractFloatingView.TYPE_HIDE_BACK_BUTTON;
import static com.android.launcher3.LauncherState.FLAG_HIDE_BACK_BUTTON;
import static com.android.launcher3.LauncherState.FLAG_HIDE_BACK_BUTTON;
import static com.android.launcher3.LauncherState.NORMAL;
import static com.android.launcher3.LauncherState.NORMAL;
import static com.android.launcher3.LauncherState.NO_OFFSET;
import static com.android.launcher3.util.DisplayController.CHANGE_ACTIVE_SCREEN;
import static com.android.launcher3.util.DisplayController.CHANGE_ACTIVE_SCREEN;
import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
import static com.android.quickstep.SysUINavigationMode.Mode.TWO_BUTTONS;
import static com.android.quickstep.SysUINavigationMode.Mode.TWO_BUTTONS;
@@ -343,7 +344,7 @@ public abstract class BaseQuickstepLauncher extends Launcher
    @Override
    @Override
    public float[] getNormalOverviewScaleAndOffset() {
    public float[] getNormalOverviewScaleAndOffset() {
        return SysUINavigationMode.getMode(this).hasGestures
        return SysUINavigationMode.getMode(this).hasGestures
                ? new float[] {1, 1} : new float[] {1.1f, 0};
                ? new float[] {1, NO_OFFSET, 1} : new float[] {1.1f, NO_OFFSET, NO_OFFSET};
    }
    }


    @Override
    @Override
+8 −3
Original line number Original line Diff line number Diff line
@@ -22,8 +22,10 @@ import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_FA
import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_MODAL;
import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_MODAL;
import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_SCALE;
import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_SCALE;
import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_TRANSLATE_X;
import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_TRANSLATE_X;
import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_TRANSLATE_Y;
import static com.android.launcher3.states.StateAnimationConfig.SKIP_OVERVIEW;
import static com.android.launcher3.states.StateAnimationConfig.SKIP_OVERVIEW;
import static com.android.quickstep.views.RecentsView.ADJACENT_PAGE_OFFSET;
import static com.android.quickstep.views.RecentsView.ADJACENT_PAGE_HORIZONTAL_OFFSET;
import static com.android.quickstep.views.RecentsView.ADJACENT_PAGE_VERTICAL_OFFSET;
import static com.android.quickstep.views.RecentsView.RECENTS_GRID_PROGRESS;
import static com.android.quickstep.views.RecentsView.RECENTS_GRID_PROGRESS;
import static com.android.quickstep.views.RecentsView.RECENTS_SCALE_PROPERTY;
import static com.android.quickstep.views.RecentsView.RECENTS_SCALE_PROPERTY;
import static com.android.quickstep.views.RecentsView.TASK_PRIMARY_SPLIT_TRANSLATION;
import static com.android.quickstep.views.RecentsView.TASK_PRIMARY_SPLIT_TRANSLATION;
@@ -62,7 +64,8 @@ public abstract class BaseRecentsViewStateController<T extends RecentsView>
    public void setState(@NonNull LauncherState state) {
    public void setState(@NonNull LauncherState state) {
        float[] scaleAndOffset = state.getOverviewScaleAndOffset(mLauncher);
        float[] scaleAndOffset = state.getOverviewScaleAndOffset(mLauncher);
        RECENTS_SCALE_PROPERTY.set(mRecentsView, scaleAndOffset[0]);
        RECENTS_SCALE_PROPERTY.set(mRecentsView, scaleAndOffset[0]);
        ADJACENT_PAGE_OFFSET.set(mRecentsView, scaleAndOffset[1]);
        ADJACENT_PAGE_HORIZONTAL_OFFSET.set(mRecentsView, scaleAndOffset[1]);
        ADJACENT_PAGE_VERTICAL_OFFSET.set(mRecentsView, scaleAndOffset[2]);
        TASK_SECONDARY_TRANSLATION.set(mRecentsView, 0f);
        TASK_SECONDARY_TRANSLATION.set(mRecentsView, 0f);


        getContentAlphaProperty().set(mRecentsView, state.overviewUi ? 1f : 0);
        getContentAlphaProperty().set(mRecentsView, state.overviewUi ? 1f : 0);
@@ -92,8 +95,10 @@ public abstract class BaseRecentsViewStateController<T extends RecentsView>
        float[] scaleAndOffset = toState.getOverviewScaleAndOffset(mLauncher);
        float[] scaleAndOffset = toState.getOverviewScaleAndOffset(mLauncher);
        setter.setFloat(mRecentsView, RECENTS_SCALE_PROPERTY, scaleAndOffset[0],
        setter.setFloat(mRecentsView, RECENTS_SCALE_PROPERTY, scaleAndOffset[0],
                config.getInterpolator(ANIM_OVERVIEW_SCALE, LINEAR));
                config.getInterpolator(ANIM_OVERVIEW_SCALE, LINEAR));
        setter.setFloat(mRecentsView, ADJACENT_PAGE_OFFSET, scaleAndOffset[1],
        setter.setFloat(mRecentsView, ADJACENT_PAGE_HORIZONTAL_OFFSET, scaleAndOffset[1],
                config.getInterpolator(ANIM_OVERVIEW_TRANSLATE_X, LINEAR));
                config.getInterpolator(ANIM_OVERVIEW_TRANSLATE_X, LINEAR));
        setter.setFloat(mRecentsView, ADJACENT_PAGE_VERTICAL_OFFSET, scaleAndOffset[2],
                config.getInterpolator(ANIM_OVERVIEW_TRANSLATE_Y, LINEAR));
        PagedOrientationHandler orientationHandler =
        PagedOrientationHandler orientationHandler =
                ((RecentsView) mLauncher.getOverviewPanel()).getPagedOrientationHandler();
                ((RecentsView) mLauncher.getOverviewPanel()).getPagedOrientationHandler();
        FloatProperty taskViewsFloat = orientationHandler.getSplitSelectTaskOffset(
        FloatProperty taskViewsFloat = orientationHandler.getSplitSelectTaskOffset(
+0 −5
Original line number Original line Diff line number Diff line
@@ -83,11 +83,6 @@ public class AllAppsState extends LauncherState {
        return ALL_APPS_CONTENT;
        return ALL_APPS_CONTENT;
    }
    }


    @Override
    public float[] getOverviewScaleAndOffset(Launcher launcher) {
        return new float[] {0.9f, 1};
    }

    @Override
    @Override
    public LauncherState getHistoryForState(LauncherState previousState) {
    public LauncherState getHistoryForState(LauncherState previousState) {
        return previousState == OVERVIEW ? OVERVIEW : NORMAL;
        return previousState == OVERVIEW ? OVERVIEW : NORMAL;
+1 −1
Original line number Original line Diff line number Diff line
@@ -96,6 +96,6 @@ public class BackgroundAppState extends OverviewState {
            BaseDraggingActivity activity) {
            BaseDraggingActivity activity) {
        return new float[] {
        return new float[] {
                ((RecentsView) activity.getOverviewPanel()).getMaxScaleForFullScreen(),
                ((RecentsView) activity.getOverviewPanel()).getMaxScaleForFullScreen(),
                NO_OFFSET};
                NO_OFFSET, NO_OFFSET};
    }
    }
}
}
+1 −1
Original line number Original line Diff line number Diff line
@@ -78,6 +78,6 @@ public class OverviewModalTaskState extends OverviewState {
        float scale = Math.min((float) modalTaskSize.height() / taskSize.y,
        float scale = Math.min((float) modalTaskSize.height() / taskSize.y,
                (float) modalTaskSize.width() / taskSize.x);
                (float) modalTaskSize.width() / taskSize.x);


        return new float[] {scale, NO_OFFSET};
        return new float[] {scale, NO_OFFSET, NO_OFFSET};
    }
    }
}
}
Loading