diff --git a/quickstep/src/com/android/launcher3/uioverrides/RecentsViewStateController.java b/quickstep/src/com/android/launcher3/uioverrides/RecentsViewStateController.java index 5cddd07340..420c64ad9e 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/RecentsViewStateController.java +++ b/quickstep/src/com/android/launcher3/uioverrides/RecentsViewStateController.java @@ -33,7 +33,6 @@ import android.util.FloatProperty; import android.util.Pair; import androidx.annotation.NonNull; -import androidx.annotation.Nullable; import com.android.launcher3.LauncherState; import com.android.launcher3.anim.AnimatorListeners; @@ -71,7 +70,10 @@ public final class RecentsViewStateController extends // DepthController to prevent optimizations which might occlude the layers behind mLauncher.getDepthController().setHasContentBehindLauncher(state.overviewUi); - handleSplitSelectionState(state, null); + PendingAnimation builder = + new PendingAnimation(state.getTransitionDuration(mLauncher, true)); + + handleSplitSelectionState(state, builder, /* animate */false); } @Override @@ -92,7 +94,7 @@ public final class RecentsViewStateController extends builder.addListener(AnimatorListeners.forSuccessCallback(() -> mLauncher.getDepthController().setHasContentBehindLauncher(toState.overviewUi))); - handleSplitSelectionState(toState, builder); + handleSplitSelectionState(toState, builder, /* animate */true); setAlphas(builder, config, toState); builder.setFloat(mRecentsView, FULLSCREEN_PROGRESS, @@ -105,8 +107,7 @@ public final class RecentsViewStateController extends * will add animations to builder. */ private void handleSplitSelectionState(@NonNull LauncherState toState, - @Nullable PendingAnimation builder) { - boolean animate = builder != null; + @NonNull PendingAnimation builder, boolean animate) { PagedOrientationHandler orientationHandler = ((RecentsView) mLauncher.getOverviewPanel()).getPagedOrientationHandler(); Pair taskViewsFloat = @@ -115,18 +116,15 @@ public final class RecentsViewStateController extends mLauncher.getDeviceProfile()); if (toState == OVERVIEW_SPLIT_SELECT) { - // Animation to "dismiss" selected taskView - PendingAnimation splitSelectInitAnimation = mRecentsView.createSplitSelectInitAnimation( + mRecentsView.createSplitSelectInitAnimation(builder, toState.getTransitionDuration(mLauncher, true /* isToState */)); // Add properties to shift remaining taskViews to get out of placeholder view - splitSelectInitAnimation.setFloat(mRecentsView, taskViewsFloat.first, + builder.setFloat(mRecentsView, taskViewsFloat.first, toState.getSplitSelectTranslation(mLauncher), LINEAR); - splitSelectInitAnimation.setFloat(mRecentsView, taskViewsFloat.second, 0, LINEAR); + builder.setFloat(mRecentsView, taskViewsFloat.second, 0, LINEAR); if (!animate) { - splitSelectInitAnimation.buildAnim().start(); - } else { - builder.add(splitSelectInitAnimation.buildAnim()); + builder.buildAnim().start(); } mRecentsView.applySplitPrimaryScrollOffset(); diff --git a/quickstep/src/com/android/launcher3/uioverrides/states/QuickstepAtomicAnimationFactory.java b/quickstep/src/com/android/launcher3/uioverrides/states/QuickstepAtomicAnimationFactory.java index 872e64a510..f5161aa25f 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/states/QuickstepAtomicAnimationFactory.java +++ b/quickstep/src/com/android/launcher3/uioverrides/states/QuickstepAtomicAnimationFactory.java @@ -79,6 +79,14 @@ public class QuickstepAtomicAnimationFactory extends private static final int PER_PAGE_SCROLL_DURATION = 150; private static final int MAX_PAGE_SCROLL_DURATION = 750; + private static final int OVERVIEW_TO_SPLIT_ACTIONS_FADE_START = 0; + private static final int OVERVIEW_TO_SPLIT_ACTIONS_FADE_END = 83; + + private static final float OVERVIEW_TO_SPLIT_ACTIONS_FADE_START_OFFSET = + (float) OVERVIEW_TO_SPLIT_ACTIONS_FADE_START / SplitScreenSelectState.ENTER_DURATION; + private static final float OVERVIEW_TO_SPLIT_ACTIONS_FADE_END_OFFSET = + (float) OVERVIEW_TO_SPLIT_ACTIONS_FADE_END / SplitScreenSelectState.ENTER_DURATION; + // Due to use of physics, duration may differ between devices so we need to calculate and // cache the value. private int mHintToNormalDuration = -1; @@ -188,6 +196,10 @@ public class QuickstepAtomicAnimationFactory extends AllAppsSwipeController.applyAllAppsToNormalConfig(mActivity, config); } else if (fromState == NORMAL && toState == ALL_APPS) { AllAppsSwipeController.applyNormalToAllAppsAnimConfig(mActivity, config); + } else if (fromState == OVERVIEW && toState == OVERVIEW_SPLIT_SELECT) { + config.setInterpolator(ANIM_OVERVIEW_ACTIONS_FADE, clampToProgress(LINEAR, + OVERVIEW_TO_SPLIT_ACTIONS_FADE_START_OFFSET, + OVERVIEW_TO_SPLIT_ACTIONS_FADE_END_OFFSET)); } } } diff --git a/quickstep/src/com/android/launcher3/uioverrides/states/SplitScreenSelectState.java b/quickstep/src/com/android/launcher3/uioverrides/states/SplitScreenSelectState.java index e79d56b631..2bc3c3e959 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/states/SplitScreenSelectState.java +++ b/quickstep/src/com/android/launcher3/uioverrides/states/SplitScreenSelectState.java @@ -16,6 +16,8 @@ package com.android.launcher3.uioverrides.states; +import android.content.Context; + import com.android.launcher3.Launcher; import com.android.quickstep.views.RecentsView; @@ -24,6 +26,10 @@ import com.android.quickstep.views.RecentsView; * pinned and user is selecting the second one */ public class SplitScreenSelectState extends OverviewState { + public static final int ENTER_DURATION = 866; + public static final int EXIT_DURATION = 500; + // TODO: Add ability to differentiate between Split > Home and Split > Confirmed timings + public SplitScreenSelectState(int id) { super(id); } @@ -38,4 +44,9 @@ public class SplitScreenSelectState extends OverviewState { RecentsView recentsView = launcher.getOverviewPanel(); return recentsView.getSplitSelectTranslation(); } + + @Override + public int getTransitionDuration(Context context, boolean isToState) { + return isToState ? ENTER_DURATION : EXIT_DURATION; + } } diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewTouchController.java index ca7f633bbc..c49848a5b4 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewTouchController.java +++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewTouchController.java @@ -236,7 +236,8 @@ public abstract class TaskViewTouchController PendingAnimation pa; if (goingUp) { currentInterpolator = Interpolators.LINEAR; - pa = mRecentsView.createTaskDismissAnimation(mTaskBeingDragged, + pa = new PendingAnimation(maxDuration); + mRecentsView.createTaskDismissAnimation(pa, mTaskBeingDragged, true /* animateTaskView */, true /* removeTask */, maxDuration, false /* dismissingForSplitSelection*/); diff --git a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsStateController.java b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsStateController.java index 7337132a6a..1e0ceed4cd 100644 --- a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsStateController.java +++ b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsStateController.java @@ -114,8 +114,11 @@ public class FallbackRecentsStateController implements StateHandler taskViewsFloat = diff --git a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java index 7c96bf8a78..e9819935aa 100644 --- a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java +++ b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java @@ -54,6 +54,8 @@ import java.util.ArrayList; public class FallbackRecentsView extends RecentsView implements StateListener { + private static final int TASK_DISMISS_DURATION = 150; + @Nullable private Task mHomeTask; @@ -105,8 +107,9 @@ public class FallbackRecentsView extends RecentsView setCurrentTask(-1)); AnimatorPlaybackController controller = pa.createPlaybackController(); controller.dispatchOnStart(); diff --git a/quickstep/src/com/android/quickstep/views/FloatingTaskView.java b/quickstep/src/com/android/quickstep/views/FloatingTaskView.java index c3bf041816..c211d7ad4b 100644 --- a/quickstep/src/com/android/quickstep/views/FloatingTaskView.java +++ b/quickstep/src/com/android/quickstep/views/FloatingTaskView.java @@ -2,8 +2,10 @@ package com.android.quickstep.views; import static com.android.launcher3.AbstractFloatingView.TYPE_TASK_MENU; import static com.android.launcher3.anim.Interpolators.ACCEL; -import static com.android.launcher3.anim.Interpolators.DEACCEL_3; +import static com.android.launcher3.anim.Interpolators.DEACCEL_2; +import static com.android.launcher3.anim.Interpolators.INSTANT; import static com.android.launcher3.anim.Interpolators.LINEAR; +import static com.android.launcher3.anim.Interpolators.clampToProgress; import android.animation.ValueAnimator; import android.content.Context; @@ -24,12 +26,12 @@ import androidx.annotation.Nullable; import com.android.launcher3.AbstractFloatingView; import com.android.launcher3.BaseActivity; import com.android.launcher3.InsettableFrameLayout; -import com.android.launcher3.LauncherAnimUtils; import com.android.launcher3.R; import com.android.launcher3.Utilities; import com.android.launcher3.anim.PendingAnimation; import com.android.launcher3.statemanager.StatefulActivity; import com.android.launcher3.touch.PagedOrientationHandler; +import com.android.launcher3.uioverrides.states.SplitScreenSelectState; import com.android.launcher3.util.SplitConfigurationOptions; import com.android.launcher3.views.BaseDragLayer; import com.android.quickstep.util.MultiValueUpdateListener; @@ -49,6 +51,31 @@ import com.android.systemui.shared.system.QuickStepContract; * TODO: Figure out how to copy thumbnail data from existing TaskView to this view. */ public class FloatingTaskView extends FrameLayout { + private static final int OVERVIEW_TO_SPLIT_THUMBNAIL_FADE_TO_GRAY_START = 0; + private static final int OVERVIEW_TO_SPLIT_THUMBNAIL_FADE_TO_GRAY_END = 133; + private static final int OVERVIEW_TO_SPLIT_DOCKED_ICON_FADE_IN_START = 167; + private static final int OVERVIEW_TO_SPLIT_DOCKED_ICON_FADE_IN_END = 250; + private static final int OVERVIEW_TO_SPLIT_STAGED_RECT_SLIDE_START = 0; + private static final int OVERVIEW_TO_SPLIT_STAGED_RECT_SLIDE_END = 417; + + private static final float OVERVIEW_TO_SPLIT_THUMBNAIL_FADE_TO_GRAY_START_OFFSET = + (float) OVERVIEW_TO_SPLIT_THUMBNAIL_FADE_TO_GRAY_START + / SplitScreenSelectState.ENTER_DURATION; + private static final float OVERVIEW_TO_SPLIT_THUMBNAIL_FADE_TO_GRAY_END_OFFSET = + (float) OVERVIEW_TO_SPLIT_THUMBNAIL_FADE_TO_GRAY_END + / SplitScreenSelectState.ENTER_DURATION; + private static final float OVERVIEW_TO_SPLIT_DOCKED_ICON_FADE_IN_START_OFFSET = + (float) OVERVIEW_TO_SPLIT_DOCKED_ICON_FADE_IN_START + / SplitScreenSelectState.ENTER_DURATION; + private static final float OVERVIEW_TO_SPLIT_DOCKED_ICON_FADE_IN_END_OFFSET = + (float) OVERVIEW_TO_SPLIT_DOCKED_ICON_FADE_IN_END + / SplitScreenSelectState.ENTER_DURATION; + private static final float OVERVIEW_TO_SPLIT_STAGED_RECT_SLIDE_START_OFFSET = + (float) OVERVIEW_TO_SPLIT_STAGED_RECT_SLIDE_START + / SplitScreenSelectState.ENTER_DURATION; + private static final float OVERVIEW_TO_SPLIT_STAGED_RECT_SLIDE_END_OFFSET = + (float) OVERVIEW_TO_SPLIT_STAGED_RECT_SLIDE_END + / SplitScreenSelectState.ENTER_DURATION; public static final FloatProperty PRIMARY_TRANSLATE_OFFSCREEN = new FloatProperty("floatingTaskPrimaryTranslateOffscreen") { @@ -224,26 +251,49 @@ public class FloatingTaskView extends FrameLayout { RectF floatingTaskViewBounds = new RectF(); if (fadeWithThumbnail) { - animation.addFloat(mSplitPlaceholderView, SplitPlaceholderView.ALPHA_FLOAT, - 0, 1, ACCEL); - animation.addFloat(mThumbnailView, LauncherAnimUtils.VIEW_ALPHA, - 1, 0, DEACCEL_3); + // This code block runs when animating from Overview > OverviewSplitSelect + // And for the second thumbnail on confirm + + // FloatingTaskThumbnailView: thumbnail fades out to transparent + animation.setViewAlpha(mThumbnailView, 0, clampToProgress(LINEAR, + OVERVIEW_TO_SPLIT_THUMBNAIL_FADE_TO_GRAY_START_OFFSET, + OVERVIEW_TO_SPLIT_THUMBNAIL_FADE_TO_GRAY_END_OFFSET)); + + // SplitPlaceholderView: gray background fades in at the same time, then new icon fades + // in + animation.setViewAlpha(mSplitPlaceholderView, 1, clampToProgress(LINEAR, + OVERVIEW_TO_SPLIT_THUMBNAIL_FADE_TO_GRAY_START_OFFSET, + OVERVIEW_TO_SPLIT_THUMBNAIL_FADE_TO_GRAY_END_OFFSET)); + animation.setViewAlpha(mSplitPlaceholderView.getIconView(), 1, clampToProgress( + LINEAR, OVERVIEW_TO_SPLIT_DOCKED_ICON_FADE_IN_START_OFFSET, + OVERVIEW_TO_SPLIT_DOCKED_ICON_FADE_IN_END_OFFSET)); } else if (isStagedTask) { + // This code block runs when animating from Normal > OverviewSplitSelect + // and for the first thumbnail on confirm + // Fade in the placeholder view when split is initiated from homescreen / all apps - // icons. if (mSplitPlaceholderView.getAlpha() == 0) { - animation.addFloat(mSplitPlaceholderView, SplitPlaceholderView.ALPHA_FLOAT, - 0.3f, 1, ACCEL); + animation.setViewAlpha(mSplitPlaceholderView, 0.3f, INSTANT); + animation.setViewAlpha(mSplitPlaceholderView, 1, ACCEL); } } MultiValueUpdateListener listener = new MultiValueUpdateListener() { - final FloatProp mDx = new FloatProp(0, prop.dX, 0, animDuration, LINEAR); - final FloatProp mDy = new FloatProp(0, prop.dY, 0, animDuration, LINEAR); + // SplitPlaceholderView: rectangle translates and stretches to new position + final FloatProp mDx = new FloatProp(0, prop.dX, 0, animDuration, + clampToProgress(DEACCEL_2, OVERVIEW_TO_SPLIT_STAGED_RECT_SLIDE_START_OFFSET, + OVERVIEW_TO_SPLIT_STAGED_RECT_SLIDE_END_OFFSET)); + final FloatProp mDy = new FloatProp(0, prop.dY, 0, animDuration, + clampToProgress(DEACCEL_2, OVERVIEW_TO_SPLIT_STAGED_RECT_SLIDE_START_OFFSET, + OVERVIEW_TO_SPLIT_STAGED_RECT_SLIDE_END_OFFSET)); final FloatProp mTaskViewScaleX = new FloatProp(1f, prop.finalTaskViewScaleX, 0, - animDuration, LINEAR); + animDuration, clampToProgress(DEACCEL_2, + OVERVIEW_TO_SPLIT_STAGED_RECT_SLIDE_START_OFFSET, + OVERVIEW_TO_SPLIT_STAGED_RECT_SLIDE_END_OFFSET)); final FloatProp mTaskViewScaleY = new FloatProp(1f, prop.finalTaskViewScaleY, 0, - animDuration, LINEAR); + animDuration, clampToProgress(DEACCEL_2, + OVERVIEW_TO_SPLIT_STAGED_RECT_SLIDE_START_OFFSET, + OVERVIEW_TO_SPLIT_STAGED_RECT_SLIDE_END_OFFSET)); @Override public void onUpdate(float percent, boolean initOnly) { // Calculate the icon position. diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index ef98e926aa..8da08b4007 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -35,9 +35,11 @@ import static com.android.launcher3.anim.Interpolators.ACCEL; import static com.android.launcher3.anim.Interpolators.ACCEL_0_75; import static com.android.launcher3.anim.Interpolators.ACCEL_DEACCEL; import static com.android.launcher3.anim.Interpolators.DEACCEL_2; +import static com.android.launcher3.anim.Interpolators.EMPHASIZED_DECELERATE; import static com.android.launcher3.anim.Interpolators.FAST_OUT_SLOW_IN; import static com.android.launcher3.anim.Interpolators.FINAL_FRAME; import static com.android.launcher3.anim.Interpolators.LINEAR; +import static com.android.launcher3.anim.Interpolators.OVERSHOOT_0_85; import static com.android.launcher3.anim.Interpolators.clampToProgress; import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASK_CLEAR_ALL; @@ -138,6 +140,7 @@ import com.android.launcher3.statemanager.BaseState; import com.android.launcher3.statemanager.StatefulActivity; import com.android.launcher3.touch.OverScroll; import com.android.launcher3.touch.PagedOrientationHandler; +import com.android.launcher3.uioverrides.states.SplitScreenSelectState; import com.android.launcher3.util.DynamicResource; import com.android.launcher3.util.IntArray; import com.android.launcher3.util.IntSet; @@ -414,6 +417,54 @@ public abstract class RecentsView= dismissed index and in the same row as the // dismissed index or next focused index. Offset successive task dismissal // durations for a staggered effect. - float animationStartProgress = Utilities.boundToRange( - INITIAL_DISMISS_TRANSLATION_INTERPOLATION_OFFSET - + ADDITIONAL_DISMISS_TRANSLATION_INTERPOLATION_OFFSET - * ++distanceFromDismissedTask, 0f, - dismissTranslationInterpolationEnd); + distanceFromDismissedTask++; + boolean isStagingFocusedTask = + isFocusedTaskDismissed && nextFocusedTaskView == null; + int staggerColumn = isStagingFocusedTask + ? (int) Math.ceil(distanceFromDismissedTask / 2f) + : distanceFromDismissedTask; + // Set timings based on if user is initiating splitscreen on the focused task, + // or splitting/dismissing some other task. + float animationStartProgress = isStagingFocusedTask + ? Utilities.boundToRange( + INITIAL_SPRING_DISMISS_TRANSLATION_INTERPOLATION_OFFSET + + ADDITIONAL_SPRING_DISMISS_TRANSLATION_INTERPOLATION_OFFSET + * staggerColumn, 0f, dismissTranslationInterpolationEnd) + : Utilities.boundToRange( + INITIAL_DISMISS_TRANSLATION_INTERPOLATION_OFFSET + + ADDITIONAL_DISMISS_TRANSLATION_INTERPOLATION_OFFSET + * staggerColumn, 0f, dismissTranslationInterpolationEnd); + float animationEndProgress = isStagingFocusedTask + ? Utilities.boundToRange( + INITIAL_SPRING_DISMISS_TRANSLATION_INTERPOLATION_OFFSET + + END_SPRING_DISMISS_TRANSLATION_INTERPOLATION_OFFSET + + ADDITIONAL_SPRING_DISMISS_TRANSLATION_INTERPOLATION_OFFSET + * staggerColumn, + 0f, dismissTranslationInterpolationEnd) + : dismissTranslationInterpolationEnd; + Interpolator dismissInterpolator = isStagingFocusedTask ? OVERSHOOT_0_85 : LINEAR; + if (taskView == nextFocusedTaskView) { // Enlarge the task to be focused next, and translate into focus position. float scale = mTaskWidth / (float) mLastComputedGridTaskSize.width(); @@ -3140,7 +3222,7 @@ public abstract class RecentsView ALPHA_FLOAT = - new FloatProperty("SplitInstructionsAlpha") { + public static final FloatProperty UNFOLD = + new FloatProperty("SplitInstructionsUnfold") { @Override public void setValue(SplitInstructionsView splitInstructionsView, float v) { - splitInstructionsView.setVisibility(v != 0 ? VISIBLE : GONE); - splitInstructionsView.setAlpha(v); + splitInstructionsView.setScaleY(v); } @Override public Float get(SplitInstructionsView splitInstructionsView) { - return splitInstructionsView.getAlpha(); + return splitInstructionsView.getScaleY(); } }; @@ -77,6 +78,14 @@ public class SplitInstructionsView extends FrameLayout { false ); + splitInstructionsView.mTextView = splitInstructionsView.findViewById( + R.id.split_instructions_text); + + // Since textview overlays base view, and we sometimes manipulate the alpha of each + // simultaneously, force overlapping rendering to false prevents redrawing of pixels, + // improving performance at the cost of some accuracy. + splitInstructionsView.forceHasOverlappingRendering(false); + dragLayer.addView(splitInstructionsView); return splitInstructionsView; } @@ -120,4 +129,8 @@ public class SplitInstructionsView extends FrameLayout { return 0; } } + + public AppCompatTextView getTextView() { + return mTextView; + } } diff --git a/quickstep/src/com/android/quickstep/views/SplitPlaceholderView.java b/quickstep/src/com/android/quickstep/views/SplitPlaceholderView.java index 28080d477f..08004dcf1f 100644 --- a/quickstep/src/com/android/quickstep/views/SplitPlaceholderView.java +++ b/quickstep/src/com/android/quickstep/views/SplitPlaceholderView.java @@ -22,7 +22,6 @@ import android.graphics.Paint; import android.graphics.Rect; import android.graphics.drawable.Drawable; import android.util.AttributeSet; -import android.util.FloatProperty; import android.util.TypedValue; import android.widget.FrameLayout; @@ -33,20 +32,6 @@ public class SplitPlaceholderView extends FrameLayout { private final Paint mPaint = new Paint(Paint.ANTI_ALIAS_FLAG); private final Rect mTempRect = new Rect(); - public static final FloatProperty ALPHA_FLOAT = - new FloatProperty("SplitViewAlpha") { - @Override - public void setValue(SplitPlaceholderView splitPlaceholderView, float v) { - splitPlaceholderView.setVisibility(v != 0 ? VISIBLE : GONE); - splitPlaceholderView.setAlpha(v); - } - - @Override - public Float get(SplitPlaceholderView splitPlaceholderView) { - return splitPlaceholderView.getAlpha(); - } - }; - @Nullable private IconView mIconView; diff --git a/quickstep/src/com/android/quickstep/views/TaskView.java b/quickstep/src/com/android/quickstep/views/TaskView.java index 74c74a1546..7df21d545e 100644 --- a/quickstep/src/com/android/quickstep/views/TaskView.java +++ b/quickstep/src/com/android/quickstep/views/TaskView.java @@ -323,19 +323,6 @@ public class TaskView extends FrameLayout implements Reusable { } }; - public static final FloatProperty ICON_ALPHA = - new FloatProperty("iconAlpha") { - @Override - public void setValue(TaskView taskView, float v) { - taskView.mIconView.setAlpha(v); - } - - @Override - public Float get(TaskView taskView) { - return taskView.mIconView.getAlpha(); - } - }; - @Nullable protected Task mTask; protected TaskThumbnailView mSnapshotView; diff --git a/src/com/android/launcher3/anim/Interpolators.java b/src/com/android/launcher3/anim/Interpolators.java index 12b4223bac..d900c90814 100644 --- a/src/com/android/launcher3/anim/Interpolators.java +++ b/src/com/android/launcher3/anim/Interpolators.java @@ -83,6 +83,7 @@ public class Interpolators { EXAGGERATED_EASE = new PathInterpolator(exaggeratedEase); } + public static final Interpolator OVERSHOOT_0_85 = new OvershootInterpolator(0.85f); public static final Interpolator OVERSHOOT_1_2 = new OvershootInterpolator(1.2f); public static final Interpolator OVERSHOOT_1_7 = new OvershootInterpolator(1.7f); diff --git a/src/com/android/launcher3/touch/LandscapePagedViewHandler.java b/src/com/android/launcher3/touch/LandscapePagedViewHandler.java index 89c300dd2c..9afca4f380 100644 --- a/src/com/android/launcher3/touch/LandscapePagedViewHandler.java +++ b/src/com/android/launcher3/touch/LandscapePagedViewHandler.java @@ -453,7 +453,7 @@ public class LandscapePagedViewHandler implements PagedOrientationHandler { public void setSplitInstructionsParams(View out, DeviceProfile dp, int splitInstructionsHeight, int splitInstructionsWidth, int threeButtonNavShift) { out.setPivotX(0); - out.setPivotY(0); + out.setPivotY(splitInstructionsHeight); out.setRotation(getDegreesRotated()); int distanceToEdge = out.getResources().getDimensionPixelSize( R.dimen.split_instructions_bottom_margin_phone_landscape); @@ -461,8 +461,8 @@ public class LandscapePagedViewHandler implements PagedOrientationHandler { int insetCorrectionX = dp.getInsets().left; // Center the view in case of unbalanced insets on top or bottom of screen int insetCorrectionY = (dp.getInsets().bottom - dp.getInsets().top) / 2; - out.setTranslationX(splitInstructionsHeight + distanceToEdge - insetCorrectionX); - out.setTranslationY(((splitInstructionsHeight - splitInstructionsWidth) / 2f) + out.setTranslationX(distanceToEdge - insetCorrectionX); + out.setTranslationY(((-splitInstructionsHeight - splitInstructionsWidth) / 2f) + insetCorrectionY); FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) out.getLayoutParams(); // Setting gravity to LEFT instead of the lint-recommended START because we always want this diff --git a/src/com/android/launcher3/touch/PortraitPagedViewHandler.java b/src/com/android/launcher3/touch/PortraitPagedViewHandler.java index 450205d61b..bc1b6345b4 100644 --- a/src/com/android/launcher3/touch/PortraitPagedViewHandler.java +++ b/src/com/android/launcher3/touch/PortraitPagedViewHandler.java @@ -520,7 +520,7 @@ public class PortraitPagedViewHandler implements PagedOrientationHandler { public void setSplitInstructionsParams(View out, DeviceProfile dp, int splitInstructionsHeight, int splitInstructionsWidth, int threeButtonNavShift) { out.setPivotX(0); - out.setPivotY(0); + out.setPivotY(splitInstructionsHeight); out.setRotation(getDegreesRotated()); int distanceToEdge; if ((DisplayController.getNavigationMode(out.getContext()) == THREE_BUTTONS) diff --git a/src/com/android/launcher3/touch/SeascapePagedViewHandler.java b/src/com/android/launcher3/touch/SeascapePagedViewHandler.java index 387e980320..55bb5e85e5 100644 --- a/src/com/android/launcher3/touch/SeascapePagedViewHandler.java +++ b/src/com/android/launcher3/touch/SeascapePagedViewHandler.java @@ -190,7 +190,7 @@ public class SeascapePagedViewHandler extends LandscapePagedViewHandler { public void setSplitInstructionsParams(View out, DeviceProfile dp, int splitInstructionsHeight, int splitInstructionsWidth, int threeButtonNavShift) { out.setPivotX(0); - out.setPivotY(0); + out.setPivotY(splitInstructionsHeight); out.setRotation(getDegreesRotated()); int distanceToEdge = out.getResources().getDimensionPixelSize( R.dimen.split_instructions_bottom_margin_phone_landscape); @@ -198,9 +198,8 @@ public class SeascapePagedViewHandler extends LandscapePagedViewHandler { int insetCorrectionX = dp.getInsets().right; // Center the view in case of unbalanced insets on top or bottom of screen int insetCorrectionY = (dp.getInsets().bottom - dp.getInsets().top) / 2; - out.setTranslationX(splitInstructionsWidth - splitInstructionsHeight - distanceToEdge - + insetCorrectionX); - out.setTranslationY(((splitInstructionsHeight + splitInstructionsWidth) / 2f) + out.setTranslationX(splitInstructionsWidth - distanceToEdge + insetCorrectionX); + out.setTranslationY(((-splitInstructionsHeight + splitInstructionsWidth) / 2f) + insetCorrectionY); FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) out.getLayoutParams(); // Setting gravity to RIGHT instead of the lint-recommended END because we always want this