Merge "[RESTRICT AUTOMERGE] Dimming on an embedded TaskFragment vs. parent Task" into sc-v2-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
446346bc4e
@@ -486,7 +486,6 @@ class Task extends TaskFragment {
|
|||||||
// root task moves and we in fact do so when moving from full screen to pinned.
|
// root task moves and we in fact do so when moving from full screen to pinned.
|
||||||
private boolean mPreserveNonFloatingState = false;
|
private boolean mPreserveNonFloatingState = false;
|
||||||
|
|
||||||
private Dimmer mDimmer = new Dimmer(this);
|
|
||||||
private final Rect mTmpDimBoundsRect = new Rect();
|
private final Rect mTmpDimBoundsRect = new Rect();
|
||||||
|
|
||||||
/** @see #setCanAffectSystemUiFlags */
|
/** @see #setCanAffectSystemUiFlags */
|
||||||
|
|||||||
@@ -162,6 +162,8 @@ class TaskFragment extends WindowContainer<WindowContainer> {
|
|||||||
*/
|
*/
|
||||||
int mMinHeight;
|
int mMinHeight;
|
||||||
|
|
||||||
|
Dimmer mDimmer = new Dimmer(this);
|
||||||
|
|
||||||
/** This task fragment will be removed when the cleanup of its children are done. */
|
/** This task fragment will be removed when the cleanup of its children are done. */
|
||||||
private boolean mIsRemovalRequested;
|
private boolean mIsRemovalRequested;
|
||||||
|
|
||||||
@@ -2352,6 +2354,34 @@ class TaskFragment extends WindowContainer<WindowContainer> {
|
|||||||
sendTaskFragmentVanished();
|
sendTaskFragmentVanished();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
Dimmer getDimmer() {
|
||||||
|
// If the window is in an embedded TaskFragment, we want to dim at the TaskFragment.
|
||||||
|
if (asTask() == null) {
|
||||||
|
return mDimmer;
|
||||||
|
}
|
||||||
|
|
||||||
|
return super.getDimmer();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
void prepareSurfaces() {
|
||||||
|
if (asTask() != null) {
|
||||||
|
super.prepareSurfaces();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
mDimmer.resetDimStates();
|
||||||
|
super.prepareSurfaces();
|
||||||
|
|
||||||
|
// Bounds need to be relative, as the dim layer is a child.
|
||||||
|
final Rect dimBounds = getBounds();
|
||||||
|
dimBounds.offsetTo(0 /* newLeft */, 0 /* newTop */);
|
||||||
|
if (mDimmer.updateDims(getPendingTransaction(), dimBounds)) {
|
||||||
|
scheduleAnimation();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
boolean canBeAnimationTarget() {
|
boolean canBeAnimationTarget() {
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user