Loading quickstep/recents_ui_overrides/src/com/android/launcher3/hybridhotseat/HotseatPredictionController.java +0 −12 Original line number Diff line number Diff line Loading @@ -113,8 +113,6 @@ public class HotseatPredictionController implements DragController.DragListener, private AllAppsStore mAllAppsStore; private AnimatorSet mIconRemoveAnimators; private boolean mUIUpdatePaused = false; private boolean mRequiresCacheUpdate = true; private boolean mIsCacheEmpty; private boolean mIsDestroyed = false; Loading Loading @@ -350,7 +348,6 @@ public class HotseatPredictionController implements DragController.DragListener, fillGapsWithPrediction(); return; } mIsCacheEmpty = apps.isEmpty(); int count = Math.min(ranks.size(), apps.size()); List<WorkspaceItemInfo> items = new ArrayList<>(count); for (int i = 0; i < count; i++) { Loading Loading @@ -393,14 +390,7 @@ public class HotseatPredictionController implements DragController.DragListener, } updateDependencies(); fillGapsWithPrediction(); cachePredictionComponentKeysIfNecessary(componentKeys); } private void cachePredictionComponentKeysIfNecessary(ArrayList<ComponentKey> componentKeys) { if (!mRequiresCacheUpdate && componentKeys.isEmpty() == mIsCacheEmpty) return; mPredictionModel.cachePredictionComponentKeys(componentKeys); mIsCacheEmpty = componentKeys.isEmpty(); mRequiresCacheUpdate = false; } private void updateDependencies() { Loading Loading @@ -429,7 +419,6 @@ public class HotseatPredictionController implements DragController.DragListener, notifyItemAction(mPredictionModel.wrapAppTargetWithLocation(appTarget, AppTargetEvent.ACTION_PIN, workspaceItemInfo)); } mRequiresCacheUpdate = true; } private List<WorkspaceItemInfo> mapToWorkspaceItemInfo( Loading Loading @@ -583,7 +572,6 @@ public class HotseatPredictionController implements DragController.DragListener, } mDragObject = null; fillGapsWithPrediction(true, this::removeOutlineDrawings); mRequiresCacheUpdate = true; } Loading quickstep/recents_ui_overrides/src/com/android/quickstep/util/TaskViewSimulator.java +1 −0 Original line number Diff line number Diff line Loading @@ -103,6 +103,7 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy { mSizeStrategy = sizeStrategy; mOrientationState = new RecentsOrientedState(context, sizeStrategy, i -> { }); mOrientationState.setGestureActive(true); mCurrentFullscreenParams = new FullscreenDrawParams(context); mPageSpacing = context.getResources().getDimensionPixelSize(R.dimen.recents_page_spacing); Loading quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java +10 −3 Original line number Diff line number Diff line Loading @@ -1003,7 +1003,9 @@ public abstract class RecentsView<T extends StatefulActivity> extends PagedView mDwbToastShown = false; mActivity.getSystemUiController().updateUiState(UI_STATE_OVERVIEW, 0); LayoutUtils.setViewEnabled(mActionsView, true); mOrientationState.setGestureActive(false); if (mOrientationState.setGestureActive(false)) { updateOrientationHandler(); } } public @Nullable TaskView getRunningTaskView() { Loading Loading @@ -1041,7 +1043,10 @@ public abstract class RecentsView<T extends StatefulActivity> extends PagedView */ public void onGestureAnimationStart(int runningTaskId) { // This needs to be called before the other states are set since it can create the task view mOrientationState.setGestureActive(true); if (mOrientationState.setGestureActive(true)) { updateOrientationHandler(); } showCurrentTask(runningTaskId); setEnableFreeScroll(false); setEnableDrawingLiveTile(false); Loading Loading @@ -1104,7 +1109,9 @@ public abstract class RecentsView<T extends StatefulActivity> extends PagedView * Called when a gesture from an app has finished. */ public void onGestureAnimationEnd() { mOrientationState.setGestureActive(false); if (mOrientationState.setGestureActive(false)) { updateOrientationHandler(); } setOnScrollChangeListener(null); setEnableFreeScroll(true); Loading quickstep/src/com/android/quickstep/util/RecentsOrientedState.java +8 −15 Original line number Diff line number Diff line Loading @@ -188,8 +188,9 @@ public final class RecentsOrientedState implements SharedPreferences.OnSharedPre /** * Sets if the swipe up gesture is currently running or not */ public void setGestureActive(boolean isGestureActive) { public boolean setGestureActive(boolean isGestureActive) { setFlag(FLAG_SWIPE_UP_NOT_RUNNING, !isGestureActive); return update(mTouchRotation, mDisplayRotation); } /** Loading @@ -202,27 +203,19 @@ public final class RecentsOrientedState implements SharedPreferences.OnSharedPre */ public boolean update( @SurfaceRotation int touchRotation, @SurfaceRotation int displayRotation) { int recentsActivityRotation = inferRecentsActivityRotation(displayRotation); if (mDisplayRotation == displayRotation && mTouchRotation == touchRotation && mRecentsActivityRotation == recentsActivityRotation) { return false; } mRecentsActivityRotation = recentsActivityRotation; mRecentsActivityRotation = inferRecentsActivityRotation(displayRotation); mDisplayRotation = displayRotation; mTouchRotation = touchRotation; mPreviousRotation = touchRotation; if (mRecentsActivityRotation == mTouchRotation || canRecentsActivityRotate()) { PagedOrientationHandler oldHandler = mOrientationHandler; if (mRecentsActivityRotation == mTouchRotation || (canRecentsActivityRotate() && (mFlags & FLAG_SWIPE_UP_NOT_RUNNING) != 0)) { mOrientationHandler = PagedOrientationHandler.PORTRAIT; if (DEBUG) { Log.d(TAG, "current RecentsOrientedState: " + this); } return true; } if (mTouchRotation == ROTATION_90) { } else if (mTouchRotation == ROTATION_90) { mOrientationHandler = PagedOrientationHandler.LANDSCAPE; } else if (mTouchRotation == ROTATION_270) { mOrientationHandler = PagedOrientationHandler.SEASCAPE; Loading @@ -232,7 +225,7 @@ public final class RecentsOrientedState implements SharedPreferences.OnSharedPre if (DEBUG) { Log.d(TAG, "current RecentsOrientedState: " + this); } return true; return oldHandler != mOrientationHandler; } @SurfaceRotation Loading Loading
quickstep/recents_ui_overrides/src/com/android/launcher3/hybridhotseat/HotseatPredictionController.java +0 −12 Original line number Diff line number Diff line Loading @@ -113,8 +113,6 @@ public class HotseatPredictionController implements DragController.DragListener, private AllAppsStore mAllAppsStore; private AnimatorSet mIconRemoveAnimators; private boolean mUIUpdatePaused = false; private boolean mRequiresCacheUpdate = true; private boolean mIsCacheEmpty; private boolean mIsDestroyed = false; Loading Loading @@ -350,7 +348,6 @@ public class HotseatPredictionController implements DragController.DragListener, fillGapsWithPrediction(); return; } mIsCacheEmpty = apps.isEmpty(); int count = Math.min(ranks.size(), apps.size()); List<WorkspaceItemInfo> items = new ArrayList<>(count); for (int i = 0; i < count; i++) { Loading Loading @@ -393,14 +390,7 @@ public class HotseatPredictionController implements DragController.DragListener, } updateDependencies(); fillGapsWithPrediction(); cachePredictionComponentKeysIfNecessary(componentKeys); } private void cachePredictionComponentKeysIfNecessary(ArrayList<ComponentKey> componentKeys) { if (!mRequiresCacheUpdate && componentKeys.isEmpty() == mIsCacheEmpty) return; mPredictionModel.cachePredictionComponentKeys(componentKeys); mIsCacheEmpty = componentKeys.isEmpty(); mRequiresCacheUpdate = false; } private void updateDependencies() { Loading Loading @@ -429,7 +419,6 @@ public class HotseatPredictionController implements DragController.DragListener, notifyItemAction(mPredictionModel.wrapAppTargetWithLocation(appTarget, AppTargetEvent.ACTION_PIN, workspaceItemInfo)); } mRequiresCacheUpdate = true; } private List<WorkspaceItemInfo> mapToWorkspaceItemInfo( Loading Loading @@ -583,7 +572,6 @@ public class HotseatPredictionController implements DragController.DragListener, } mDragObject = null; fillGapsWithPrediction(true, this::removeOutlineDrawings); mRequiresCacheUpdate = true; } Loading
quickstep/recents_ui_overrides/src/com/android/quickstep/util/TaskViewSimulator.java +1 −0 Original line number Diff line number Diff line Loading @@ -103,6 +103,7 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy { mSizeStrategy = sizeStrategy; mOrientationState = new RecentsOrientedState(context, sizeStrategy, i -> { }); mOrientationState.setGestureActive(true); mCurrentFullscreenParams = new FullscreenDrawParams(context); mPageSpacing = context.getResources().getDimensionPixelSize(R.dimen.recents_page_spacing); Loading
quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java +10 −3 Original line number Diff line number Diff line Loading @@ -1003,7 +1003,9 @@ public abstract class RecentsView<T extends StatefulActivity> extends PagedView mDwbToastShown = false; mActivity.getSystemUiController().updateUiState(UI_STATE_OVERVIEW, 0); LayoutUtils.setViewEnabled(mActionsView, true); mOrientationState.setGestureActive(false); if (mOrientationState.setGestureActive(false)) { updateOrientationHandler(); } } public @Nullable TaskView getRunningTaskView() { Loading Loading @@ -1041,7 +1043,10 @@ public abstract class RecentsView<T extends StatefulActivity> extends PagedView */ public void onGestureAnimationStart(int runningTaskId) { // This needs to be called before the other states are set since it can create the task view mOrientationState.setGestureActive(true); if (mOrientationState.setGestureActive(true)) { updateOrientationHandler(); } showCurrentTask(runningTaskId); setEnableFreeScroll(false); setEnableDrawingLiveTile(false); Loading Loading @@ -1104,7 +1109,9 @@ public abstract class RecentsView<T extends StatefulActivity> extends PagedView * Called when a gesture from an app has finished. */ public void onGestureAnimationEnd() { mOrientationState.setGestureActive(false); if (mOrientationState.setGestureActive(false)) { updateOrientationHandler(); } setOnScrollChangeListener(null); setEnableFreeScroll(true); Loading
quickstep/src/com/android/quickstep/util/RecentsOrientedState.java +8 −15 Original line number Diff line number Diff line Loading @@ -188,8 +188,9 @@ public final class RecentsOrientedState implements SharedPreferences.OnSharedPre /** * Sets if the swipe up gesture is currently running or not */ public void setGestureActive(boolean isGestureActive) { public boolean setGestureActive(boolean isGestureActive) { setFlag(FLAG_SWIPE_UP_NOT_RUNNING, !isGestureActive); return update(mTouchRotation, mDisplayRotation); } /** Loading @@ -202,27 +203,19 @@ public final class RecentsOrientedState implements SharedPreferences.OnSharedPre */ public boolean update( @SurfaceRotation int touchRotation, @SurfaceRotation int displayRotation) { int recentsActivityRotation = inferRecentsActivityRotation(displayRotation); if (mDisplayRotation == displayRotation && mTouchRotation == touchRotation && mRecentsActivityRotation == recentsActivityRotation) { return false; } mRecentsActivityRotation = recentsActivityRotation; mRecentsActivityRotation = inferRecentsActivityRotation(displayRotation); mDisplayRotation = displayRotation; mTouchRotation = touchRotation; mPreviousRotation = touchRotation; if (mRecentsActivityRotation == mTouchRotation || canRecentsActivityRotate()) { PagedOrientationHandler oldHandler = mOrientationHandler; if (mRecentsActivityRotation == mTouchRotation || (canRecentsActivityRotate() && (mFlags & FLAG_SWIPE_UP_NOT_RUNNING) != 0)) { mOrientationHandler = PagedOrientationHandler.PORTRAIT; if (DEBUG) { Log.d(TAG, "current RecentsOrientedState: " + this); } return true; } if (mTouchRotation == ROTATION_90) { } else if (mTouchRotation == ROTATION_90) { mOrientationHandler = PagedOrientationHandler.LANDSCAPE; } else if (mTouchRotation == ROTATION_270) { mOrientationHandler = PagedOrientationHandler.SEASCAPE; Loading @@ -232,7 +225,7 @@ public final class RecentsOrientedState implements SharedPreferences.OnSharedPre if (DEBUG) { Log.d(TAG, "current RecentsOrientedState: " + this); } return true; return oldHandler != mOrientationHandler; } @SurfaceRotation Loading