Merge "Fix small bug with DWB banners not animating out promptly" into tm-qpr-dev
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
@@ -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);
|
||||
mSnapshotView2.setVisibility(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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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(),
|
||||
@@ -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 = containerTaskView;
|
||||
mSecondSplitHiddenView.setThumbnailVisibility(INVISIBLE);
|
||||
|
||||
InteractionJankMonitorWrapper.begin(this,
|
||||
InteractionJankMonitorWrapper.CUJ_SPLIT_SCREEN_ENTER, "Second tile selected");
|
||||
|
||||
@@ -4238,13 +4235,14 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
mFirstFloatingTaskView = null;
|
||||
mSecondFloatingTaskView = null;
|
||||
mSplitInstructionsView = null;
|
||||
if (mSecondSplitHiddenView != null) {
|
||||
mSecondSplitHiddenView.setVisibility(VISIBLE);
|
||||
mSecondSplitHiddenView = null;
|
||||
}
|
||||
mSplitSelectSource = null;
|
||||
}
|
||||
|
||||
if (mSecondSplitHiddenView != null) {
|
||||
mSecondSplitHiddenView.setThumbnailVisibility(VISIBLE);
|
||||
mSecondSplitHiddenView = null;
|
||||
}
|
||||
|
||||
if (mSplitHiddenTaskViewIndex == -1) {
|
||||
return;
|
||||
}
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user