Loading quickstep/src/com/android/launcher3/QuickstepTransitionManager.java +18 −8 Original line number Diff line number Diff line Loading @@ -367,7 +367,7 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener if (launcherClosing) { // Delay animation by a frame to avoid jank. Pair<AnimatorSet, Runnable> launcherContentAnimator = getLauncherContentAnimator(true /* isAppOpening */, startDelay); getLauncherContentAnimator(true /* isAppOpening */, startDelay, false); anim.play(launcherContentAnimator.first); anim.addListener(new AnimatorListenerAdapter() { @Override Loading Loading @@ -464,9 +464,10 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener * @param isAppOpening True when this is called when an app is opening. * False when this is called when an app is closing. * @param startDelay Start delay duration. * @param skipAllAppsScale True if we want to avoid scaling All Apps */ private Pair<AnimatorSet, Runnable> getLauncherContentAnimator(boolean isAppOpening, int startDelay) { int startDelay, boolean skipAllAppsScale) { AnimatorSet launcherAnimator = new AnimatorSet(); Runnable endListener; Loading @@ -484,7 +485,6 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener final float startAlpha = appsView.getAlpha(); final float startScale = SCALE_PROPERTY.get(appsView); appsView.setAlpha(alphas[0]); SCALE_PROPERTY.set(appsView, scales[0]); ObjectAnimator alpha = ObjectAnimator.ofFloat(appsView, View.ALPHA, alphas); alpha.setDuration(CONTENT_ALPHA_DURATION); Loading @@ -496,12 +496,16 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener appsView.setLayerType(View.LAYER_TYPE_NONE, null); } }); if (!skipAllAppsScale) { SCALE_PROPERTY.set(appsView, scales[0]); ObjectAnimator scale = ObjectAnimator.ofFloat(appsView, SCALE_PROPERTY, scales); scale.setInterpolator(AGGRESSIVE_EASE); scale.setDuration(CONTENT_SCALE_DURATION); launcherAnimator.play(scale); } launcherAnimator.play(alpha); launcherAnimator.play(scale); endListener = () -> { appsView.setAlpha(startAlpha); Loading Loading @@ -1565,6 +1569,7 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener || mLauncher.getWorkspace().isOverlayShown(); boolean playWorkspaceReveal = true; boolean skipAllAppsScale = false; if (mFromUnlock) { anim.play(getUnlockWindowAnimator(appTargets, wallpaperTargets)); } else if (ENABLE_BACK_SWIPE_HOME_ANIMATION.get() Loading @@ -1579,6 +1584,10 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener true /* animateOverviewScrim */, launcherView).getAnimators()); // We play StaggeredWorkspaceAnim as a part of the closing window animation. playWorkspaceReveal = false; } else { // Skip scaling all apps, otherwise FloatingIconView will get wrong // layout bounds. skipAllAppsScale = true; } } else { anim.play(getFallbackClosingWindowAnimators(appTargets)); Loading @@ -1600,7 +1609,8 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener if (mLauncher.isInState(LauncherState.ALL_APPS)) { Pair<AnimatorSet, Runnable> contentAnimator = getLauncherContentAnimator(false, LAUNCHER_RESUME_START_DELAY); getLauncherContentAnimator(false, LAUNCHER_RESUME_START_DELAY, skipAllAppsScale); anim.play(contentAnimator.first); anim.addListener(new AnimatorListenerAdapter() { @Override Loading quickstep/src/com/android/quickstep/InputConsumer.java +2 −0 Original line number Diff line number Diff line Loading @@ -99,6 +99,8 @@ public interface InputConsumer { default void onMotionEvent(MotionEvent ev) { } default void onHoverEvent(MotionEvent ev) { } default void onKeyEvent(KeyEvent ev) { } default void onInputEvent(InputEvent ev) { Loading quickstep/src/com/android/quickstep/OverviewCommandHelper.java +9 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ import com.android.quickstep.views.TaskView; import com.android.systemui.shared.recents.model.ThumbnailData; import com.android.systemui.shared.system.InteractionJankMonitorWrapper; import java.io.PrintWriter; import java.util.ArrayList; import java.util.HashMap; Loading Loading @@ -271,6 +272,14 @@ public class OverviewCommandHelper { scheduleNextTask(cmd); } public void dump(PrintWriter pw) { pw.println("OverviewCommandHelper:"); pw.println(" mPendingCommands=" + mPendingCommands.size()); if (!mPendingCommands.isEmpty()) { pw.println(" pendingCommandType=" + mPendingCommands.get(0).type); } } private static class CommandInfo { public final long createTime = SystemClock.elapsedRealtime(); public final int type; Loading quickstep/src/com/android/quickstep/RecentsActivity.java +19 −0 Original line number Diff line number Diff line Loading @@ -99,6 +99,7 @@ public final class RecentsActivity extends StatefulActivity<RecentsState> { private Handler mUiHandler = new Handler(Looper.getMainLooper()); private static final long HOME_APPEAR_DURATION = 250; private static final long RECENTS_ANIMATION_TIMEOUT = 1000; private RecentsDragLayer mDragLayer; private ScrimView mScrimView; Loading @@ -115,6 +116,11 @@ public final class RecentsActivity extends StatefulActivity<RecentsState> { // Strong refs to runners which are cleared when the activity is destroyed private RemoteAnimationFactory mActivityLaunchAnimationRunner; // For handling degenerate cases where starting an activity doesn't actually trigger the remote // animation callback private final Handler mHandler = new Handler(); private final Runnable mAnimationStartTimeoutRunnable = this::onAnimationStartTimeout; /** * Init drag layer and overview panel views. */ Loading Loading @@ -219,6 +225,16 @@ public final class RecentsActivity extends StatefulActivity<RecentsState> { // TODO(b/137318995) This should go home, but doing so removes freeform windows } /** * Called if the remote animation callback from #getActivityLaunchOptions() hasn't called back * in a reasonable time due to a conflict with the recents animation. */ private void onAnimationStartTimeout() { if (mActivityLaunchAnimationRunner != null) { mActivityLaunchAnimationRunner.onAnimationCancelled(); } } @Override public ActivityOptionsWrapper getActivityLaunchOptions(final View v, @Nullable ItemInfo item) { if (!(v instanceof TaskView)) { Loading @@ -233,6 +249,7 @@ public final class RecentsActivity extends StatefulActivity<RecentsState> { public void onCreateAnimation(int transit, RemoteAnimationTargetCompat[] appTargets, RemoteAnimationTargetCompat[] wallpaperTargets, RemoteAnimationTargetCompat[] nonAppTargets, AnimationResult result) { mHandler.removeCallbacks(mAnimationStartTimeoutRunnable); AnimatorSet anim = composeRecentsLaunchAnimator(taskView, appTargets, wallpaperTargets, nonAppTargets); anim.addListener(resetStateListener()); Loading @@ -242,6 +259,7 @@ public final class RecentsActivity extends StatefulActivity<RecentsState> { @Override public void onAnimationCancelled() { mHandler.removeCallbacks(mAnimationStartTimeoutRunnable); onEndCallback.executeAllAndDestroy(); } }; Loading @@ -256,6 +274,7 @@ public final class RecentsActivity extends StatefulActivity<RecentsState> { ActivityOptionsCompat.makeRemoteAnimation(adapterCompat), onEndCallback); activityOptions.options.setSplashscreenStyle(SplashScreen.SPLASH_SCREEN_STYLE_ICON); mHandler.postDelayed(mAnimationStartTimeoutRunnable, RECENTS_ANIMATION_TIMEOUT); return activityOptions; } Loading quickstep/src/com/android/quickstep/TouchInteractionService.java +3 −0 Original line number Diff line number Diff line Loading @@ -967,6 +967,9 @@ public class TouchInteractionService extends Service if (mOverviewComponentObserver != null) { mOverviewComponentObserver.dump(pw); } if (mOverviewCommandHelper != null) { mOverviewCommandHelper.dump(pw); } if (mGestureState != null) { mGestureState.dump(pw); } Loading Loading
quickstep/src/com/android/launcher3/QuickstepTransitionManager.java +18 −8 Original line number Diff line number Diff line Loading @@ -367,7 +367,7 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener if (launcherClosing) { // Delay animation by a frame to avoid jank. Pair<AnimatorSet, Runnable> launcherContentAnimator = getLauncherContentAnimator(true /* isAppOpening */, startDelay); getLauncherContentAnimator(true /* isAppOpening */, startDelay, false); anim.play(launcherContentAnimator.first); anim.addListener(new AnimatorListenerAdapter() { @Override Loading Loading @@ -464,9 +464,10 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener * @param isAppOpening True when this is called when an app is opening. * False when this is called when an app is closing. * @param startDelay Start delay duration. * @param skipAllAppsScale True if we want to avoid scaling All Apps */ private Pair<AnimatorSet, Runnable> getLauncherContentAnimator(boolean isAppOpening, int startDelay) { int startDelay, boolean skipAllAppsScale) { AnimatorSet launcherAnimator = new AnimatorSet(); Runnable endListener; Loading @@ -484,7 +485,6 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener final float startAlpha = appsView.getAlpha(); final float startScale = SCALE_PROPERTY.get(appsView); appsView.setAlpha(alphas[0]); SCALE_PROPERTY.set(appsView, scales[0]); ObjectAnimator alpha = ObjectAnimator.ofFloat(appsView, View.ALPHA, alphas); alpha.setDuration(CONTENT_ALPHA_DURATION); Loading @@ -496,12 +496,16 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener appsView.setLayerType(View.LAYER_TYPE_NONE, null); } }); if (!skipAllAppsScale) { SCALE_PROPERTY.set(appsView, scales[0]); ObjectAnimator scale = ObjectAnimator.ofFloat(appsView, SCALE_PROPERTY, scales); scale.setInterpolator(AGGRESSIVE_EASE); scale.setDuration(CONTENT_SCALE_DURATION); launcherAnimator.play(scale); } launcherAnimator.play(alpha); launcherAnimator.play(scale); endListener = () -> { appsView.setAlpha(startAlpha); Loading Loading @@ -1565,6 +1569,7 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener || mLauncher.getWorkspace().isOverlayShown(); boolean playWorkspaceReveal = true; boolean skipAllAppsScale = false; if (mFromUnlock) { anim.play(getUnlockWindowAnimator(appTargets, wallpaperTargets)); } else if (ENABLE_BACK_SWIPE_HOME_ANIMATION.get() Loading @@ -1579,6 +1584,10 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener true /* animateOverviewScrim */, launcherView).getAnimators()); // We play StaggeredWorkspaceAnim as a part of the closing window animation. playWorkspaceReveal = false; } else { // Skip scaling all apps, otherwise FloatingIconView will get wrong // layout bounds. skipAllAppsScale = true; } } else { anim.play(getFallbackClosingWindowAnimators(appTargets)); Loading @@ -1600,7 +1609,8 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener if (mLauncher.isInState(LauncherState.ALL_APPS)) { Pair<AnimatorSet, Runnable> contentAnimator = getLauncherContentAnimator(false, LAUNCHER_RESUME_START_DELAY); getLauncherContentAnimator(false, LAUNCHER_RESUME_START_DELAY, skipAllAppsScale); anim.play(contentAnimator.first); anim.addListener(new AnimatorListenerAdapter() { @Override Loading
quickstep/src/com/android/quickstep/InputConsumer.java +2 −0 Original line number Diff line number Diff line Loading @@ -99,6 +99,8 @@ public interface InputConsumer { default void onMotionEvent(MotionEvent ev) { } default void onHoverEvent(MotionEvent ev) { } default void onKeyEvent(KeyEvent ev) { } default void onInputEvent(InputEvent ev) { Loading
quickstep/src/com/android/quickstep/OverviewCommandHelper.java +9 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ import com.android.quickstep.views.TaskView; import com.android.systemui.shared.recents.model.ThumbnailData; import com.android.systemui.shared.system.InteractionJankMonitorWrapper; import java.io.PrintWriter; import java.util.ArrayList; import java.util.HashMap; Loading Loading @@ -271,6 +272,14 @@ public class OverviewCommandHelper { scheduleNextTask(cmd); } public void dump(PrintWriter pw) { pw.println("OverviewCommandHelper:"); pw.println(" mPendingCommands=" + mPendingCommands.size()); if (!mPendingCommands.isEmpty()) { pw.println(" pendingCommandType=" + mPendingCommands.get(0).type); } } private static class CommandInfo { public final long createTime = SystemClock.elapsedRealtime(); public final int type; Loading
quickstep/src/com/android/quickstep/RecentsActivity.java +19 −0 Original line number Diff line number Diff line Loading @@ -99,6 +99,7 @@ public final class RecentsActivity extends StatefulActivity<RecentsState> { private Handler mUiHandler = new Handler(Looper.getMainLooper()); private static final long HOME_APPEAR_DURATION = 250; private static final long RECENTS_ANIMATION_TIMEOUT = 1000; private RecentsDragLayer mDragLayer; private ScrimView mScrimView; Loading @@ -115,6 +116,11 @@ public final class RecentsActivity extends StatefulActivity<RecentsState> { // Strong refs to runners which are cleared when the activity is destroyed private RemoteAnimationFactory mActivityLaunchAnimationRunner; // For handling degenerate cases where starting an activity doesn't actually trigger the remote // animation callback private final Handler mHandler = new Handler(); private final Runnable mAnimationStartTimeoutRunnable = this::onAnimationStartTimeout; /** * Init drag layer and overview panel views. */ Loading Loading @@ -219,6 +225,16 @@ public final class RecentsActivity extends StatefulActivity<RecentsState> { // TODO(b/137318995) This should go home, but doing so removes freeform windows } /** * Called if the remote animation callback from #getActivityLaunchOptions() hasn't called back * in a reasonable time due to a conflict with the recents animation. */ private void onAnimationStartTimeout() { if (mActivityLaunchAnimationRunner != null) { mActivityLaunchAnimationRunner.onAnimationCancelled(); } } @Override public ActivityOptionsWrapper getActivityLaunchOptions(final View v, @Nullable ItemInfo item) { if (!(v instanceof TaskView)) { Loading @@ -233,6 +249,7 @@ public final class RecentsActivity extends StatefulActivity<RecentsState> { public void onCreateAnimation(int transit, RemoteAnimationTargetCompat[] appTargets, RemoteAnimationTargetCompat[] wallpaperTargets, RemoteAnimationTargetCompat[] nonAppTargets, AnimationResult result) { mHandler.removeCallbacks(mAnimationStartTimeoutRunnable); AnimatorSet anim = composeRecentsLaunchAnimator(taskView, appTargets, wallpaperTargets, nonAppTargets); anim.addListener(resetStateListener()); Loading @@ -242,6 +259,7 @@ public final class RecentsActivity extends StatefulActivity<RecentsState> { @Override public void onAnimationCancelled() { mHandler.removeCallbacks(mAnimationStartTimeoutRunnable); onEndCallback.executeAllAndDestroy(); } }; Loading @@ -256,6 +274,7 @@ public final class RecentsActivity extends StatefulActivity<RecentsState> { ActivityOptionsCompat.makeRemoteAnimation(adapterCompat), onEndCallback); activityOptions.options.setSplashscreenStyle(SplashScreen.SPLASH_SCREEN_STYLE_ICON); mHandler.postDelayed(mAnimationStartTimeoutRunnable, RECENTS_ANIMATION_TIMEOUT); return activityOptions; } Loading
quickstep/src/com/android/quickstep/TouchInteractionService.java +3 −0 Original line number Diff line number Diff line Loading @@ -967,6 +967,9 @@ public class TouchInteractionService extends Service if (mOverviewComponentObserver != null) { mOverviewComponentObserver.dump(pw); } if (mOverviewCommandHelper != null) { mOverviewCommandHelper.dump(pw); } if (mGestureState != null) { mGestureState.dump(pw); } Loading