Merge "Defer some heavy work from final frame of app -> home transition" into sc-dev am: b9e275d233
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/14518196 Change-Id: I95f841c77b807e62c68f946ce1752510899b0f76
This commit is contained in:
commit
c3a4d4d2d2
6 files changed
+22
-26
No files matched your search
@@ -99,6 +99,8 @@ public abstract class BaseRecentsViewStateController<T extends RecentsView>
|
|||||||
config.getInterpolator(ANIM_OVERVIEW_TRANSLATE_X, LINEAR));
|
config.getInterpolator(ANIM_OVERVIEW_TRANSLATE_X, LINEAR));
|
||||||
setter.setFloat(mRecentsView, ADJACENT_PAGE_VERTICAL_OFFSET, scaleAndOffset[2],
|
setter.setFloat(mRecentsView, ADJACENT_PAGE_VERTICAL_OFFSET, scaleAndOffset[2],
|
||||||
config.getInterpolator(ANIM_OVERVIEW_TRANSLATE_Y, LINEAR));
|
config.getInterpolator(ANIM_OVERVIEW_TRANSLATE_Y, LINEAR));
|
||||||
|
setter.setFloat(mRecentsView, TASK_SECONDARY_TRANSLATION, 0f,
|
||||||
|
config.getInterpolator(ANIM_OVERVIEW_TRANSLATE_Y, LINEAR));
|
||||||
PagedOrientationHandler orientationHandler =
|
PagedOrientationHandler orientationHandler =
|
||||||
((RecentsView) mLauncher.getOverviewPanel()).getPagedOrientationHandler();
|
((RecentsView) mLauncher.getOverviewPanel()).getPagedOrientationHandler();
|
||||||
FloatProperty taskViewsFloat = orientationHandler.getSplitSelectTaskOffset(
|
FloatProperty taskViewsFloat = orientationHandler.getSplitSelectTaskOffset(
|
||||||
|
|||||||
@@ -1521,7 +1521,6 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
|
|||||||
|
|
||||||
private void setupLauncherUiAfterSwipeUpToRecentsAnimation() {
|
private void setupLauncherUiAfterSwipeUpToRecentsAnimation() {
|
||||||
endLauncherTransitionController();
|
endLauncherTransitionController();
|
||||||
mActivityInterface.onSwipeUpToRecentsComplete();
|
|
||||||
mRecentsView.onSwipeUpAnimationSuccess();
|
mRecentsView.onSwipeUpAnimationSuccess();
|
||||||
if (LIVE_TILE.get()) {
|
if (LIVE_TILE.get()) {
|
||||||
mTaskAnimationManager.setLiveTileCleanUpHandler(mInputConsumerProxy::destroy);
|
mTaskAnimationManager.setLiveTileCleanUpHandler(mInputConsumerProxy::destroy);
|
||||||
|
|||||||
@@ -99,16 +99,8 @@ public abstract class BaseActivityInterface<STATE_TYPE extends BaseState<STATE_T
|
|||||||
DeviceProfile dp, Context context, Rect outRect,
|
DeviceProfile dp, Context context, Rect outRect,
|
||||||
PagedOrientationHandler orientationHandler);
|
PagedOrientationHandler orientationHandler);
|
||||||
|
|
||||||
public void onSwipeUpToRecentsComplete() {
|
/** Called when the animation to home has fully settled. */
|
||||||
// Re apply state in case we did something funky during the transition.
|
public void onSwipeUpToHomeComplete(RecentsAnimationDeviceState deviceState) {}
|
||||||
ACTIVITY_TYPE activity = getCreatedActivity();
|
|
||||||
if (activity == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
activity.getStateManager().reapplyState();
|
|
||||||
}
|
|
||||||
|
|
||||||
public abstract void onSwipeUpToHomeComplete(RecentsAnimationDeviceState deviceState);
|
|
||||||
|
|
||||||
public abstract void onAssistantVisibilityChanged(float visibility);
|
public abstract void onAssistantVisibilityChanged(float visibility);
|
||||||
|
|
||||||
|
|||||||
@@ -65,12 +65,6 @@ public final class FallbackActivityInterface extends
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 4 */
|
|
||||||
@Override
|
|
||||||
public void onSwipeUpToHomeComplete(RecentsAnimationDeviceState deviceState) {
|
|
||||||
onSwipeUpToRecentsComplete();
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 5 */
|
/** 5 */
|
||||||
@Override
|
@Override
|
||||||
public void onAssistantVisibilityChanged(float visibility) {
|
public void onAssistantVisibilityChanged(float visibility) {
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import static com.android.launcher3.LauncherState.OVERVIEW;
|
|||||||
import static com.android.launcher3.LauncherState.QUICK_SWITCH;
|
import static com.android.launcher3.LauncherState.QUICK_SWITCH;
|
||||||
import static com.android.launcher3.anim.AnimatorListeners.forEndCallback;
|
import static com.android.launcher3.anim.AnimatorListeners.forEndCallback;
|
||||||
import static com.android.launcher3.anim.Interpolators.LINEAR;
|
import static com.android.launcher3.anim.Interpolators.LINEAR;
|
||||||
|
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
|
||||||
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_IME_SHOWING;
|
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_IME_SHOWING;
|
||||||
|
|
||||||
import android.animation.Animator;
|
import android.animation.Animator;
|
||||||
@@ -84,9 +85,13 @@ public final class LauncherActivityInterface extends
|
|||||||
if (launcher == null) {
|
if (launcher == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Ensure recents is at the correct position for NORMAL state. For example, when we detach
|
// When going to home, the state animator we use has SKIP_OVERVIEW because we assume that
|
||||||
// recents, we assume the first task is invisible, making translation off by one task.
|
// setRecentsAttachedToAppWindow() will handle animating Overview instead. Thus, at the end
|
||||||
launcher.getStateManager().reapplyState();
|
// of the animation, we should ensure recents is at the correct position for NORMAL state.
|
||||||
|
// For example, when doing a long swipe to home, RecentsView may be scaled down. This is
|
||||||
|
// relatively expensive, so do it on the next frame instead of critical path.
|
||||||
|
MAIN_EXECUTOR.getHandler().post(launcher.getStateManager()::reapplyState);
|
||||||
|
|
||||||
launcher.getRootView().setForceHideBackArrow(false);
|
launcher.getRootView().setForceHideBackArrow(false);
|
||||||
notifyRecentsOfOrientation(deviceState.getRotationTouchHelper());
|
notifyRecentsOfOrientation(deviceState.getRotationTouchHelper());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1585,12 +1585,16 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
|||||||
mLiveTileParams.setTargetSet(null);
|
mLiveTileParams.setTargetSet(null);
|
||||||
mLiveTileTaskViewSimulator.setDrawsBelowRecents(true);
|
mLiveTileTaskViewSimulator.setDrawsBelowRecents(true);
|
||||||
|
|
||||||
unloadVisibleTaskData(TaskView.FLAG_UPDATE_ALL);
|
// These are relatively expensive and don't need to be done this frame (RecentsView isn't
|
||||||
setCurrentPage(0);
|
// visible anyway), so defer by a frame to get off the critical path, e.g. app to home.
|
||||||
LayoutUtils.setViewEnabled(mActionsView, true);
|
post(() -> {
|
||||||
if (mOrientationState.setGestureActive(false)) {
|
unloadVisibleTaskData(TaskView.FLAG_UPDATE_ALL);
|
||||||
updateOrientationHandler();
|
setCurrentPage(0);
|
||||||
}
|
LayoutUtils.setViewEnabled(mActionsView, true);
|
||||||
|
if (mOrientationState.setGestureActive(false)) {
|
||||||
|
updateOrientationHandler();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getRunningTaskId() {
|
public int getRunningTaskId() {
|
||||||
|
|||||||
Reference in new issue
Block a user