Merge "Fix wrong initial staged split position" into tm-dev

This commit is contained in:
Tracy Zhou
2022-03-10 01:47:53 +00:00
committed by Android (Google) Code Review
3 changed files with 6 additions and 8 deletions
@@ -118,8 +118,8 @@ public final class RecentsViewStateController extends
if (isSplitSelectionState(currentState, toState)) {
// Animation to "dismiss" selected taskView
PendingAnimation splitSelectInitAnimation =
mRecentsView.createSplitSelectInitAnimation();
PendingAnimation splitSelectInitAnimation = mRecentsView.createSplitSelectInitAnimation(
toState.getTransitionDuration(mLauncher));
// Add properties to shift remaining taskViews to get out of placeholder view
splitSelectInitAnimation.setFloat(mRecentsView, taskViewsFloat.first,
toState.getSplitSelectTranslation(mLauncher), LINEAR);
@@ -111,7 +111,8 @@ public class FallbackRecentsStateController implements StateHandler<RecentsState
RecentsState currentState = mActivity.getStateManager().getState();
if (isSplitSelectionState(state) && !isSplitSelectionState(currentState)) {
setter.add(mRecentsView.createSplitSelectInitAnimation().buildAnim());
setter.add(mRecentsView.createSplitSelectInitAnimation(
state.getTransitionDuration(mActivity)).buildAnim());
}
Pair<FloatProperty, FloatProperty> taskViewsFloat =
@@ -28,7 +28,6 @@ import static com.android.launcher3.LauncherAnimUtils.SUCCESS_TRANSITION_PROGRES
import static com.android.launcher3.LauncherAnimUtils.VIEW_ALPHA;
import static com.android.launcher3.LauncherState.BACKGROUND_APP;
import static com.android.launcher3.QuickstepTransitionManager.RECENTS_LAUNCH_DURATION;
import static com.android.launcher3.QuickstepTransitionManager.SPLIT_LAUNCH_DURATION;
import static com.android.launcher3.Utilities.EDGE_NAV_BAR;
import static com.android.launcher3.Utilities.mapToRange;
import static com.android.launcher3.Utilities.squaredHypot;
@@ -3984,14 +3983,12 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
splitSelectSource.position.stagePosition);
}
public PendingAnimation createSplitSelectInitAnimation() {
public PendingAnimation createSplitSelectInitAnimation(int duration) {
if (mSplitHiddenTaskView != null) {
int duration = mActivity.getStateManager().getState().getTransitionDuration(
getContext());
return createTaskDismissAnimation(mSplitHiddenTaskView, true, false, duration,
true /* dismissingForSplitSelection*/);
} else {
PendingAnimation anim = new PendingAnimation(SPLIT_LAUNCH_DURATION);
PendingAnimation anim = new PendingAnimation(duration);
createInitialSplitSelectAnimation(anim);
return anim;
}