Adding a separate state for QuickScrub

Bug: 74014237
Change-Id: Ie86ac589f0ad0e1470fb6b0b71263ec6593eb1e3
This commit is contained in:
Sunny Goyal
2018-03-02 14:57:46 -08:00
parent ae9e85b8e9
commit 6c6c2f45f7
12 changed files with 92 additions and 44 deletions

View File

@@ -60,10 +60,10 @@ public class RecentsViewStateController implements StateHandler {
@Override
public void setState(LauncherState state) {
mWorkspaceCard.setWorkspaceScrollingEnabled(state == OVERVIEW);
setVisibility(state == OVERVIEW);
setTransitionProgress(state == OVERVIEW ? 1 : 0);
if (state == OVERVIEW) {
mWorkspaceCard.setWorkspaceScrollingEnabled(state.overviewUi);
setVisibility(state.overviewUi);
setTransitionProgress(state.overviewUi ? 1 : 0);
if (state.overviewUi) {
for (int i = mRecentsView.getFirstTaskIndex(); i < mRecentsView.getPageCount(); i++) {
((TaskView) mRecentsView.getPageAt(i)).resetVisualProperties();
}
@@ -92,20 +92,20 @@ public class RecentsViewStateController implements StateHandler {
}
ObjectAnimator progressAnim =
mTransitionProgress.animateToValue(toState == OVERVIEW ? 1 : 0);
mTransitionProgress.animateToValue(toState.overviewUi ? 1 : 0);
progressAnim.setDuration(config.duration);
progressAnim.setInterpolator(Interpolators.LINEAR);
progressAnim.addListener(new AnimationSuccessListener() {
@Override
public void onAnimationSuccess(Animator animator) {
mWorkspaceCard.setWorkspaceScrollingEnabled(toState == OVERVIEW);
mWorkspaceCard.setWorkspaceScrollingEnabled(toState.overviewUi);
mRecentsView.setCurrentPage(mRecentsView.getPageNearestToCenterOfScreen());
}
});
builder.play(progressAnim);
ObjectAnimator visibilityAnim = animateVisibility(toState == OVERVIEW);
ObjectAnimator visibilityAnim = animateVisibility(toState.overviewUi);
visibilityAnim.setDuration(config.duration);
visibilityAnim.setInterpolator(Interpolators.LINEAR);
builder.play(visibilityAnim);