Fix split select scroll range when TaskView aren't shifting

- There is an edge case that when ClearAllButton is visible, no split translation is applied, the offset adjustment needs to be calculated differently in that case
- Also, apply the scrollOffset to the TaskViews / ClearAllButton instead of updating min/max scroll

Bug: 200537659
Test: Split right in grid, split left with clear all button, split left without clear all button
Change-Id: I869c448bbec6aec8fa070e47193a692be6f75e84
This commit is contained in:
Alex Chau committed 2021-10-11 19:02:28 +01:00
1 parent 59d825298a
commit 02150305f9
4 files changed
+77 -31

No files matched your search

@@ -16,6 +16,7 @@
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;
@@ -72,6 +73,8 @@ 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
@@ -117,6 +120,16 @@ 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();