Loading quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/touchcontrollers/PortraitOverviewStateTouchHelper.java +3 −2 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.launcher3.uioverrides.touchcontrollers; import static com.android.launcher3.uioverrides.touchcontrollers.PortraitStatesTouchController.isTouchOverHotseat; import android.view.MotionEvent; import android.view.animation.Interpolator; import com.android.launcher3.Launcher; import com.android.launcher3.util.PendingAnimation; Loading Loading @@ -74,12 +75,12 @@ public final class PortraitOverviewStateTouchHelper { * @param duration how long the animation should be * @return the animation */ PendingAnimation createSwipeDownToTaskAppAnimation(long duration) { PendingAnimation createSwipeDownToTaskAppAnimation(long duration, Interpolator interpolator) { mRecentsView.setCurrentPage(mRecentsView.getPageNearestToCenterOfScreen()); TaskView taskView = mRecentsView.getCurrentPageTaskView(); if (taskView == null) { throw new IllegalStateException("There is no task view to animate to."); } return mRecentsView.createTaskLauncherAnimation(taskView, duration); return mRecentsView.createTaskLaunchAnimation(taskView, duration, interpolator); } } quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewTouchController.java +4 −5 Original line number Diff line number Diff line Loading @@ -191,9 +191,8 @@ public abstract class TaskViewTouchController<T extends BaseDraggingActivity> mEndDisplacement = -mTaskBeingDragged.getHeight(); } else { mPendingAnimation = mRecentsView.createTaskLauncherAnimation( mTaskBeingDragged, maxDuration); mPendingAnimation.anim.setInterpolator(Interpolators.ZOOM_IN); mPendingAnimation = mRecentsView.createTaskLaunchAnimation( mTaskBeingDragged, maxDuration, Interpolators.ZOOM_IN); mTempCords[1] = mTaskBeingDragged.getHeight(); dl.getDescendantCoordRelativeToSelf(mTaskBeingDragged, mTempCords); Loading @@ -203,8 +202,8 @@ public abstract class TaskViewTouchController<T extends BaseDraggingActivity> if (mCurrentAnimation != null) { mCurrentAnimation.setOnCancelRunnable(null); } mCurrentAnimation = AnimatorPlaybackController .wrap(mPendingAnimation.anim, maxDuration, this::clearState); mCurrentAnimation = AnimatorPlaybackController.wrap( mPendingAnimation.anim, maxDuration, this::clearState); onUserControlledAnimationCreated(mCurrentAnimation); mCurrentAnimation.getTarget().addListener(this); mCurrentAnimation.dispatchOnStart(); Loading quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java +4 −3 Original line number Diff line number Diff line Loading @@ -76,6 +76,7 @@ import android.view.ViewDebug; import android.view.ViewGroup; import android.view.accessibility.AccessibilityEvent; import android.view.accessibility.AccessibilityNodeInfo; import android.view.animation.Interpolator; import android.widget.ListView; import androidx.annotation.Nullable; Loading Loading @@ -1599,7 +1600,8 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl return anim; } public PendingAnimation createTaskLauncherAnimation(TaskView tv, long duration) { public PendingAnimation createTaskLaunchAnimation( TaskView tv, long duration, Interpolator interpolator) { if (FeatureFlags.IS_STUDIO_BUILD && mPendingAnimation != null) { throw new IllegalStateException("Another pending animation is still running"); } Loading @@ -1612,7 +1614,6 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl int targetSysUiFlags = tv.getThumbnail().getSysUiStatusNavFlags(); final boolean[] passedOverviewThreshold = new boolean[] {false}; ValueAnimator progressAnim = ValueAnimator.ofFloat(0, 1); progressAnim.setInterpolator(LINEAR); progressAnim.addUpdateListener(animator -> { // Once we pass a certain threshold, update the sysui flags to match the target // tasks' flags Loading @@ -1638,7 +1639,7 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl appWindowAnimationHelper.prepareAnimation(mActivity.getDeviceProfile(), true /* isOpening */); AnimatorSet anim = createAdjacentPageAnimForTaskLaunch(tv, appWindowAnimationHelper); anim.play(progressAnim); anim.setDuration(duration); anim.setDuration(duration).setInterpolator(interpolator); Consumer<Boolean> onTaskLaunchFinish = this::onTaskLaunched; Loading quickstep/recents_ui_overrides/src/com/android/quickstep/views/TaskView.java +5 −5 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import static android.widget.Toast.LENGTH_SHORT; import static com.android.launcher3.QuickstepAppTransitionManagerImpl.RECENTS_LAUNCH_DURATION; import static com.android.launcher3.anim.Interpolators.FAST_OUT_SLOW_IN; import static com.android.launcher3.anim.Interpolators.LINEAR; import static com.android.launcher3.anim.Interpolators.TOUCH_RESPONSE_INTERPOLATOR; import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE; import static com.android.quickstep.SysUINavigationMode.removeShelfFromOverview; Loading Loading @@ -280,11 +281,10 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable { } public AnimatorPlaybackController createLaunchAnimationForRunningTask() { final PendingAnimation pendingAnimation = getRecentsView().createTaskLauncherAnimation(this, RECENTS_LAUNCH_DURATION); pendingAnimation.anim.setInterpolator(Interpolators.TOUCH_RESPONSE_INTERPOLATOR); AnimatorPlaybackController currentAnimation = AnimatorPlaybackController .wrap(pendingAnimation.anim, RECENTS_LAUNCH_DURATION, null); final PendingAnimation pendingAnimation = getRecentsView().createTaskLaunchAnimation( this, RECENTS_LAUNCH_DURATION, TOUCH_RESPONSE_INTERPOLATOR); AnimatorPlaybackController currentAnimation = AnimatorPlaybackController.wrap( pendingAnimation.anim, RECENTS_LAUNCH_DURATION); currentAnimation.setEndAction(() -> { pendingAnimation.finish(true, Touch.SWIPE); launchTask(false); Loading quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/PortraitStatesTouchController.java +3 −5 Original line number Diff line number Diff line Loading @@ -228,15 +228,13 @@ public class PortraitStatesTouchController extends AbstractStateChangeTouchContr // Reset the state manager, when changing the interaction mode mLauncher.getStateManager().goToState(OVERVIEW, false /* animate */); mPendingAnimation = mOverviewPortraitStateTouchHelper .createSwipeDownToTaskAppAnimation(maxAccuracy); mPendingAnimation.anim.setInterpolator(Interpolators.LINEAR); .createSwipeDownToTaskAppAnimation(maxAccuracy, Interpolators.LINEAR); Runnable onCancelRunnable = () -> { cancelPendingAnim(); clearState(); }; mCurrentAnimation = AnimatorPlaybackController.wrap(mPendingAnimation.anim, maxAccuracy, onCancelRunnable); mCurrentAnimation = AnimatorPlaybackController.wrap( mPendingAnimation.anim, maxAccuracy, onCancelRunnable); mLauncher.getStateManager().setCurrentUserControlledAnimation(mCurrentAnimation); totalShift = LayoutUtils.getShelfTrackingDistance(mLauncher, mLauncher.getDeviceProfile()); Loading Loading
quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/touchcontrollers/PortraitOverviewStateTouchHelper.java +3 −2 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.launcher3.uioverrides.touchcontrollers; import static com.android.launcher3.uioverrides.touchcontrollers.PortraitStatesTouchController.isTouchOverHotseat; import android.view.MotionEvent; import android.view.animation.Interpolator; import com.android.launcher3.Launcher; import com.android.launcher3.util.PendingAnimation; Loading Loading @@ -74,12 +75,12 @@ public final class PortraitOverviewStateTouchHelper { * @param duration how long the animation should be * @return the animation */ PendingAnimation createSwipeDownToTaskAppAnimation(long duration) { PendingAnimation createSwipeDownToTaskAppAnimation(long duration, Interpolator interpolator) { mRecentsView.setCurrentPage(mRecentsView.getPageNearestToCenterOfScreen()); TaskView taskView = mRecentsView.getCurrentPageTaskView(); if (taskView == null) { throw new IllegalStateException("There is no task view to animate to."); } return mRecentsView.createTaskLauncherAnimation(taskView, duration); return mRecentsView.createTaskLaunchAnimation(taskView, duration, interpolator); } }
quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewTouchController.java +4 −5 Original line number Diff line number Diff line Loading @@ -191,9 +191,8 @@ public abstract class TaskViewTouchController<T extends BaseDraggingActivity> mEndDisplacement = -mTaskBeingDragged.getHeight(); } else { mPendingAnimation = mRecentsView.createTaskLauncherAnimation( mTaskBeingDragged, maxDuration); mPendingAnimation.anim.setInterpolator(Interpolators.ZOOM_IN); mPendingAnimation = mRecentsView.createTaskLaunchAnimation( mTaskBeingDragged, maxDuration, Interpolators.ZOOM_IN); mTempCords[1] = mTaskBeingDragged.getHeight(); dl.getDescendantCoordRelativeToSelf(mTaskBeingDragged, mTempCords); Loading @@ -203,8 +202,8 @@ public abstract class TaskViewTouchController<T extends BaseDraggingActivity> if (mCurrentAnimation != null) { mCurrentAnimation.setOnCancelRunnable(null); } mCurrentAnimation = AnimatorPlaybackController .wrap(mPendingAnimation.anim, maxDuration, this::clearState); mCurrentAnimation = AnimatorPlaybackController.wrap( mPendingAnimation.anim, maxDuration, this::clearState); onUserControlledAnimationCreated(mCurrentAnimation); mCurrentAnimation.getTarget().addListener(this); mCurrentAnimation.dispatchOnStart(); Loading
quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java +4 −3 Original line number Diff line number Diff line Loading @@ -76,6 +76,7 @@ import android.view.ViewDebug; import android.view.ViewGroup; import android.view.accessibility.AccessibilityEvent; import android.view.accessibility.AccessibilityNodeInfo; import android.view.animation.Interpolator; import android.widget.ListView; import androidx.annotation.Nullable; Loading Loading @@ -1599,7 +1600,8 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl return anim; } public PendingAnimation createTaskLauncherAnimation(TaskView tv, long duration) { public PendingAnimation createTaskLaunchAnimation( TaskView tv, long duration, Interpolator interpolator) { if (FeatureFlags.IS_STUDIO_BUILD && mPendingAnimation != null) { throw new IllegalStateException("Another pending animation is still running"); } Loading @@ -1612,7 +1614,6 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl int targetSysUiFlags = tv.getThumbnail().getSysUiStatusNavFlags(); final boolean[] passedOverviewThreshold = new boolean[] {false}; ValueAnimator progressAnim = ValueAnimator.ofFloat(0, 1); progressAnim.setInterpolator(LINEAR); progressAnim.addUpdateListener(animator -> { // Once we pass a certain threshold, update the sysui flags to match the target // tasks' flags Loading @@ -1638,7 +1639,7 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl appWindowAnimationHelper.prepareAnimation(mActivity.getDeviceProfile(), true /* isOpening */); AnimatorSet anim = createAdjacentPageAnimForTaskLaunch(tv, appWindowAnimationHelper); anim.play(progressAnim); anim.setDuration(duration); anim.setDuration(duration).setInterpolator(interpolator); Consumer<Boolean> onTaskLaunchFinish = this::onTaskLaunched; Loading
quickstep/recents_ui_overrides/src/com/android/quickstep/views/TaskView.java +5 −5 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import static android.widget.Toast.LENGTH_SHORT; import static com.android.launcher3.QuickstepAppTransitionManagerImpl.RECENTS_LAUNCH_DURATION; import static com.android.launcher3.anim.Interpolators.FAST_OUT_SLOW_IN; import static com.android.launcher3.anim.Interpolators.LINEAR; import static com.android.launcher3.anim.Interpolators.TOUCH_RESPONSE_INTERPOLATOR; import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE; import static com.android.quickstep.SysUINavigationMode.removeShelfFromOverview; Loading Loading @@ -280,11 +281,10 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable { } public AnimatorPlaybackController createLaunchAnimationForRunningTask() { final PendingAnimation pendingAnimation = getRecentsView().createTaskLauncherAnimation(this, RECENTS_LAUNCH_DURATION); pendingAnimation.anim.setInterpolator(Interpolators.TOUCH_RESPONSE_INTERPOLATOR); AnimatorPlaybackController currentAnimation = AnimatorPlaybackController .wrap(pendingAnimation.anim, RECENTS_LAUNCH_DURATION, null); final PendingAnimation pendingAnimation = getRecentsView().createTaskLaunchAnimation( this, RECENTS_LAUNCH_DURATION, TOUCH_RESPONSE_INTERPOLATOR); AnimatorPlaybackController currentAnimation = AnimatorPlaybackController.wrap( pendingAnimation.anim, RECENTS_LAUNCH_DURATION); currentAnimation.setEndAction(() -> { pendingAnimation.finish(true, Touch.SWIPE); launchTask(false); Loading
quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/PortraitStatesTouchController.java +3 −5 Original line number Diff line number Diff line Loading @@ -228,15 +228,13 @@ public class PortraitStatesTouchController extends AbstractStateChangeTouchContr // Reset the state manager, when changing the interaction mode mLauncher.getStateManager().goToState(OVERVIEW, false /* animate */); mPendingAnimation = mOverviewPortraitStateTouchHelper .createSwipeDownToTaskAppAnimation(maxAccuracy); mPendingAnimation.anim.setInterpolator(Interpolators.LINEAR); .createSwipeDownToTaskAppAnimation(maxAccuracy, Interpolators.LINEAR); Runnable onCancelRunnable = () -> { cancelPendingAnim(); clearState(); }; mCurrentAnimation = AnimatorPlaybackController.wrap(mPendingAnimation.anim, maxAccuracy, onCancelRunnable); mCurrentAnimation = AnimatorPlaybackController.wrap( mPendingAnimation.anim, maxAccuracy, onCancelRunnable); mLauncher.getStateManager().setCurrentUserControlledAnimation(mCurrentAnimation); totalShift = LayoutUtils.getShelfTrackingDistance(mLauncher, mLauncher.getDeviceProfile()); Loading