Updating landscape layout for launcher/quickstep

> Hotseat is tied to navbar (on left in seascape)
> Search box shows up in Overview (clicking it would crash for now)
> All-apps is no longer fullscreen in landscape
> Recents cards are appropriately scaled down
> Hotseat is visible in Overview

Bug: 70179916
Change-Id: I53149eaeac9557e8a01021b7e2d139f3d6ceef37
This commit is contained in:
Sunny Goyal committed 2018-01-08 13:53:44 -08:00
1 parent 07b1d670f2
commit 228153d92a
32 files changed
+397 -500

No files matched your search

@@ -318,32 +318,17 @@ public class TwoStepSwipeController extends AnimatorListenerAdapter
public void onDragEnd(float velocity, boolean fling) {
mDragPauseDetector.addDisabledFlags(FLAG_OVERVIEW_DISABLED_FLING);
final long animationDuration;
final int logAction;
LauncherState targetState;
final float progress = mCurrentAnimation.getProgressFraction();
if (fling) {
logAction = Touch.FLING;
if (velocity < 0) {
targetState = ALL_APPS;
animationDuration = SwipeDetector.calculateDuration(velocity,
mToState == ALL_APPS ? (1 - progress) : progress);
} else {
targetState = NORMAL;
animationDuration = SwipeDetector.calculateDuration(velocity,
mToState == ALL_APPS ? progress : (1 - progress));
}
targetState = velocity < 0 ? ALL_APPS : NORMAL;
// snap to top or bottom using the release velocity
} else {
logAction = Touch.SWIPE;
if (progress > SUCCESS_TRANSITION_PROGRESS) {
targetState = mToState;
animationDuration = SwipeDetector.calculateDuration(velocity, 1 - progress);
} else {
targetState = mFromState;
animationDuration = SwipeDetector.calculateDuration(velocity, progress);
}
targetState = (progress > SUCCESS_TRANSITION_PROGRESS) ? mToState : mFromState;
}
if (fling && targetState == ALL_APPS) {
@@ -352,20 +337,32 @@ public class TwoStepSwipeController extends AnimatorListenerAdapter
h.animateToFinalPosition(0 /* pos */, 1 /* startValue */);
}
}
mCurrentAnimation.setEndAction(() -> {
LauncherState finalState = targetState;
if (mDragPauseDetector.isTriggered() && targetState == NORMAL) {
finalState = OVERVIEW;
float endProgress;
if (mDragPauseDetector.isTriggered() && targetState == NORMAL) {
targetState = OVERVIEW;
endProgress = OVERVIEW.getVerticalProgress(mLauncher);
if (mFromState == NORMAL) {
endProgress = 1 - endProgress;
}
onSwipeInteractionCompleted(finalState, logAction);
});
} else if (targetState == mToState) {
endProgress = 1;
} else {
endProgress = 0;
}
LauncherState targetStateFinal = targetState;
mCurrentAnimation.setEndAction(() ->
onSwipeInteractionCompleted(targetStateFinal, logAction));
float nextFrameProgress = Utilities.boundToRange(
progress + velocity * SINGLE_FRAME_MS / getShiftRange(), 0f, 1f);
ValueAnimator anim = mCurrentAnimation.getAnimationPlayer();
anim.setFloatValues(nextFrameProgress, targetState == mToState ? 1f : 0f);
anim.setDuration(animationDuration);
anim.setFloatValues(nextFrameProgress, endProgress);
anim.setDuration(
SwipeDetector.calculateDuration(velocity, Math.abs(endProgress - progress)));
anim.setInterpolator(scrollInterpolatorForVelocity(velocity));
anim.start();
}