Fix grid layout problem after going back from split select

- Don't reset mFocusedTaskViewId when focused task become split, so it's reset properly when it's added back to RecentsView
- Moved applySplitScrollOffset to RecentsViewStateController to be called after mSplitHiddenTaskView is added back to RecentsView
- Update scroll after going back from split
- Don't reset mSplitHiddenTaskView's translation as it'll clear the grid translations

Test: manual
Bug: 181707736
Change-Id: I4bd204fc537ee520216f875b3eddf4dc94f7bfd8
This commit is contained in:
Alex Chau
2021-11-23 15:20:39 +00:00
parent 0b7ed895e7
commit 460638e5ef
3 changed files with 9 additions and 25 deletions

View File

@@ -16,7 +16,6 @@
package com.android.launcher3.uioverrides;
import static com.android.launcher3.LauncherState.OVERVIEW_SPLIT_SELECT;
import static com.android.launcher3.anim.Interpolators.AGGRESSIVE_EASE_IN_OUT;
import static com.android.launcher3.anim.Interpolators.FINAL_FRAME;
import static com.android.launcher3.anim.Interpolators.INSTANT;
@@ -73,8 +72,6 @@ public abstract class BaseRecentsViewStateController<T extends RecentsView>
getTaskModalnessProperty().set(mRecentsView, state.getOverviewModalness());
RECENTS_GRID_PROGRESS.set(mRecentsView,
state.displayOverviewTasksAsGrid(mLauncher.getDeviceProfile()) ? 1f : 0f);
applySplitScrollOffset(state);
}
@Override
@@ -120,16 +117,6 @@ public abstract class BaseRecentsViewStateController<T extends RecentsView>
boolean showAsGrid = toState.displayOverviewTasksAsGrid(mLauncher.getDeviceProfile());
setter.setFloat(mRecentsView, RECENTS_GRID_PROGRESS, showAsGrid ? 1f : 0f,
showAsGrid ? INSTANT : FINAL_FRAME);
applySplitScrollOffset(toState);
}
private void applySplitScrollOffset(@NonNull final LauncherState state) {
if (state == OVERVIEW_SPLIT_SELECT) {
mRecentsView.applySplitPrimaryScrollOffset();
} else {
mRecentsView.resetSplitPrimaryScrollOffset();
}
}
abstract FloatProperty getTaskModalnessProperty();