Merge "Increase overview thumbnail size for 2 button landscape." into ub-launcher3-rvc-dev
This commit is contained in:
+6
-2
@@ -45,8 +45,10 @@ public class BackgroundAppState extends OverviewState {
|
||||
if (launcher.getDeviceProfile().isVerticalBarLayout()) {
|
||||
return super.getVerticalProgress(launcher);
|
||||
}
|
||||
RecentsView recentsView = launcher.getOverviewPanel();
|
||||
int transitionLength = LayoutUtils.getShelfTrackingDistance(launcher,
|
||||
launcher.getDeviceProfile());
|
||||
launcher.getDeviceProfile(),
|
||||
recentsView.getPagedOrientationHandler());
|
||||
AllAppsTransitionController controller = launcher.getAllAppsController();
|
||||
float scrollRange = Math.max(controller.getShiftRange(), 1);
|
||||
float progressDelta = (transitionLength / scrollRange);
|
||||
@@ -73,9 +75,11 @@ public class BackgroundAppState extends OverviewState {
|
||||
public ScaleAndTranslation getHotseatScaleAndTranslation(Launcher launcher) {
|
||||
if ((getVisibleElements(launcher) & HOTSEAT_ICONS) != 0) {
|
||||
// Translate hotseat offscreen if we show it in overview.
|
||||
RecentsView recentsView = launcher.getOverviewPanel();
|
||||
ScaleAndTranslation scaleAndTranslation = super.getHotseatScaleAndTranslation(launcher);
|
||||
scaleAndTranslation.translationY += LayoutUtils.getShelfTrackingDistance(launcher,
|
||||
launcher.getDeviceProfile());
|
||||
launcher.getDeviceProfile(),
|
||||
recentsView.getPagedOrientationHandler());
|
||||
return scaleAndTranslation;
|
||||
}
|
||||
return super.getHotseatScaleAndTranslation(launcher);
|
||||
|
||||
+2
-5
@@ -19,8 +19,7 @@ import static com.android.launcher3.anim.Interpolators.DEACCEL_2;
|
||||
import static com.android.launcher3.config.FeatureFlags.ENABLE_OVERVIEW_ACTIONS;
|
||||
import static com.android.launcher3.logging.LoggerUtils.newContainerTarget;
|
||||
import static com.android.quickstep.SysUINavigationMode.Mode.NO_BUTTON;
|
||||
import static com.android.quickstep.SysUINavigationMode.Mode.TWO_BUTTONS;
|
||||
import static com.android.quickstep.SysUINavigationMode.getMode;
|
||||
import static com.android.quickstep.SysUINavigationMode.hideShelfInTwoButtonLandscape;
|
||||
import static com.android.quickstep.SysUINavigationMode.removeShelfFromOverview;
|
||||
|
||||
import android.content.Context;
|
||||
@@ -130,10 +129,8 @@ public class OverviewState extends LauncherState {
|
||||
@Override
|
||||
public int getVisibleElements(Launcher launcher) {
|
||||
RecentsView recentsView = launcher.getOverviewPanel();
|
||||
boolean hideShelfTwoButtonLandscape = getMode(launcher) == TWO_BUTTONS &&
|
||||
!recentsView.getPagedOrientationHandler().isLayoutNaturalToLauncher();
|
||||
if (ENABLE_OVERVIEW_ACTIONS.get() && removeShelfFromOverview(launcher) ||
|
||||
hideShelfTwoButtonLandscape) {
|
||||
hideShelfInTwoButtonLandscape(launcher, recentsView.getPagedOrientationHandler())) {
|
||||
return OVERVIEW_BUTTONS;
|
||||
} else if (launcher.getDeviceProfile().isVerticalBarLayout()) {
|
||||
return VERTICAL_SWIPE_INDICATOR | OVERVIEW_BUTTONS;
|
||||
|
||||
+1
-1
@@ -116,7 +116,7 @@ public class NoButtonQuickSwitchTouchController implements TouchController,
|
||||
mRecentsView = mLauncher.getOverviewPanel();
|
||||
mXRange = mLauncher.getDeviceProfile().widthPx / 2f;
|
||||
mYRange = LayoutUtils.getShelfTrackingDistance(
|
||||
mLauncher, mLauncher.getDeviceProfile());
|
||||
mLauncher, mLauncher.getDeviceProfile(), mRecentsView.getPagedOrientationHandler());
|
||||
mMotionPauseDetector = new MotionPauseDetector(mLauncher);
|
||||
mMotionPauseMinDisplacement = mLauncher.getResources().getDimension(
|
||||
R.dimen.motion_pause_detector_min_displacement_from_app);
|
||||
|
||||
@@ -357,12 +357,13 @@ public abstract class BaseSwipeUpHandler<T extends StatefulActivity<?>, Q extend
|
||||
protected void initTransitionEndpoints(DeviceProfile dp) {
|
||||
mDp = dp;
|
||||
|
||||
mTransitionDragLength = mActivityInterface.getSwipeUpDestinationAndLength(
|
||||
dp, mContext, TEMP_RECT);
|
||||
mTaskViewSimulator.setDp(dp);
|
||||
mTaskViewSimulator.setLayoutRotation(
|
||||
mDeviceState.getCurrentActiveRotation(),
|
||||
mDeviceState.getDisplayRotation());
|
||||
mTransitionDragLength = mActivityInterface.getSwipeUpDestinationAndLength(
|
||||
dp, mContext, TEMP_RECT,
|
||||
mTaskViewSimulator.getOrientationState().getOrientationHandler());
|
||||
|
||||
if (mDeviceState.isFullyGesturalNavMode()) {
|
||||
// We can drag all the way to the top of the screen.
|
||||
|
||||
+8
-4
@@ -33,6 +33,7 @@ import com.android.launcher3.DeviceProfile;
|
||||
import com.android.launcher3.R;
|
||||
import com.android.launcher3.anim.AnimatorPlaybackController;
|
||||
import com.android.launcher3.anim.PendingAnimation;
|
||||
import com.android.launcher3.touch.PagedOrientationHandler;
|
||||
import com.android.launcher3.userevent.nano.LauncherLogProto;
|
||||
import com.android.quickstep.fallback.FallbackRecentsView;
|
||||
import com.android.quickstep.fallback.RecentsState;
|
||||
@@ -58,8 +59,9 @@ public final class FallbackActivityInterface extends
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSwipeUpDestinationAndLength(DeviceProfile dp, Context context, Rect outRect) {
|
||||
calculateTaskSize(context, dp, outRect);
|
||||
public int getSwipeUpDestinationAndLength(DeviceProfile dp, Context context, Rect outRect,
|
||||
PagedOrientationHandler orientationHandler) {
|
||||
calculateTaskSize(context, dp, outRect, orientationHandler);
|
||||
if (dp.isVerticalBarLayout()
|
||||
&& SysUINavigationMode.INSTANCE.get(context).getMode() != NO_BUTTON) {
|
||||
Rect targetInsets = dp.getInsets();
|
||||
@@ -100,7 +102,8 @@ public final class FallbackActivityInterface extends
|
||||
rv.setContentAlpha(1);
|
||||
}
|
||||
createActivityInterface(getSwipeUpDestinationAndLength(
|
||||
activity.getDeviceProfile(), activity, new Rect()));
|
||||
activity.getDeviceProfile(), activity, new Rect(),
|
||||
rv.getPagedOrientationHandler()));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -193,7 +196,8 @@ public final class FallbackActivityInterface extends
|
||||
}
|
||||
|
||||
@Override
|
||||
protected float getExtraSpace(Context context, DeviceProfile dp) {
|
||||
protected float getExtraSpace(Context context, DeviceProfile dp,
|
||||
PagedOrientationHandler orientationHandler) {
|
||||
return showOverviewActions(context)
|
||||
? context.getResources().getDimensionPixelSize(R.dimen.overview_actions_height)
|
||||
: 0;
|
||||
|
||||
+11
-8
@@ -21,13 +21,12 @@ import static com.android.launcher3.LauncherState.OVERVIEW;
|
||||
import static com.android.launcher3.anim.Interpolators.ACCEL_2;
|
||||
import static com.android.launcher3.anim.Interpolators.INSTANT;
|
||||
import static com.android.launcher3.anim.Interpolators.LINEAR;
|
||||
import static com.android.launcher3.config.FeatureFlags.ENABLE_OVERVIEW_ACTIONS;
|
||||
import static com.android.launcher3.uioverrides.states.QuickstepAtomicAnimationFactory.INDEX_RECENTS_FADE_ANIM;
|
||||
import static com.android.launcher3.uioverrides.states.QuickstepAtomicAnimationFactory.INDEX_RECENTS_TRANSLATE_X_ANIM;
|
||||
import static com.android.launcher3.uioverrides.states.QuickstepAtomicAnimationFactory.INDEX_SHELF_ANIM;
|
||||
import static com.android.quickstep.LauncherSwipeHandler.RECENTS_ATTACH_DURATION;
|
||||
import static com.android.quickstep.SysUINavigationMode.getMode;
|
||||
import static com.android.quickstep.SysUINavigationMode.removeShelfFromOverview;
|
||||
import static com.android.quickstep.SysUINavigationMode.hideShelfInTwoButtonLandscape;
|
||||
import static com.android.quickstep.util.LayoutUtils.getDefaultSwipeHeight;
|
||||
import static com.android.quickstep.views.RecentsView.ADJACENT_PAGE_OFFSET;
|
||||
import static com.android.quickstep.views.RecentsView.FULLSCREEN_PROGRESS;
|
||||
@@ -57,6 +56,7 @@ import com.android.launcher3.appprediction.PredictionUiStateManager;
|
||||
import com.android.launcher3.statehandlers.DepthController;
|
||||
import com.android.launcher3.statehandlers.DepthController.ClampedDepthProperty;
|
||||
import com.android.launcher3.testing.TestProtocol;
|
||||
import com.android.launcher3.touch.PagedOrientationHandler;
|
||||
import com.android.launcher3.userevent.nano.LauncherLogProto;
|
||||
import com.android.quickstep.SysUINavigationMode.Mode;
|
||||
import com.android.quickstep.util.ActivityInitListener;
|
||||
@@ -84,14 +84,15 @@ public final class LauncherActivityInterface extends
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSwipeUpDestinationAndLength(DeviceProfile dp, Context context, Rect outRect) {
|
||||
calculateTaskSize(context, dp, outRect);
|
||||
public int getSwipeUpDestinationAndLength(DeviceProfile dp, Context context, Rect outRect,
|
||||
PagedOrientationHandler orientationHandler) {
|
||||
calculateTaskSize(context, dp, outRect, orientationHandler);
|
||||
if (dp.isVerticalBarLayout() && SysUINavigationMode.getMode(context) != Mode.NO_BUTTON) {
|
||||
Rect targetInsets = dp.getInsets();
|
||||
int hotseatInset = dp.isSeascape() ? targetInsets.left : targetInsets.right;
|
||||
return dp.hotseatBarSizePx + hotseatInset;
|
||||
} else {
|
||||
return LayoutUtils.getShelfTrackingDistance(context, dp);
|
||||
return LayoutUtils.getShelfTrackingDistance(context, dp, orientationHandler);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -395,9 +396,11 @@ public final class LauncherActivityInterface extends
|
||||
}
|
||||
|
||||
@Override
|
||||
protected float getExtraSpace(Context context, DeviceProfile dp) {
|
||||
if (dp.isVerticalBarLayout()) {
|
||||
return 0;
|
||||
protected float getExtraSpace(Context context, DeviceProfile dp,
|
||||
PagedOrientationHandler orientationHandler) {
|
||||
if (dp.isVerticalBarLayout() ||
|
||||
hideShelfInTwoButtonLandscape(context, orientationHandler)) {
|
||||
return 0;
|
||||
} else {
|
||||
Resources res = context.getResources();
|
||||
if (showOverviewActions(context)) {
|
||||
|
||||
+3
-1
@@ -7,6 +7,7 @@ import android.os.Bundle;
|
||||
import com.android.launcher3.config.FeatureFlags;
|
||||
import com.android.launcher3.testing.TestInformationHandler;
|
||||
import com.android.launcher3.testing.TestProtocol;
|
||||
import com.android.launcher3.touch.PagedOrientationHandler;
|
||||
import com.android.launcher3.uioverrides.touchcontrollers.PortraitStatesTouchController;
|
||||
import com.android.quickstep.util.LayoutUtils;
|
||||
import com.android.systemui.shared.recents.model.Task;
|
||||
@@ -35,7 +36,8 @@ public class QuickstepTestInformationHandler extends TestInformationHandler {
|
||||
|
||||
case TestProtocol.REQUEST_BACKGROUND_TO_OVERVIEW_SWIPE_HEIGHT: {
|
||||
final float swipeHeight =
|
||||
LayoutUtils.getShelfTrackingDistance(mContext, mDeviceProfile);
|
||||
LayoutUtils.getShelfTrackingDistance(mContext, mDeviceProfile,
|
||||
PagedOrientationHandler.HOME_ROTATED);
|
||||
response.putInt(TestProtocol.TEST_INFO_RESPONSE_FIELD, (int) swipeHeight);
|
||||
return response;
|
||||
}
|
||||
|
||||
+2
-1
@@ -116,7 +116,8 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy {
|
||||
if (mDp == null) {
|
||||
return 1;
|
||||
}
|
||||
mSizeStrategy.calculateTaskSize(mContext, mDp, mTaskRect);
|
||||
mSizeStrategy.calculateTaskSize(mContext, mDp, mTaskRect,
|
||||
mOrientationState.getOrientationHandler());
|
||||
return mOrientationState.getFullScreenScaleAndPivot(mTaskRect, mDp, mPivot);
|
||||
}
|
||||
|
||||
|
||||
@@ -827,6 +827,10 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
|
||||
@Override
|
||||
public void setInsets(Rect insets) {
|
||||
mInsets.set(insets);
|
||||
resetPaddingFromTaskSize();
|
||||
}
|
||||
|
||||
private void resetPaddingFromTaskSize() {
|
||||
DeviceProfile dp = mActivity.getDeviceProfile();
|
||||
mOrientationState.setMultiWindowMode(dp.isMultiWindowMode);
|
||||
getTaskSize(mTempRect);
|
||||
@@ -840,7 +844,8 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
|
||||
}
|
||||
|
||||
public void getTaskSize(Rect outRect) {
|
||||
mSizeStrategy.calculateTaskSize(mActivity, mActivity.getDeviceProfile(), outRect);
|
||||
mSizeStrategy.calculateTaskSize(mActivity, mActivity.getDeviceProfile(), outRect,
|
||||
mOrientationHandler);
|
||||
}
|
||||
|
||||
/** Gets the task size for modal state. */
|
||||
@@ -1618,6 +1623,7 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
|
||||
mActivity.getDragLayer().recreateControllers();
|
||||
mActionsView.updateHiddenFlags(HIDDEN_NON_ZERO_ROTATION,
|
||||
touchRotation != 0 || mOrientationState.getLauncherRotation() != ROTATION_0);
|
||||
resetPaddingFromTaskSize();
|
||||
requestLayout();
|
||||
}
|
||||
}
|
||||
|
||||
+3
-1
@@ -51,6 +51,7 @@ import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType;
|
||||
import com.android.quickstep.SystemUiProxy;
|
||||
import com.android.quickstep.TouchInteractionService;
|
||||
import com.android.quickstep.util.LayoutUtils;
|
||||
import com.android.quickstep.views.RecentsView;
|
||||
|
||||
/**
|
||||
* Touch controller for handling various state transitions in portrait UI.
|
||||
@@ -244,8 +245,9 @@ public class PortraitStatesTouchController extends AbstractStateChangeTouchContr
|
||||
mCurrentAnimation = mPendingAnimation.createPlaybackController()
|
||||
.setOnCancelRunnable(onCancelRunnable);
|
||||
mLauncher.getStateManager().setCurrentUserControlledAnimation(mCurrentAnimation);
|
||||
RecentsView recentsView = mLauncher.getOverviewPanel();
|
||||
totalShift = LayoutUtils.getShelfTrackingDistance(mLauncher,
|
||||
mLauncher.getDeviceProfile());
|
||||
mLauncher.getDeviceProfile(), recentsView.getPagedOrientationHandler());
|
||||
} else {
|
||||
mCurrentAnimation = mLauncher.getStateManager()
|
||||
.createAnimationToNewWorkspace(mToState, config)
|
||||
|
||||
@@ -17,6 +17,7 @@ package com.android.quickstep;
|
||||
|
||||
import static com.android.launcher3.config.FeatureFlags.ENABLE_OVERVIEW_ACTIONS;
|
||||
import static com.android.quickstep.SysUINavigationMode.getMode;
|
||||
import static com.android.quickstep.SysUINavigationMode.hideShelfInTwoButtonLandscape;
|
||||
import static com.android.quickstep.SysUINavigationMode.removeShelfFromOverview;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
@@ -37,6 +38,7 @@ import com.android.launcher3.anim.AnimatorPlaybackController;
|
||||
import com.android.launcher3.statehandlers.DepthController;
|
||||
import com.android.launcher3.statemanager.BaseState;
|
||||
import com.android.launcher3.statemanager.StatefulActivity;
|
||||
import com.android.launcher3.touch.PagedOrientationHandler;
|
||||
import com.android.launcher3.util.WindowBounds;
|
||||
import com.android.quickstep.SysUINavigationMode.Mode;
|
||||
import com.android.quickstep.util.ActivityInitListener;
|
||||
@@ -73,7 +75,8 @@ public abstract class BaseActivityInterface<STATE_TYPE extends BaseState<STATE_T
|
||||
}
|
||||
|
||||
public abstract int getSwipeUpDestinationAndLength(
|
||||
DeviceProfile dp, Context context, Rect outRect);
|
||||
DeviceProfile dp, Context context, Rect outRect,
|
||||
PagedOrientationHandler orientationHandler);
|
||||
|
||||
public void onSwipeUpToRecentsComplete() {
|
||||
// Re apply state in case we did something funky during the transition.
|
||||
@@ -184,16 +187,21 @@ public abstract class BaseActivityInterface<STATE_TYPE extends BaseState<STATE_T
|
||||
/**
|
||||
* Calculates the taskView size for the provided device configuration
|
||||
*/
|
||||
public final void calculateTaskSize(Context context, DeviceProfile dp, Rect outRect) {
|
||||
calculateTaskSize(context, dp, getExtraSpace(context, dp), outRect);
|
||||
public final void calculateTaskSize(Context context, DeviceProfile dp, Rect outRect,
|
||||
PagedOrientationHandler orientedState) {
|
||||
calculateTaskSize(context, dp, getExtraSpace(context, dp, orientedState),
|
||||
outRect, orientedState);
|
||||
}
|
||||
|
||||
protected abstract float getExtraSpace(Context context, DeviceProfile dp);
|
||||
protected abstract float getExtraSpace(Context context, DeviceProfile dp,
|
||||
PagedOrientationHandler orientedState);
|
||||
|
||||
private void calculateTaskSize(
|
||||
Context context, DeviceProfile dp, float extraVerticalSpace, Rect outRect) {
|
||||
Context context, DeviceProfile dp, float extraVerticalSpace, Rect outRect,
|
||||
PagedOrientationHandler orientationHandler) {
|
||||
Resources res = context.getResources();
|
||||
final boolean showLargeTaskSize = showOverviewActions(context);
|
||||
final boolean showLargeTaskSize = showOverviewActions(context) ||
|
||||
hideShelfInTwoButtonLandscape(context, orientationHandler);
|
||||
|
||||
final int paddingResId;
|
||||
if (dp.isMultiWindowMode) {
|
||||
|
||||
@@ -24,6 +24,7 @@ import android.content.Intent;
|
||||
import android.content.res.Resources;
|
||||
import android.util.Log;
|
||||
|
||||
import com.android.launcher3.touch.PagedOrientationHandler;
|
||||
import com.android.launcher3.util.MainThreadInitializedObject;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
@@ -134,6 +135,12 @@ public class SysUINavigationMode {
|
||||
return getMode(context) != Mode.TWO_BUTTONS;
|
||||
}
|
||||
|
||||
public static boolean hideShelfInTwoButtonLandscape(Context context,
|
||||
PagedOrientationHandler pagedOrientationHandler) {
|
||||
return getMode(context) == Mode.TWO_BUTTONS &&
|
||||
!pagedOrientationHandler.isLayoutNaturalToLauncher();
|
||||
}
|
||||
|
||||
public void dump(PrintWriter pw) {
|
||||
pw.println("SysUINavigationMode:");
|
||||
pw.println(" mode=" + mMode.name());
|
||||
|
||||
@@ -25,6 +25,7 @@ import android.view.ViewGroup;
|
||||
|
||||
import com.android.launcher3.DeviceProfile;
|
||||
import com.android.launcher3.R;
|
||||
import com.android.launcher3.touch.PagedOrientationHandler;
|
||||
import com.android.quickstep.LauncherActivityInterface;
|
||||
import com.android.quickstep.SysUINavigationMode;
|
||||
|
||||
@@ -41,11 +42,13 @@ public class LayoutUtils {
|
||||
return swipeHeight;
|
||||
}
|
||||
|
||||
public static int getShelfTrackingDistance(Context context, DeviceProfile dp) {
|
||||
public static int getShelfTrackingDistance(Context context, DeviceProfile dp,
|
||||
PagedOrientationHandler orientationHandler) {
|
||||
// Track the bottom of the window.
|
||||
if (ENABLE_OVERVIEW_ACTIONS.get() && removeShelfFromOverview(context)) {
|
||||
Rect taskSize = new Rect();
|
||||
LauncherActivityInterface.INSTANCE.calculateTaskSize(context, dp, taskSize);
|
||||
LauncherActivityInterface.INSTANCE.calculateTaskSize(context, dp, taskSize,
|
||||
orientationHandler);
|
||||
return (dp.heightPx - taskSize.height()) / 2;
|
||||
}
|
||||
int shelfHeight = dp.hotseatBarSizePx + dp.getInsets().bottom;
|
||||
|
||||
Reference in New Issue
Block a user