From e5ba8fa7a5a18c80799a14ce63a42a6ddd5e6aa1 Mon Sep 17 00:00:00 2001 From: Jeremy Sim Date: Fri, 8 Jul 2022 17:24:06 -0700 Subject: [PATCH 1/4] Update animations for TM-QPR: OverviewSplitSelect > Home transition The animation from OverviewSplitSelect to Home is now updated to the latest spec. See bug for details. - New timings - FloatingTaskView now translates out, instead of fading - FloatingTaskView and SplitInstructionsView now disappear concurrently with the rest of Overview, instead of afterward Fixes: 236761067 Test: Manual on tablet and phone Change-Id: Iaa1c804a60859232f331950098b67968cc187e82 --- .../BaseRecentsViewStateController.java | 52 +++++++++++++++++++ .../uioverrides/states/OverviewState.java | 15 +++++- .../QuickstepAtomicAnimationFactory.java | 20 +++++-- .../quickstep/views/FloatingTaskView.java | 4 ++ .../android/quickstep/views/RecentsView.java | 38 ++++++++++++++ .../states/StateAnimationConfig.java | 6 ++- .../touch/LandscapePagedViewHandler.java | 18 +++++++ .../touch/PagedOrientationHandler.java | 37 ++++++++++++- .../touch/PortraitPagedViewHandler.java | 34 +++++++++++- 9 files changed, 214 insertions(+), 10 deletions(-) diff --git a/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java b/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java index 7166a3e413..dc707ed116 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java +++ b/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java @@ -23,16 +23,22 @@ import static com.android.launcher3.anim.Interpolators.LINEAR; import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_FADE; 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_SPLIT_SELECT_FLOATING_TASK_TRANSLATE_OFFSCREEN; +import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_SPLIT_SELECT_INSTRUCTIONS_FADE; 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.testing.TestProtocol.BAD_STATE; import static com.android.quickstep.views.RecentsView.ADJACENT_PAGE_HORIZONTAL_OFFSET; +import static com.android.quickstep.views.RecentsView.FIRST_FLOATING_TASK_TRANSLATE_OFFSCREEN; import static com.android.quickstep.views.RecentsView.OVERVIEW_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.SPLIT_INSTRUCTIONS_FADE; import static com.android.quickstep.views.RecentsView.TASK_SECONDARY_TRANSLATION; +import android.graphics.Rect; +import android.graphics.RectF; import android.util.FloatProperty; import android.util.Log; @@ -40,9 +46,12 @@ import androidx.annotation.NonNull; import com.android.launcher3.BaseQuickstepLauncher; import com.android.launcher3.LauncherState; +import com.android.launcher3.Utilities; import com.android.launcher3.anim.PendingAnimation; +import com.android.launcher3.dragndrop.DragLayer; import com.android.launcher3.statemanager.StateManager.StateHandler; import com.android.launcher3.states.StateAnimationConfig; +import com.android.quickstep.views.FloatingTaskView; import com.android.quickstep.views.RecentsView; /** @@ -106,6 +115,49 @@ public abstract class BaseRecentsViewStateController setter.setFloat(mRecentsView, TASK_SECONDARY_TRANSLATION, 0f, config.getInterpolator(ANIM_OVERVIEW_TRANSLATE_Y, LINEAR)); + if (mRecentsView.isSplitSelectionActive()) { + // TODO (b/238651489): Refactor state management to avoid need for double check + FloatingTaskView floatingTask = mRecentsView.getFirstFloatingTaskView(); + if (floatingTask != null) { + DragLayer dragLayer = mLauncher.getDragLayer(); + RectF onScreenRectF = new RectF(); + Utilities.getBoundsForViewInDragLayer(mLauncher.getDragLayer(), floatingTask, + new Rect(0, 0, floatingTask.getWidth(), floatingTask.getHeight()), + false, null, onScreenRectF); + // Get the part of the floatingTask that intersects with the DragLayer (i.e. the + // on-screen portion) + onScreenRectF.intersect( + dragLayer.getLeft(), + dragLayer.getTop(), + dragLayer.getRight(), + dragLayer.getBottom() + ); + + setter.setFloat( + mRecentsView, + FIRST_FLOATING_TASK_TRANSLATE_OFFSCREEN, + mRecentsView.getPagedOrientationHandler() + .getFloatingTaskOffscreenTranslationTarget( + floatingTask, + onScreenRectF, + floatingTask.getStagePosition(), + mLauncher.getDeviceProfile() + ), + config.getInterpolator( + ANIM_OVERVIEW_SPLIT_SELECT_FLOATING_TASK_TRANSLATE_OFFSCREEN, + LINEAR + )); + setter.setFloat( + mRecentsView, + SPLIT_INSTRUCTIONS_FADE, + 1, + config.getInterpolator( + ANIM_OVERVIEW_SPLIT_SELECT_INSTRUCTIONS_FADE, + LINEAR + )); + } + } + float recentsAlpha = toState.overviewUi ? 1 : 0; Log.d(BAD_STATE, "BaseRecentsViewStateController setStateWithAnimationInternal toState=" + toState + ", alpha=" + recentsAlpha); diff --git a/quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java b/quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java index c0810b929e..66e5ac6b1f 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java +++ b/quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java @@ -39,6 +39,10 @@ import com.android.quickstep.views.TaskView; */ public class OverviewState extends LauncherState { + private static final int OVERVIEW_SLIDE_IN_DURATION = 380; + private static final int OVERVIEW_POP_IN_DURATION = 250; + private static final int OVERVIEW_EXIT_DURATION = 250; + protected static final Rect sTempRect = new Rect(); private static final int STATE_FLAGS = FLAG_WORKSPACE_ICONS_CAN_BE_DRAGGED @@ -59,8 +63,15 @@ public class OverviewState extends LauncherState { @Override public int getTransitionDuration(Context context, boolean isToState) { - // In gesture modes, overview comes in all the way from the side, so give it more time. - return DisplayController.getNavigationMode(context).hasGestures ? 380 : 250; + if (isToState) { + // In gesture modes, overview comes in all the way from the side, so give it more time. + return DisplayController.getNavigationMode(context).hasGestures + ? OVERVIEW_SLIDE_IN_DURATION + : OVERVIEW_POP_IN_DURATION; + } else { + // When exiting Overview, exit quickly. + return OVERVIEW_EXIT_DURATION; + } } @Override diff --git a/quickstep/src/com/android/launcher3/uioverrides/states/QuickstepAtomicAnimationFactory.java b/quickstep/src/com/android/launcher3/uioverrides/states/QuickstepAtomicAnimationFactory.java index 4d2f9652ad..872e64a510 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/states/QuickstepAtomicAnimationFactory.java +++ b/quickstep/src/com/android/launcher3/uioverrides/states/QuickstepAtomicAnimationFactory.java @@ -22,13 +22,15 @@ import static com.android.launcher3.LauncherState.HINT_STATE; import static com.android.launcher3.LauncherState.HINT_STATE_TWO_BUTTON; import static com.android.launcher3.LauncherState.NORMAL; import static com.android.launcher3.LauncherState.OVERVIEW; +import static com.android.launcher3.LauncherState.OVERVIEW_SPLIT_SELECT; import static com.android.launcher3.WorkspaceStateTransitionAnimation.getWorkspaceSpringScaleAnimator; import static com.android.launcher3.anim.Interpolators.ACCEL; import static com.android.launcher3.anim.Interpolators.ACCEL_DEACCEL; import static com.android.launcher3.anim.Interpolators.DEACCEL; import static com.android.launcher3.anim.Interpolators.DEACCEL_1_7; import static com.android.launcher3.anim.Interpolators.DEACCEL_3; -import static com.android.launcher3.anim.Interpolators.FAST_OUT_SLOW_IN; +import static com.android.launcher3.anim.Interpolators.EMPHASIZED_ACCELERATE; +import static com.android.launcher3.anim.Interpolators.EMPHASIZED_DECELERATE; import static com.android.launcher3.anim.Interpolators.FINAL_FRAME; import static com.android.launcher3.anim.Interpolators.INSTANT; import static com.android.launcher3.anim.Interpolators.LINEAR; @@ -39,6 +41,8 @@ import static com.android.launcher3.states.StateAnimationConfig.ANIM_DEPTH; import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_ACTIONS_FADE; import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_FADE; import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_SCALE; +import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_SPLIT_SELECT_FLOATING_TASK_TRANSLATE_OFFSCREEN; +import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_SPLIT_SELECT_INSTRUCTIONS_FADE; 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.ANIM_SCRIM_FADE; @@ -87,9 +91,16 @@ public class QuickstepAtomicAnimationFactory extends public void prepareForAtomicAnimation(LauncherState fromState, LauncherState toState, StateAnimationConfig config) { RecentsView overview = mActivity.getOverviewPanel(); - if (toState == NORMAL && fromState == OVERVIEW) { + if ((fromState == OVERVIEW || fromState == OVERVIEW_SPLIT_SELECT) && toState == NORMAL) { + if (fromState == OVERVIEW_SPLIT_SELECT) { + config.setInterpolator(ANIM_OVERVIEW_SPLIT_SELECT_FLOATING_TASK_TRANSLATE_OFFSCREEN, + clampToProgress(EMPHASIZED_ACCELERATE, 0, 0.4f)); + config.setInterpolator(ANIM_OVERVIEW_SPLIT_SELECT_INSTRUCTIONS_FADE, + clampToProgress(LINEAR, 0, 0.33f)); + } + config.setInterpolator(ANIM_OVERVIEW_ACTIONS_FADE, clampToProgress(LINEAR, 0, 0.25f)); - config.setInterpolator(ANIM_SCRIM_FADE, LINEAR); + config.setInterpolator(ANIM_SCRIM_FADE, clampToProgress(LINEAR, 0.33f, 1)); config.setInterpolator(ANIM_WORKSPACE_SCALE, DEACCEL); config.setInterpolator(ANIM_WORKSPACE_FADE, ACCEL); @@ -98,8 +109,7 @@ public class QuickstepAtomicAnimationFactory extends // Overview is going offscreen, so keep it at its current scale and opacity. config.setInterpolator(ANIM_OVERVIEW_SCALE, FINAL_FRAME); config.setInterpolator(ANIM_OVERVIEW_FADE, FINAL_FRAME); - config.setInterpolator(ANIM_OVERVIEW_TRANSLATE_X, - clampToProgress(FAST_OUT_SLOW_IN, 0, 0.75f)); + config.setInterpolator(ANIM_OVERVIEW_TRANSLATE_X, EMPHASIZED_DECELERATE); config.setInterpolator(ANIM_OVERVIEW_TRANSLATE_Y, FINAL_FRAME); } else { config.setInterpolator(ANIM_OVERVIEW_TRANSLATE_X, ACCEL_DEACCEL); diff --git a/quickstep/src/com/android/quickstep/views/FloatingTaskView.java b/quickstep/src/com/android/quickstep/views/FloatingTaskView.java index 835c9f7e8e..7a66ea00e1 100644 --- a/quickstep/src/com/android/quickstep/views/FloatingTaskView.java +++ b/quickstep/src/com/android/quickstep/views/FloatingTaskView.java @@ -260,6 +260,10 @@ public class FloatingTaskView extends FrameLayout { mActivity.getDeviceProfile(), mStagePosition); } + public int getStagePosition() { + return mStagePosition; + } + private static class SplitOverlayProperties { private final float finalTaskViewScaleX; diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index dc886f6151..74a7b9ef63 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -397,6 +397,39 @@ public abstract class RecentsView FIRST_FLOATING_TASK_TRANSLATE_OFFSCREEN = + new FloatProperty("firstFloatingTaskTranslateOffscreen") { + @Override + public void setValue(RecentsView view, float translation) { + view.getPagedOrientationHandler().setFloatingTaskPrimaryTranslation( + view.mFirstFloatingTaskView, + translation, + view.mActivity.getDeviceProfile() + ); + } + + @Override + public Float get(RecentsView view) { + return view.getPagedOrientationHandler().getFloatingTaskPrimaryTranslation( + view.mFirstFloatingTaskView, + view.mActivity.getDeviceProfile() + ); + } + }; + + public static final FloatProperty SPLIT_INSTRUCTIONS_FADE = + new FloatProperty("splitInstructionsFade") { + @Override + public void setValue(RecentsView view, float fade) { + view.mSplitInstructionsView.setAlpha(1 - fade); + } + + @Override + public Float get(RecentsView view) { + return 1 - view.mSplitInstructionsView.getAlpha(); + } + }; + // OverScroll constants private static final int OVERSCROLL_PAGE_SNAP_ANIMATION_DURATION = 270; @@ -5250,6 +5283,11 @@ public abstract class RecentsView(primary, secondary); } + + @Override + public float getFloatingTaskOffscreenTranslationTarget(View floatingTask, RectF onScreenRect, + @StagePosition int stagePosition, DeviceProfile dp) { + float currentTranslationY = floatingTask.getTranslationY(); + return currentTranslationY - onScreenRect.height(); + } + + @Override + public void setFloatingTaskPrimaryTranslation(View floatingTask, float translation, + DeviceProfile dp) { + floatingTask.setTranslationY(translation); + } + + @Override + public Float getFloatingTaskPrimaryTranslation(View floatingTask, DeviceProfile dp) { + return floatingTask.getTranslationY(); + } } diff --git a/src/com/android/launcher3/touch/PagedOrientationHandler.java b/src/com/android/launcher3/touch/PagedOrientationHandler.java index 6bc021b515..1a8d355ffc 100644 --- a/src/com/android/launcher3/touch/PagedOrientationHandler.java +++ b/src/com/android/launcher3/touch/PagedOrientationHandler.java @@ -34,9 +34,9 @@ import android.widget.LinearLayout; import com.android.launcher3.DeviceProfile; import com.android.launcher3.util.SplitConfigurationOptions; +import com.android.launcher3.util.SplitConfigurationOptions.SplitBounds; import com.android.launcher3.util.SplitConfigurationOptions.SplitPositionOption; import com.android.launcher3.util.SplitConfigurationOptions.StagePosition; -import com.android.launcher3.util.SplitConfigurationOptions.SplitBounds; import java.util.List; @@ -242,6 +242,41 @@ public interface PagedOrientationHandler { */ void fixBoundsForHomeAnimStartRect(RectF outStartRect, DeviceProfile deviceProfile); + /** + * Determine the target translation for animating the FloatingTaskView out. This value could + * either be an x-coordinate or a y-coordinate, depending on which way the FloatingTaskView was + * docked. + * + * @param floatingTask The FloatingTaskView. + * @param onScreenRect The current on-screen dimensions of the FloatingTaskView. + * @param stagePosition STAGE_POSITION_TOP_OR_LEFT or STAGE_POSITION_BOTTOM_OR_RIGHT. + * @param dp The device profile. + * @return A float. When an animation translates the FloatingTaskView to this position, it will + * appear to tuck away off the edge of the screen. + */ + float getFloatingTaskOffscreenTranslationTarget(View floatingTask, RectF onScreenRect, + @StagePosition int stagePosition, DeviceProfile dp); + + /** + * Sets the translation of a FloatingTaskView along its "slide-in/slide-out" axis (could be + * either x or y), depending on how the view is oriented. + * + * @param floatingTask The FloatingTaskView to be translated. + * @param translation The target translation value. + * @param dp The current device profile. + */ + void setFloatingTaskPrimaryTranslation(View floatingTask, float translation, DeviceProfile dp); + + /** + * Gets the translation of a FloatingTaskView along its "slide-in/slide-out" axis (could be + * either x or y), depending on how the view is oriented. + * + * @param floatingTask The FloatingTaskView in question. + * @param dp The current device profile. + * @return The current translation value. + */ + Float getFloatingTaskPrimaryTranslation(View floatingTask, DeviceProfile dp); + class ChildBounds { public final int primaryDimension; diff --git a/src/com/android/launcher3/touch/PortraitPagedViewHandler.java b/src/com/android/launcher3/touch/PortraitPagedViewHandler.java index 181dca56ee..dad5bb6481 100644 --- a/src/com/android/launcher3/touch/PortraitPagedViewHandler.java +++ b/src/com/android/launcher3/touch/PortraitPagedViewHandler.java @@ -52,9 +52,9 @@ import com.android.launcher3.R; import com.android.launcher3.Utilities; import com.android.launcher3.util.DisplayController; import com.android.launcher3.util.SplitConfigurationOptions; +import com.android.launcher3.util.SplitConfigurationOptions.SplitBounds; import com.android.launcher3.util.SplitConfigurationOptions.SplitPositionOption; import com.android.launcher3.util.SplitConfigurationOptions.StagePosition; -import com.android.launcher3.util.SplitConfigurationOptions.SplitBounds; import com.android.launcher3.views.BaseDragLayer; import java.util.List; @@ -756,4 +756,36 @@ public class PortraitPagedViewHandler implements PagedOrientationHandler { return new Pair<>(secondary, primary); } } + + @Override + public float getFloatingTaskOffscreenTranslationTarget(View floatingTask, RectF onScreenRect, + @StagePosition int stagePosition, DeviceProfile dp) { + if (dp.isLandscape) { + float currentTranslationX = floatingTask.getTranslationX(); + return stagePosition == STAGE_POSITION_TOP_OR_LEFT + ? currentTranslationX - onScreenRect.width() + : currentTranslationX + onScreenRect.width(); + } else { + float currentTranslationY = floatingTask.getTranslationY(); + return currentTranslationY - onScreenRect.height(); + } + } + + @Override + public void setFloatingTaskPrimaryTranslation(View floatingTask, float translation, + DeviceProfile dp) { + if (dp.isLandscape) { + floatingTask.setTranslationX(translation); + } else { + floatingTask.setTranslationY(translation); + } + + } + + @Override + public Float getFloatingTaskPrimaryTranslation(View floatingTask, DeviceProfile dp) { + return dp.isLandscape + ? floatingTask.getTranslationX() + : floatingTask.getTranslationY(); + } } From d5e7ad4ae9b9192c62dc19e6703cc36314f2b0a2 Mon Sep 17 00:00:00 2001 From: Pat Manning Date: Fri, 22 Jul 2022 14:11:24 +0100 Subject: [PATCH 2/4] Set overview progress on fling to 1 only if going to overview state. Test: manual Bug: 202826469 Change-Id: I328577653d26c74de7d82149b2a393674a09561a --- .../src/com/android/quickstep/views/RecentsView.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index dc886f6151..5041f6945a 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -2170,7 +2170,8 @@ public abstract class RecentsView Date: Fri, 15 Jul 2022 14:40:38 -0700 Subject: [PATCH 3/4] Update calculation method for Overview UI placement on tablets This update slightly changes the calculation method for Overview UI placement, in order to line up better with spec. (The previous calculation caused a small 30dp divergence on tablets.) Bug: 236760307 Test: Manual by measuring pixels and comparing to spec Change-Id: I94e9e7b5a6a24c37693425ac8ec71cd066003658 --- quickstep/res/values-sw600dp/dimens.xml | 11 +++++++++-- quickstep/res/values-sw720dp/dimens.xml | 13 +++++++++++-- quickstep/res/values/dimens.xml | 19 ++++++++++++------- .../com/android/quickstep/views/TaskView.java | 7 +++---- .../DeviceProfilePhone3ButtonTest.kt | 9 ++------- .../quickstep/DeviceProfilePhoneTest.kt | 9 ++------- ...DeviceProfileTabletLandscape3ButtonTest.kt | 9 ++------- .../DeviceProfileTabletLandscapeTest.kt | 9 ++------- .../DeviceProfileTabletPortrait3ButtonTest.kt | 9 ++------- .../DeviceProfileTabletPortraitTest.kt | 9 ++------- ...viceProfileTwoPanelLandscape3ButtonTest.kt | 9 ++------- .../DeviceProfileTwoPanelLandscapeTest.kt | 9 ++------- ...eviceProfileTwoPanelPortrait3ButtonTest.kt | 9 ++------- .../DeviceProfileTwoPanelPortraitTest.kt | 9 ++------- .../DeviceProfileVerticalBar3ButtonTest.kt | 9 ++------- .../quickstep/DeviceProfileVerticalBarTest.kt | 9 ++------- res/values/dimens.xml | 1 - src/com/android/launcher3/DeviceProfile.java | 13 ++----------- .../touch/LandscapePagedViewHandler.java | 1 + .../touch/PortraitPagedViewHandler.java | 5 +++-- .../touch/SeascapePagedViewHandler.java | 1 + 21 files changed, 66 insertions(+), 113 deletions(-) diff --git a/quickstep/res/values-sw600dp/dimens.xml b/quickstep/res/values-sw600dp/dimens.xml index 7494683880..cfbbf8dbf3 100644 --- a/quickstep/res/values-sw600dp/dimens.xml +++ b/quickstep/res/values-sw600dp/dimens.xml @@ -14,16 +14,23 @@ * limitations under the License. */ --> + 25dp - + + 48dp + 44dp + 12dp + 44dp - 12dp + 28dp + 36dp + 64dp diff --git a/quickstep/res/values-sw720dp/dimens.xml b/quickstep/res/values-sw720dp/dimens.xml index ceaa8f866b..284ce11582 100644 --- a/quickstep/res/values-sw720dp/dimens.xml +++ b/quickstep/res/values-sw720dp/dimens.xml @@ -14,14 +14,23 @@ * limitations under the License. */ --> + - + + + 0.7 + 48dp + 44dp + 16dp + 44dp - 16dp + 36dp + 44dp + 64dp diff --git a/quickstep/res/values/dimens.xml b/quickstep/res/values/dimens.xml index 0232f8652c..35215e1ad7 100644 --- a/quickstep/res/values/dimens.xml +++ b/quickstep/res/values/dimens.xml @@ -31,14 +31,19 @@ 50dp - - 48dp - 44dp - 16dp - 16dp - 72dp - + + 0.7 + + 48dp + + 44dp + + 16dp + + 16dp + + 72dp 1.1 diff --git a/quickstep/src/com/android/quickstep/views/TaskView.java b/quickstep/src/com/android/quickstep/views/TaskView.java index 5602d8889c..d52faada7c 100644 --- a/quickstep/src/com/android/quickstep/views/TaskView.java +++ b/quickstep/src/com/android/quickstep/views/TaskView.java @@ -866,10 +866,9 @@ public class TaskView extends FrameLayout implements Reusable { int thumbnailTopMargin = deviceProfile.overviewTaskThumbnailTopMarginPx; int taskIconHeight = deviceProfile.overviewTaskIconSizePx; - int taskMargin = isGridTask ? deviceProfile.overviewTaskMarginGridPx - : deviceProfile.overviewTaskMarginPx; - int taskIconMargin = thumbnailTopMargin - taskIconHeight - taskMargin; - orientationHandler.setTaskIconParams(iconParams, taskIconMargin, taskIconHeight, + int taskMargin = deviceProfile.overviewTaskMarginPx; + + orientationHandler.setTaskIconParams(iconParams, taskMargin, taskIconHeight, thumbnailTopMargin, isRtl); iconParams.width = iconParams.height = taskIconHeight; mIconView.setLayoutParams(iconParams); diff --git a/quickstep/tests/src/com/android/quickstep/DeviceProfilePhone3ButtonTest.kt b/quickstep/tests/src/com/android/quickstep/DeviceProfilePhone3ButtonTest.kt index 3daf81d8a6..f41de7213c 100644 --- a/quickstep/tests/src/com/android/quickstep/DeviceProfilePhone3ButtonTest.kt +++ b/quickstep/tests/src/com/android/quickstep/DeviceProfilePhone3ButtonTest.kt @@ -339,11 +339,6 @@ class DeviceProfilePhone3ButtonTest : DeviceProfileBaseTest() { assertThat(dp.overviewTaskMarginPx).isEqualTo(56) } - @Test - fun overviewTaskMarginGridPx() { - assertThat(dp.overviewTaskMarginGridPx).isEqualTo(0) - } - @Test fun overviewTaskIconSizePx() { assertThat(dp.overviewTaskIconSizePx).isEqualTo(168) @@ -361,7 +356,7 @@ class DeviceProfilePhone3ButtonTest : DeviceProfileBaseTest() { @Test fun overviewTaskThumbnailTopMarginPx() { - assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(280) + assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(224) } @Test @@ -386,7 +381,7 @@ class DeviceProfilePhone3ButtonTest : DeviceProfileBaseTest() { @Test fun overviewRowSpacing() { - assertThat(dp.overviewRowSpacing).isEqualTo(-112) + assertThat(dp.overviewRowSpacing).isEqualTo(0) } @Test diff --git a/quickstep/tests/src/com/android/quickstep/DeviceProfilePhoneTest.kt b/quickstep/tests/src/com/android/quickstep/DeviceProfilePhoneTest.kt index e588c71277..fe3fd00623 100644 --- a/quickstep/tests/src/com/android/quickstep/DeviceProfilePhoneTest.kt +++ b/quickstep/tests/src/com/android/quickstep/DeviceProfilePhoneTest.kt @@ -339,11 +339,6 @@ class DeviceProfilePhoneTest : DeviceProfileBaseTest() { assertThat(dp.overviewTaskMarginPx).isEqualTo(56) } - @Test - fun overviewTaskMarginGridPx() { - assertThat(dp.overviewTaskMarginGridPx).isEqualTo(0) - } - @Test fun overviewTaskIconSizePx() { assertThat(dp.overviewTaskIconSizePx).isEqualTo(168) @@ -361,7 +356,7 @@ class DeviceProfilePhoneTest : DeviceProfileBaseTest() { @Test fun overviewTaskThumbnailTopMarginPx() { - assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(280) + assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(224) } @Test @@ -386,7 +381,7 @@ class DeviceProfilePhoneTest : DeviceProfileBaseTest() { @Test fun overviewRowSpacing() { - assertThat(dp.overviewRowSpacing).isEqualTo(-112) + assertThat(dp.overviewRowSpacing).isEqualTo(0) } @Test diff --git a/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletLandscape3ButtonTest.kt b/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletLandscape3ButtonTest.kt index d0c9346e5a..33866f09f2 100644 --- a/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletLandscape3ButtonTest.kt +++ b/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletLandscape3ButtonTest.kt @@ -339,11 +339,6 @@ class DeviceProfileTabletLandscape3ButtonTest : DeviceProfileBaseTest() { assertThat(dp.overviewTaskMarginPx).isEqualTo(32) } - @Test - fun overviewTaskMarginGridPx() { - assertThat(dp.overviewTaskMarginGridPx).isEqualTo(32) - } - @Test fun overviewTaskIconSizePx() { assertThat(dp.overviewTaskIconSizePx).isEqualTo(96) @@ -361,7 +356,7 @@ class DeviceProfileTabletLandscape3ButtonTest : DeviceProfileBaseTest() { @Test fun overviewTaskThumbnailTopMarginPx() { - assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(160) + assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(128) } @Test @@ -386,7 +381,7 @@ class DeviceProfileTabletLandscape3ButtonTest : DeviceProfileBaseTest() { @Test fun overviewRowSpacing() { - assertThat(dp.overviewRowSpacing).isEqualTo(40) + assertThat(dp.overviewRowSpacing).isEqualTo(72) } @Test diff --git a/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletLandscapeTest.kt b/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletLandscapeTest.kt index 456ed2cfc0..e61a8900cb 100644 --- a/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletLandscapeTest.kt +++ b/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletLandscapeTest.kt @@ -339,11 +339,6 @@ class DeviceProfileTabletLandscapeTest : DeviceProfileBaseTest() { assertThat(dp.overviewTaskMarginPx).isEqualTo(32) } - @Test - fun overviewTaskMarginGridPx() { - assertThat(dp.overviewTaskMarginGridPx).isEqualTo(32) - } - @Test fun overviewTaskIconSizePx() { assertThat(dp.overviewTaskIconSizePx).isEqualTo(96) @@ -361,7 +356,7 @@ class DeviceProfileTabletLandscapeTest : DeviceProfileBaseTest() { @Test fun overviewTaskThumbnailTopMarginPx() { - assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(160) + assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(128) } @Test @@ -386,7 +381,7 @@ class DeviceProfileTabletLandscapeTest : DeviceProfileBaseTest() { @Test fun overviewRowSpacing() { - assertThat(dp.overviewRowSpacing).isEqualTo(40) + assertThat(dp.overviewRowSpacing).isEqualTo(72) } @Test diff --git a/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletPortrait3ButtonTest.kt b/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletPortrait3ButtonTest.kt index eed359896f..3f350debd8 100644 --- a/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletPortrait3ButtonTest.kt +++ b/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletPortrait3ButtonTest.kt @@ -339,11 +339,6 @@ class DeviceProfileTabletPortrait3ButtonTest : DeviceProfileBaseTest() { assertThat(dp.overviewTaskMarginPx).isEqualTo(32) } - @Test - fun overviewTaskMarginGridPx() { - assertThat(dp.overviewTaskMarginGridPx).isEqualTo(32) - } - @Test fun overviewTaskIconSizePx() { assertThat(dp.overviewTaskIconSizePx).isEqualTo(96) @@ -361,7 +356,7 @@ class DeviceProfileTabletPortrait3ButtonTest : DeviceProfileBaseTest() { @Test fun overviewTaskThumbnailTopMarginPx() { - assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(160) + assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(128) } @Test @@ -386,7 +381,7 @@ class DeviceProfileTabletPortrait3ButtonTest : DeviceProfileBaseTest() { @Test fun overviewRowSpacing() { - assertThat(dp.overviewRowSpacing).isEqualTo(40) + assertThat(dp.overviewRowSpacing).isEqualTo(72) } @Test diff --git a/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletPortraitTest.kt b/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletPortraitTest.kt index 4be3e45dce..444f7ea063 100644 --- a/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletPortraitTest.kt +++ b/quickstep/tests/src/com/android/quickstep/DeviceProfileTabletPortraitTest.kt @@ -339,11 +339,6 @@ class DeviceProfileTabletPortraitTest : DeviceProfileBaseTest() { assertThat(dp.overviewTaskMarginPx).isEqualTo(32) } - @Test - fun overviewTaskMarginGridPx() { - assertThat(dp.overviewTaskMarginGridPx).isEqualTo(32) - } - @Test fun overviewTaskIconSizePx() { assertThat(dp.overviewTaskIconSizePx).isEqualTo(96) @@ -361,7 +356,7 @@ class DeviceProfileTabletPortraitTest : DeviceProfileBaseTest() { @Test fun overviewTaskThumbnailTopMarginPx() { - assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(160) + assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(128) } @Test @@ -386,7 +381,7 @@ class DeviceProfileTabletPortraitTest : DeviceProfileBaseTest() { @Test fun overviewRowSpacing() { - assertThat(dp.overviewRowSpacing).isEqualTo(40) + assertThat(dp.overviewRowSpacing).isEqualTo(72) } @Test diff --git a/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelLandscape3ButtonTest.kt b/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelLandscape3ButtonTest.kt index 6728540f71..92ab2b1616 100644 --- a/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelLandscape3ButtonTest.kt +++ b/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelLandscape3ButtonTest.kt @@ -339,11 +339,6 @@ class DeviceProfileTwoPanelLandscape3ButtonTest : DeviceProfileBaseTest() { assertThat(dp.overviewTaskMarginPx).isEqualTo(32) } - @Test - fun overviewTaskMarginGridPx() { - assertThat(dp.overviewTaskMarginGridPx).isEqualTo(32) - } - @Test fun overviewTaskIconSizePx() { assertThat(dp.overviewTaskIconSizePx).isEqualTo(96) @@ -361,7 +356,7 @@ class DeviceProfileTwoPanelLandscape3ButtonTest : DeviceProfileBaseTest() { @Test fun overviewTaskThumbnailTopMarginPx() { - assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(160) + assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(128) } @Test @@ -386,7 +381,7 @@ class DeviceProfileTwoPanelLandscape3ButtonTest : DeviceProfileBaseTest() { @Test fun overviewRowSpacing() { - assertThat(dp.overviewRowSpacing).isEqualTo(40) + assertThat(dp.overviewRowSpacing).isEqualTo(72) } @Test diff --git a/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelLandscapeTest.kt b/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelLandscapeTest.kt index ba3ef55e3c..6c730ca082 100644 --- a/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelLandscapeTest.kt +++ b/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelLandscapeTest.kt @@ -339,11 +339,6 @@ class DeviceProfileTwoPanelLandscapeTest : DeviceProfileBaseTest() { assertThat(dp.overviewTaskMarginPx).isEqualTo(32) } - @Test - fun overviewTaskMarginGridPx() { - assertThat(dp.overviewTaskMarginGridPx).isEqualTo(32) - } - @Test fun overviewTaskIconSizePx() { assertThat(dp.overviewTaskIconSizePx).isEqualTo(96) @@ -361,7 +356,7 @@ class DeviceProfileTwoPanelLandscapeTest : DeviceProfileBaseTest() { @Test fun overviewTaskThumbnailTopMarginPx() { - assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(160) + assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(128) } @Test @@ -386,7 +381,7 @@ class DeviceProfileTwoPanelLandscapeTest : DeviceProfileBaseTest() { @Test fun overviewRowSpacing() { - assertThat(dp.overviewRowSpacing).isEqualTo(40) + assertThat(dp.overviewRowSpacing).isEqualTo(72) } @Test diff --git a/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelPortrait3ButtonTest.kt b/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelPortrait3ButtonTest.kt index a4b446aea1..9048b3b920 100644 --- a/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelPortrait3ButtonTest.kt +++ b/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelPortrait3ButtonTest.kt @@ -339,11 +339,6 @@ class DeviceProfileTwoPanelPortrait3ButtonTest : DeviceProfileBaseTest() { assertThat(dp.overviewTaskMarginPx).isEqualTo(32) } - @Test - fun overviewTaskMarginGridPx() { - assertThat(dp.overviewTaskMarginGridPx).isEqualTo(32) - } - @Test fun overviewTaskIconSizePx() { assertThat(dp.overviewTaskIconSizePx).isEqualTo(96) @@ -361,7 +356,7 @@ class DeviceProfileTwoPanelPortrait3ButtonTest : DeviceProfileBaseTest() { @Test fun overviewTaskThumbnailTopMarginPx() { - assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(160) + assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(128) } @Test @@ -386,7 +381,7 @@ class DeviceProfileTwoPanelPortrait3ButtonTest : DeviceProfileBaseTest() { @Test fun overviewRowSpacing() { - assertThat(dp.overviewRowSpacing).isEqualTo(40) + assertThat(dp.overviewRowSpacing).isEqualTo(72) } @Test diff --git a/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelPortraitTest.kt b/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelPortraitTest.kt index 0c5968e1ef..b737c3adb1 100644 --- a/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelPortraitTest.kt +++ b/quickstep/tests/src/com/android/quickstep/DeviceProfileTwoPanelPortraitTest.kt @@ -339,11 +339,6 @@ class DeviceProfileTwoPanelPortraitTest : DeviceProfileBaseTest() { assertThat(dp.overviewTaskMarginPx).isEqualTo(32) } - @Test - fun overviewTaskMarginGridPx() { - assertThat(dp.overviewTaskMarginGridPx).isEqualTo(32) - } - @Test fun overviewTaskIconSizePx() { assertThat(dp.overviewTaskIconSizePx).isEqualTo(96) @@ -361,7 +356,7 @@ class DeviceProfileTwoPanelPortraitTest : DeviceProfileBaseTest() { @Test fun overviewTaskThumbnailTopMarginPx() { - assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(160) + assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(128) } @Test @@ -386,7 +381,7 @@ class DeviceProfileTwoPanelPortraitTest : DeviceProfileBaseTest() { @Test fun overviewRowSpacing() { - assertThat(dp.overviewRowSpacing).isEqualTo(40) + assertThat(dp.overviewRowSpacing).isEqualTo(72) } @Test diff --git a/quickstep/tests/src/com/android/quickstep/DeviceProfileVerticalBar3ButtonTest.kt b/quickstep/tests/src/com/android/quickstep/DeviceProfileVerticalBar3ButtonTest.kt index 2bad6bb20b..d90f56b416 100644 --- a/quickstep/tests/src/com/android/quickstep/DeviceProfileVerticalBar3ButtonTest.kt +++ b/quickstep/tests/src/com/android/quickstep/DeviceProfileVerticalBar3ButtonTest.kt @@ -339,11 +339,6 @@ class DeviceProfileVerticalBar3ButtonTest : DeviceProfileBaseTest() { assertThat(dp.overviewTaskMarginPx).isEqualTo(56) } - @Test - fun overviewTaskMarginGridPx() { - assertThat(dp.overviewTaskMarginGridPx).isEqualTo(0) - } - @Test fun overviewTaskIconSizePx() { assertThat(dp.overviewTaskIconSizePx).isEqualTo(168) @@ -361,7 +356,7 @@ class DeviceProfileVerticalBar3ButtonTest : DeviceProfileBaseTest() { @Test fun overviewTaskThumbnailTopMarginPx() { - assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(280) + assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(224) } @Test @@ -386,7 +381,7 @@ class DeviceProfileVerticalBar3ButtonTest : DeviceProfileBaseTest() { @Test fun overviewRowSpacing() { - assertThat(dp.overviewRowSpacing).isEqualTo(-112) + assertThat(dp.overviewRowSpacing).isEqualTo(0) } @Test diff --git a/quickstep/tests/src/com/android/quickstep/DeviceProfileVerticalBarTest.kt b/quickstep/tests/src/com/android/quickstep/DeviceProfileVerticalBarTest.kt index 6256a43f75..522a65074e 100644 --- a/quickstep/tests/src/com/android/quickstep/DeviceProfileVerticalBarTest.kt +++ b/quickstep/tests/src/com/android/quickstep/DeviceProfileVerticalBarTest.kt @@ -339,11 +339,6 @@ class DeviceProfileVerticalBarTest : DeviceProfileBaseTest() { assertThat(dp.overviewTaskMarginPx).isEqualTo(56) } - @Test - fun overviewTaskMarginGridPx() { - assertThat(dp.overviewTaskMarginGridPx).isEqualTo(0) - } - @Test fun overviewTaskIconSizePx() { assertThat(dp.overviewTaskIconSizePx).isEqualTo(168) @@ -361,7 +356,7 @@ class DeviceProfileVerticalBarTest : DeviceProfileBaseTest() { @Test fun overviewTaskThumbnailTopMarginPx() { - assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(280) + assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(224) } @Test @@ -386,7 +381,7 @@ class DeviceProfileVerticalBarTest : DeviceProfileBaseTest() { @Test fun overviewRowSpacing() { - assertThat(dp.overviewRowSpacing).isEqualTo(-112) + assertThat(dp.overviewRowSpacing).isEqualTo(0) } @Test diff --git a/res/values/dimens.xml b/res/values/dimens.xml index b19e73920b..29bc170e5d 100644 --- a/res/values/dimens.xml +++ b/res/values/dimens.xml @@ -381,7 +381,6 @@ 0dp 0dp 0dp - 0dp 0dp 0dp 0dp diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java index 3a2227afe4..3611b8a180 100644 --- a/src/com/android/launcher3/DeviceProfile.java +++ b/src/com/android/launcher3/DeviceProfile.java @@ -191,7 +191,6 @@ public class DeviceProfile { // Overview public int overviewTaskMarginPx; - public int overviewTaskMarginGridPx; public int overviewTaskIconSizePx; public int overviewTaskIconDrawableSizePx; public int overviewTaskIconDrawableSizeGridPx; @@ -426,25 +425,18 @@ public class DeviceProfile { } overviewTaskMarginPx = res.getDimensionPixelSize(R.dimen.overview_task_margin); - overviewTaskMarginGridPx = res.getDimensionPixelSize(R.dimen.overview_task_margin_grid); overviewTaskIconSizePx = res.getDimensionPixelSize(R.dimen.task_thumbnail_icon_size); overviewTaskIconDrawableSizePx = res.getDimensionPixelSize(R.dimen.task_thumbnail_icon_drawable_size); overviewTaskIconDrawableSizeGridPx = res.getDimensionPixelSize(R.dimen.task_thumbnail_icon_drawable_size_grid); - overviewTaskThumbnailTopMarginPx = overviewTaskIconSizePx + overviewTaskMarginPx * 2; + overviewTaskThumbnailTopMarginPx = overviewTaskIconSizePx + overviewTaskMarginPx; overviewActionsTopMarginPx = res.getDimensionPixelSize(R.dimen.overview_actions_top_margin); overviewPageSpacing = res.getDimensionPixelSize(R.dimen.overview_page_spacing); overviewActionsButtonSpacing = res.getDimensionPixelSize( R.dimen.overview_actions_button_spacing); overviewActionsHeight = res.getDimensionPixelSize(R.dimen.overview_actions_height); - // Grid task's top margin is only overviewTaskIconSizePx + overviewTaskMarginGridPx, but - // overviewTaskThumbnailTopMarginPx is applied to all TaskThumbnailView, so exclude the - // extra margin when calculating row spacing. - int extraTopMargin = overviewTaskThumbnailTopMarginPx - overviewTaskIconSizePx - - overviewTaskMarginGridPx; - overviewRowSpacing = res.getDimensionPixelSize(R.dimen.overview_grid_row_spacing) - - extraTopMargin; + overviewRowSpacing = res.getDimensionPixelSize(R.dimen.overview_grid_row_spacing); overviewGridSideMargin = res.getDimensionPixelSize(R.dimen.overview_grid_side_margin); // Calculate all of the remaining variables. @@ -1379,7 +1371,6 @@ public class DeviceProfile { writer.println(prefix + pxToDpStr("workspaceBottomPadding", workspaceBottomPadding)); writer.println(prefix + pxToDpStr("overviewTaskMarginPx", overviewTaskMarginPx)); - writer.println(prefix + pxToDpStr("overviewTaskMarginGridPx", overviewTaskMarginGridPx)); writer.println(prefix + pxToDpStr("overviewTaskIconSizePx", overviewTaskIconSizePx)); writer.println(prefix + pxToDpStr("overviewTaskIconDrawableSizePx", overviewTaskIconDrawableSizePx)); diff --git a/src/com/android/launcher3/touch/LandscapePagedViewHandler.java b/src/com/android/launcher3/touch/LandscapePagedViewHandler.java index fa4eb7036c..e3cdee4b30 100644 --- a/src/com/android/launcher3/touch/LandscapePagedViewHandler.java +++ b/src/com/android/launcher3/touch/LandscapePagedViewHandler.java @@ -523,6 +523,7 @@ public class LandscapePagedViewHandler implements PagedOrientationHandler { iconParams.rightMargin = -taskIconHeight - taskIconMargin / 2; iconParams.leftMargin = 0; iconParams.topMargin = thumbnailTopMargin / 2; + iconParams.bottomMargin = 0; } @Override diff --git a/src/com/android/launcher3/touch/PortraitPagedViewHandler.java b/src/com/android/launcher3/touch/PortraitPagedViewHandler.java index 181dca56ee..738e6b1886 100644 --- a/src/com/android/launcher3/touch/PortraitPagedViewHandler.java +++ b/src/com/android/launcher3/touch/PortraitPagedViewHandler.java @@ -52,9 +52,9 @@ import com.android.launcher3.R; import com.android.launcher3.Utilities; import com.android.launcher3.util.DisplayController; import com.android.launcher3.util.SplitConfigurationOptions; +import com.android.launcher3.util.SplitConfigurationOptions.SplitBounds; import com.android.launcher3.util.SplitConfigurationOptions.SplitPositionOption; import com.android.launcher3.util.SplitConfigurationOptions.StagePosition; -import com.android.launcher3.util.SplitConfigurationOptions.SplitBounds; import com.android.launcher3.views.BaseDragLayer; import java.util.List; @@ -658,8 +658,9 @@ public class PortraitPagedViewHandler implements PagedOrientationHandler { public void setTaskIconParams(FrameLayout.LayoutParams iconParams, int taskIconMargin, int taskIconHeight, int thumbnailTopMargin, boolean isRtl) { iconParams.gravity = TOP | CENTER_HORIZONTAL; + // Reset margins, since they may have been set on rotation iconParams.leftMargin = iconParams.rightMargin = 0; - iconParams.topMargin = taskIconMargin; + iconParams.topMargin = iconParams.bottomMargin = 0; } @Override diff --git a/src/com/android/launcher3/touch/SeascapePagedViewHandler.java b/src/com/android/launcher3/touch/SeascapePagedViewHandler.java index 339f9103a7..387e980320 100644 --- a/src/com/android/launcher3/touch/SeascapePagedViewHandler.java +++ b/src/com/android/launcher3/touch/SeascapePagedViewHandler.java @@ -216,6 +216,7 @@ public class SeascapePagedViewHandler extends LandscapePagedViewHandler { iconParams.leftMargin = -taskIconHeight - taskIconMargin / 2; iconParams.rightMargin = 0; iconParams.topMargin = thumbnailTopMargin / 2; + iconParams.bottomMargin = 0; } @Override From af95ddbadc2e4eae5438ea76de78a1175f6256c0 Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Wed, 27 Jul 2022 16:38:27 -0700 Subject: [PATCH 4/4] Fixing search behavior in Launcher3 > Showing no-result found only when there are no results > Removing unnecessary view inflation in RecyclerViewPool for various search vide types > Removing unused market-search link and no-empty-result illustration Bug: 240343082 Bug: 207573083 Test: Verified Launcher3 Change-Id: Ia44799cd2385ea5dc837ef25732ca237975abde7 --- res/drawable/ic_all_apps_bg_hand.xml | 100 --------- res/drawable/ic_all_apps_bg_icon_1.xml | 31 --- res/drawable/ic_all_apps_bg_icon_2.xml | 33 --- res/drawable/ic_all_apps_bg_icon_3.xml | 36 --- res/drawable/ic_all_apps_bg_icon_4.xml | 34 --- res/layout/all_apps_search_market.xml | 30 --- res/values/dimens.xml | 3 - res/values/strings.xml | 2 - res/values/styles.xml | 11 - .../allapps/ActivityAllAppsContainerView.java | 9 - .../allapps/AllAppsBackgroundDrawable.java | 206 ------------------ .../allapps/AllAppsRecyclerView.java | 62 ------ .../allapps/AlphabeticalAppsList.java | 21 -- .../launcher3/allapps/BaseAllAppsAdapter.java | 57 ++--- .../search/AppsSearchContainerLayout.java | 2 +- .../search/DefaultAppSearchAlgorithm.java | 19 ++ 16 files changed, 33 insertions(+), 623 deletions(-) delete mode 100644 res/drawable/ic_all_apps_bg_hand.xml delete mode 100644 res/drawable/ic_all_apps_bg_icon_1.xml delete mode 100644 res/drawable/ic_all_apps_bg_icon_2.xml delete mode 100644 res/drawable/ic_all_apps_bg_icon_3.xml delete mode 100644 res/drawable/ic_all_apps_bg_icon_4.xml delete mode 100644 res/layout/all_apps_search_market.xml delete mode 100644 src/com/android/launcher3/allapps/AllAppsBackgroundDrawable.java diff --git a/res/drawable/ic_all_apps_bg_hand.xml b/res/drawable/ic_all_apps_bg_hand.xml deleted file mode 100644 index 7f3fe14fb1..0000000000 --- a/res/drawable/ic_all_apps_bg_hand.xml +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/res/drawable/ic_all_apps_bg_icon_1.xml b/res/drawable/ic_all_apps_bg_icon_1.xml deleted file mode 100644 index d226ac6000..0000000000 --- a/res/drawable/ic_all_apps_bg_icon_1.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/res/drawable/ic_all_apps_bg_icon_2.xml b/res/drawable/ic_all_apps_bg_icon_2.xml deleted file mode 100644 index 5966d9969f..0000000000 --- a/res/drawable/ic_all_apps_bg_icon_2.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/res/drawable/ic_all_apps_bg_icon_3.xml b/res/drawable/ic_all_apps_bg_icon_3.xml deleted file mode 100644 index b18f8bc473..0000000000 --- a/res/drawable/ic_all_apps_bg_icon_3.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - diff --git a/res/drawable/ic_all_apps_bg_icon_4.xml b/res/drawable/ic_all_apps_bg_icon_4.xml deleted file mode 100644 index 8eb4d90126..0000000000 --- a/res/drawable/ic_all_apps_bg_icon_4.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/res/layout/all_apps_search_market.xml b/res/layout/all_apps_search_market.xml deleted file mode 100644 index 6f2dd3d21e..0000000000 --- a/res/layout/all_apps_search_market.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - diff --git a/res/values/dimens.xml b/res/values/dimens.xml index b19e73920b..5bb753e694 100644 --- a/res/values/dimens.xml +++ b/res/values/dimens.xml @@ -108,9 +108,6 @@ 24dp 30dp 40dp - 144dp - 700dp - 475dp 48dp 12dp 48dp diff --git a/res/values/strings.xml b/res/values/strings.xml index 2addf5034e..3eb08bada1 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -128,8 +128,6 @@ Loading apps… No apps found matching \"%1$s\" - - Search for more apps App diff --git a/res/values/styles.xml b/res/values/styles.xml index a8cbf08ca1..90553a160e 100644 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -292,17 +292,6 @@ - -