Ensuring that Recents view is always loaded when going to Overview state

Change-Id: If2337a0be66f4ca68dd54954b7368f38d70a40d4
This commit is contained in:
Sunny Goyal committed 2018-01-16 12:01:57 -08:00
1 parent 8d55f9858c
commit 75c59acf5c
9 files changed
+179 -107

No files matched your search

@@ -90,7 +90,6 @@ public class TwoStepSwipeController extends AnimatorListenerAdapter
private static final int FLAG_OVERVIEW_DISABLED_OUT_OF_RANGE = 1 << 0;
private static final int FLAG_OVERVIEW_DISABLED_FLING = 1 << 1;
private static final int FLAG_OVERVIEW_DISABLED_CANCEL_STATE = 1 << 2;
private static final int FLAG_RECENTS_PLAN_LOADING = 1 << 3;
private static final int FLAG_OVERVIEW_DISABLED = 1 << 4;
private static final int FLAG_DISABLED_TWO_TARGETS = 1 << 5;
private static final int FLAG_DISABLED_BACK_TARGET = 1 << 6;
@@ -272,16 +271,7 @@ public class TwoStepSwipeController extends AnimatorListenerAdapter
mCurrentAnimation = mLauncher.getStateManager().createAnimationToNewWorkspace(
mToState, mTaggedAnimatorSetBuilder, maxAccuracy);
if (TouchInteractionService.isConnected()) {
// Load recents plan
RecentsModel recentsModel = RecentsModel.getInstance(mLauncher);
if (recentsModel.getLastLoadPlan() != null) {
onRecentsPlanLoaded(recentsModel.getLastLoadPlan());
} else {
mDragPauseDetector.addDisabledFlags(FLAG_RECENTS_PLAN_LOADING);
recentsModel.loadTasks(-1, this::onRecentsPlanLoaded);
}
} else {
if (!TouchInteractionService.isConnected()) {
mDragPauseDetector.addDisabledFlags(FLAG_OVERVIEW_DISABLED);
}
@@ -302,14 +292,6 @@ public class TwoStepSwipeController extends AnimatorListenerAdapter
}
}
private void onRecentsPlanLoaded(RecentsTaskLoadPlan plan) {
RecentsView recentsView = mLauncher.getOverviewPanel();
recentsView.update(plan);
recentsView.initToPage(0);
mDragPauseDetector.clearDisabledFlags(FLAG_RECENTS_PLAN_LOADING);
}
private float getShiftRange() {
return mLauncher.getAllAppsController().getShiftRange();
}