Merge "Make DimLayer track changes to WindowState layer."
This commit is contained in:
committed by
Android (Google) Code Review
commit
5ae8e45ff3
@@ -84,6 +84,17 @@ public class DimLayer {
|
|||||||
return mTargetAlpha;
|
return mTargetAlpha;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void setLayer(int layer) {
|
||||||
|
if (mLayer != layer) {
|
||||||
|
mLayer = layer;
|
||||||
|
mDimSurface.setLayer(layer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int getLayer() {
|
||||||
|
return mLayer;
|
||||||
|
}
|
||||||
|
|
||||||
private void setAlpha(float alpha) {
|
private void setAlpha(float alpha) {
|
||||||
if (mAlpha != alpha) {
|
if (mAlpha != alpha) {
|
||||||
if (DEBUG) Slog.v(TAG, "setAlpha alpha=" + alpha);
|
if (DEBUG) Slog.v(TAG, "setAlpha alpha=" + alpha);
|
||||||
|
|||||||
@@ -573,10 +573,13 @@ public class WindowAnimator {
|
|||||||
|
|
||||||
final DimLayer dimAnimator = displayAnimator.mDimAnimator;
|
final DimLayer dimAnimator = displayAnimator.mDimAnimator;
|
||||||
final WindowStateAnimator winAnimator = displayAnimator.mDimWinAnimator;
|
final WindowStateAnimator winAnimator = displayAnimator.mDimWinAnimator;
|
||||||
|
final int dimLayer;
|
||||||
final float dimAmount;
|
final float dimAmount;
|
||||||
if (winAnimator == null) {
|
if (winAnimator == null) {
|
||||||
|
dimLayer = dimAnimator.getLayer();
|
||||||
dimAmount = 0;
|
dimAmount = 0;
|
||||||
} else {
|
} else {
|
||||||
|
dimLayer = winAnimator.mAnimLayer - WindowManagerService.LAYER_OFFSET_DIM;
|
||||||
dimAmount = winAnimator.mWin.mAttrs.dimAmount;
|
dimAmount = winAnimator.mWin.mAttrs.dimAmount;
|
||||||
}
|
}
|
||||||
final float targetAlpha = dimAnimator.getTargetAlpha();
|
final float targetAlpha = dimAnimator.getTargetAlpha();
|
||||||
@@ -590,9 +593,10 @@ public class WindowAnimator {
|
|||||||
if (targetAlpha > dimAmount) {
|
if (targetAlpha > dimAmount) {
|
||||||
duration = getDimBehindFadeDuration(duration);
|
duration = getDimBehindFadeDuration(duration);
|
||||||
}
|
}
|
||||||
dimAnimator.show(winAnimator.mAnimLayer -
|
dimAnimator.show(dimLayer, dimAmount, duration);
|
||||||
WindowManagerService.LAYER_OFFSET_DIM, dimAmount, duration);
|
|
||||||
}
|
}
|
||||||
|
} else if (dimAnimator.getLayer() != dimLayer) {
|
||||||
|
dimAnimator.setLayer(dimLayer);
|
||||||
}
|
}
|
||||||
if (dimAnimator.isAnimating()) {
|
if (dimAnimator.isAnimating()) {
|
||||||
if (!mService.okToDisplay()) {
|
if (!mService.okToDisplay()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user