Loading quickstep/src/com/android/quickstep/views/DigitalWellBeingToast.java +8 −0 Original line number Diff line number Diff line Loading @@ -385,4 +385,12 @@ public final class DigitalWellBeingToast { mBanner.setLayerType(View.LAYER_TYPE_HARDWARE, layerPaint); mBanner.setLayerPaint(layerPaint); } void setBannerVisibility(int visibility) { if (mBanner == null) { return; } mBanner.setVisibility(visibility); } } quickstep/src/com/android/quickstep/views/GroupedTaskView.java +23 −5 Original line number Diff line number Diff line Loading @@ -230,11 +230,12 @@ public class GroupedTaskView extends TaskView { } @Override protected int getChildTaskIndexAtPosition(PointF position) { if (isCoordInView(mIconView2, position) || isCoordInView(mSnapshotView2, position)) { protected int getLastSelectedChildTaskIndex() { if (isCoordInView(mIconView2, mLastTouchDownPosition) || isCoordInView(mSnapshotView2, mLastTouchDownPosition)) { return 1; } return super.getChildTaskIndexAtPosition(position); return super.getLastSelectedChildTaskIndex(); } private boolean isCoordInView(View v, PointF position) { Loading Loading @@ -336,9 +337,26 @@ public class GroupedTaskView extends TaskView { mSnapshotView2.setSplashAlpha(mTaskThumbnailSplashAlpha); } /** * Sets visibility for thumbnails and associated elements (DWB banners). * IconView is unaffected. * * When setting INVISIBLE, sets the visibility for the last selected child task. * When setting VISIBLE (as a reset), sets the visibility for both tasks. */ @Override void setThumbnailVisibility(int visibility) { super.setThumbnailVisibility(visibility); if (visibility == VISIBLE) { mSnapshotView.setVisibility(visibility); mDigitalWellBeingToast.setBannerVisibility(visibility); mSnapshotView2.setVisibility(visibility); mDigitalWellBeingToast2.setBannerVisibility(visibility); } else if (getLastSelectedChildTaskIndex() == 0) { mSnapshotView.setVisibility(visibility); mDigitalWellBeingToast.setBannerVisibility(visibility); } else { mSnapshotView2.setVisibility(visibility); mDigitalWellBeingToast2.setBannerVisibility(visibility); } } } quickstep/src/com/android/quickstep/views/RecentsView.java +10 −16 Original line number Diff line number Diff line Loading @@ -655,7 +655,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T @Nullable private TaskView mSplitHiddenTaskView; @Nullable private View mSecondSplitHiddenView; private TaskView mSecondSplitHiddenView; @Nullable private SplitBounds mSplitBoundsConfig; private final Toast mSplitToast = Toast.makeText(getContext(), Loading Loading @@ -4211,13 +4211,10 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T aBoolean1 -> RecentsView.this.resetFromSplitSelectionState()); InteractionJankMonitorWrapper.end(InteractionJankMonitorWrapper.CUJ_SPLIT_SCREEN_ENTER); }); if (containerTaskView.containsMultipleTasks()) { // If we are launching from a child task, then only hide the thumbnail itself mSecondSplitHiddenView = thumbnailView; } else { mSecondSplitHiddenView = containerTaskView; } mSecondSplitHiddenView.setVisibility(INVISIBLE); mSecondSplitHiddenView.setThumbnailVisibility(INVISIBLE); InteractionJankMonitorWrapper.begin(this, InteractionJankMonitorWrapper.CUJ_SPLIT_SCREEN_ENTER, "Second tile selected"); Loading @@ -4238,12 +4235,13 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T mFirstFloatingTaskView = null; mSecondFloatingTaskView = null; mSplitInstructionsView = null; mSplitSelectSource = null; } if (mSecondSplitHiddenView != null) { mSecondSplitHiddenView.setVisibility(VISIBLE); mSecondSplitHiddenView.setThumbnailVisibility(VISIBLE); mSecondSplitHiddenView = null; } mSplitSelectSource = null; } if (mSplitHiddenTaskViewIndex == -1) { return; Loading @@ -4260,10 +4258,6 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T onLayout(false /* changed */, getLeft(), getTop(), getRight(), getBottom()); resetTaskVisuals(); mSplitHiddenTaskViewIndex = -1; if (mSplitHiddenTaskView != null) { mSplitHiddenTaskView.setThumbnailVisibility(VISIBLE); mSplitHiddenTaskView = null; } } private void safeRemoveDragLayerView(@Nullable View viewToRemove) { Loading quickstep/src/com/android/quickstep/views/TaskView.java +14 −5 Original line number Diff line number Diff line Loading @@ -387,7 +387,7 @@ public class TaskView extends FrameLayout implements Reusable { private final float[] mIconCenterCoords = new float[2]; private final PointF mLastTouchDownPosition = new PointF(); protected final PointF mLastTouchDownPosition = new PointF(); private boolean mIsClickableAsLiveTile = true; Loading Loading @@ -584,16 +584,16 @@ public class TaskView extends FrameLayout implements Reusable { * second app. {@code false} otherwise */ private boolean confirmSecondSplitSelectApp() { int index = getChildTaskIndexAtPosition(mLastTouchDownPosition); int index = getLastSelectedChildTaskIndex(); TaskIdAttributeContainer container = mTaskIdAttributeContainer[index]; return getRecentsView().confirmSplitSelect(this, container.getTask(), container.getIconView(), container.getThumbnailView()); } /** * Returns the task under the given position in the local coordinates of this task view. * Returns the task index of the last selected child task (0 or 1). */ protected int getChildTaskIndexAtPosition(PointF position) { protected int getLastSelectedChildTaskIndex() { return 0; } Loading Loading @@ -1516,8 +1516,17 @@ public class TaskView extends FrameLayout implements Reusable { return display != null ? display.getDisplayId() : DEFAULT_DISPLAY; } /** * Sets visibility for the thumbnail and associated elements (DWB banners and action chips). * IconView is unaffected. */ void setThumbnailVisibility(int visibility) { mSnapshotView.setVisibility(visibility); for (int i = 0; i < getChildCount(); i++) { View child = getChildAt(i); if (child != mIconView) { child.setVisibility(visibility); } } } /** Loading Loading
quickstep/src/com/android/quickstep/views/DigitalWellBeingToast.java +8 −0 Original line number Diff line number Diff line Loading @@ -385,4 +385,12 @@ public final class DigitalWellBeingToast { mBanner.setLayerType(View.LAYER_TYPE_HARDWARE, layerPaint); mBanner.setLayerPaint(layerPaint); } void setBannerVisibility(int visibility) { if (mBanner == null) { return; } mBanner.setVisibility(visibility); } }
quickstep/src/com/android/quickstep/views/GroupedTaskView.java +23 −5 Original line number Diff line number Diff line Loading @@ -230,11 +230,12 @@ public class GroupedTaskView extends TaskView { } @Override protected int getChildTaskIndexAtPosition(PointF position) { if (isCoordInView(mIconView2, position) || isCoordInView(mSnapshotView2, position)) { protected int getLastSelectedChildTaskIndex() { if (isCoordInView(mIconView2, mLastTouchDownPosition) || isCoordInView(mSnapshotView2, mLastTouchDownPosition)) { return 1; } return super.getChildTaskIndexAtPosition(position); return super.getLastSelectedChildTaskIndex(); } private boolean isCoordInView(View v, PointF position) { Loading Loading @@ -336,9 +337,26 @@ public class GroupedTaskView extends TaskView { mSnapshotView2.setSplashAlpha(mTaskThumbnailSplashAlpha); } /** * Sets visibility for thumbnails and associated elements (DWB banners). * IconView is unaffected. * * When setting INVISIBLE, sets the visibility for the last selected child task. * When setting VISIBLE (as a reset), sets the visibility for both tasks. */ @Override void setThumbnailVisibility(int visibility) { super.setThumbnailVisibility(visibility); if (visibility == VISIBLE) { mSnapshotView.setVisibility(visibility); mDigitalWellBeingToast.setBannerVisibility(visibility); mSnapshotView2.setVisibility(visibility); mDigitalWellBeingToast2.setBannerVisibility(visibility); } else if (getLastSelectedChildTaskIndex() == 0) { mSnapshotView.setVisibility(visibility); mDigitalWellBeingToast.setBannerVisibility(visibility); } else { mSnapshotView2.setVisibility(visibility); mDigitalWellBeingToast2.setBannerVisibility(visibility); } } }
quickstep/src/com/android/quickstep/views/RecentsView.java +10 −16 Original line number Diff line number Diff line Loading @@ -655,7 +655,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T @Nullable private TaskView mSplitHiddenTaskView; @Nullable private View mSecondSplitHiddenView; private TaskView mSecondSplitHiddenView; @Nullable private SplitBounds mSplitBoundsConfig; private final Toast mSplitToast = Toast.makeText(getContext(), Loading Loading @@ -4211,13 +4211,10 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T aBoolean1 -> RecentsView.this.resetFromSplitSelectionState()); InteractionJankMonitorWrapper.end(InteractionJankMonitorWrapper.CUJ_SPLIT_SCREEN_ENTER); }); if (containerTaskView.containsMultipleTasks()) { // If we are launching from a child task, then only hide the thumbnail itself mSecondSplitHiddenView = thumbnailView; } else { mSecondSplitHiddenView = containerTaskView; } mSecondSplitHiddenView.setVisibility(INVISIBLE); mSecondSplitHiddenView.setThumbnailVisibility(INVISIBLE); InteractionJankMonitorWrapper.begin(this, InteractionJankMonitorWrapper.CUJ_SPLIT_SCREEN_ENTER, "Second tile selected"); Loading @@ -4238,12 +4235,13 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T mFirstFloatingTaskView = null; mSecondFloatingTaskView = null; mSplitInstructionsView = null; mSplitSelectSource = null; } if (mSecondSplitHiddenView != null) { mSecondSplitHiddenView.setVisibility(VISIBLE); mSecondSplitHiddenView.setThumbnailVisibility(VISIBLE); mSecondSplitHiddenView = null; } mSplitSelectSource = null; } if (mSplitHiddenTaskViewIndex == -1) { return; Loading @@ -4260,10 +4258,6 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T onLayout(false /* changed */, getLeft(), getTop(), getRight(), getBottom()); resetTaskVisuals(); mSplitHiddenTaskViewIndex = -1; if (mSplitHiddenTaskView != null) { mSplitHiddenTaskView.setThumbnailVisibility(VISIBLE); mSplitHiddenTaskView = null; } } private void safeRemoveDragLayerView(@Nullable View viewToRemove) { Loading
quickstep/src/com/android/quickstep/views/TaskView.java +14 −5 Original line number Diff line number Diff line Loading @@ -387,7 +387,7 @@ public class TaskView extends FrameLayout implements Reusable { private final float[] mIconCenterCoords = new float[2]; private final PointF mLastTouchDownPosition = new PointF(); protected final PointF mLastTouchDownPosition = new PointF(); private boolean mIsClickableAsLiveTile = true; Loading Loading @@ -584,16 +584,16 @@ public class TaskView extends FrameLayout implements Reusable { * second app. {@code false} otherwise */ private boolean confirmSecondSplitSelectApp() { int index = getChildTaskIndexAtPosition(mLastTouchDownPosition); int index = getLastSelectedChildTaskIndex(); TaskIdAttributeContainer container = mTaskIdAttributeContainer[index]; return getRecentsView().confirmSplitSelect(this, container.getTask(), container.getIconView(), container.getThumbnailView()); } /** * Returns the task under the given position in the local coordinates of this task view. * Returns the task index of the last selected child task (0 or 1). */ protected int getChildTaskIndexAtPosition(PointF position) { protected int getLastSelectedChildTaskIndex() { return 0; } Loading Loading @@ -1516,8 +1516,17 @@ public class TaskView extends FrameLayout implements Reusable { return display != null ? display.getDisplayId() : DEFAULT_DISPLAY; } /** * Sets visibility for the thumbnail and associated elements (DWB banners and action chips). * IconView is unaffected. */ void setThumbnailVisibility(int visibility) { mSnapshotView.setVisibility(visibility); for (int i = 0; i < getChildCount(); i++) { View child = getChildAt(i); if (child != mIconView) { child.setVisibility(visibility); } } } /** Loading