Merge "Hide overview and app icon split option when appropriate" into sc-v2-dev am: fb624f8501
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/15733659 Change-Id: I5db96c01c54a0bbf75eb09ae675d58df99a9f40c
This commit is contained in:
@@ -107,6 +107,13 @@ public class TaskOverlayFactory implements ResourceBasedOverride {
|
||||
|
||||
public static void addSplitOptions(List<SystemShortcut> outShortcuts,
|
||||
BaseDraggingActivity activity, TaskView taskView, DeviceProfile deviceProfile) {
|
||||
int[] taskViewTaskIds = taskView.getTaskIds();
|
||||
boolean alreadyHasMultipleTasks = taskViewTaskIds[0] != -1 &&
|
||||
taskViewTaskIds[1] != -1;
|
||||
if (alreadyHasMultipleTasks) {
|
||||
return;
|
||||
}
|
||||
|
||||
PagedOrientationHandler orientationHandler =
|
||||
taskView.getRecentsView().getPagedOrientationHandler();
|
||||
List<SplitPositionOption> positions =
|
||||
|
||||
@@ -223,7 +223,6 @@ public class OverviewActionsView<T extends OverlayUICallbacks> extends FrameLayo
|
||||
mDp = dp;
|
||||
updateVerticalMargin(SysUINavigationMode.getMode(getContext()));
|
||||
requestLayout();
|
||||
setSplitButtonVisible(mDp.isTablet);
|
||||
}
|
||||
|
||||
public void setSplitButtonVisible(boolean visible) {
|
||||
|
||||
@@ -1506,7 +1506,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
mActionsView.setDp(dp);
|
||||
mOrientationState.setDeviceProfile(dp);
|
||||
|
||||
// Update RecentsView adn TaskView's DeviceProfile dependent layout.
|
||||
// Update RecentsView and TaskView's DeviceProfile dependent layout.
|
||||
updateOrientationHandler();
|
||||
}
|
||||
|
||||
@@ -2599,7 +2599,6 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
mFirstFloatingTaskView.setAlpha(1);
|
||||
mFirstFloatingTaskView.addAnimation(anim, startingTaskRect,
|
||||
mTempRect, mSplitHiddenTaskView, true /*fadeWithThumbnail*/);
|
||||
anim.addEndListener(aBoolean -> mActionsView.setSplitButtonVisible(false));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2939,6 +2938,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
dispatchScrollChanged();
|
||||
}
|
||||
}
|
||||
updateFocusedSplitButtonVisibility();
|
||||
onDismissAnimationEnds();
|
||||
mPendingAnimation = null;
|
||||
}
|
||||
@@ -2946,6 +2946,19 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
return anim;
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows split button if
|
||||
* * We're in large screen
|
||||
* * We're not already in split
|
||||
* * There are at least 2 tasks to invoke split
|
||||
*/
|
||||
private void updateFocusedSplitButtonVisibility() {
|
||||
mActionsView.setSplitButtonVisible(mActivity.getDeviceProfile().isTablet &&
|
||||
!(getRunningTaskView() instanceof GroupedTaskView) &&
|
||||
getTaskViewCount() > 1
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all the tasks in the top row, without the focused task
|
||||
*/
|
||||
@@ -3751,7 +3764,6 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
mSecondSplitHiddenTaskView.setVisibility(VISIBLE);
|
||||
mSecondSplitHiddenTaskView = null;
|
||||
}
|
||||
mActionsView.setSplitButtonVisible(true);
|
||||
}
|
||||
|
||||
private void updateDeadZoneRects() {
|
||||
@@ -3966,6 +3978,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
@Override
|
||||
protected void notifyPageSwitchListener(int prevPage) {
|
||||
super.notifyPageSwitchListener(prevPage);
|
||||
updateFocusedSplitButtonVisibility();
|
||||
loadVisibleTaskData(TaskView.FLAG_UPDATE_ALL);
|
||||
updateEnabledOverlays();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user