Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java +18 −0 Original line number Original line Diff line number Diff line Loading @@ -754,6 +754,16 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo } } private void onFinished(Callback callback) { private void onFinished(Callback callback) { if (!hasReachedFinalState(mScrimBehind) || !hasReachedFinalState(mScrimInFront) || !hasReachedFinalState(mScrimForBubble)) { if (callback != null && callback != mCallback) { // Since we only notify the callback that we're finished once everything has // finished, we need to make sure that any changing callbacks are also invoked callback.onFinished(); } return; } if (mWakeLockHeld) { if (mWakeLockHeld) { mWakeLock.release(TAG); mWakeLock.release(TAG); mWakeLockHeld = false; mWakeLockHeld = false; Loading @@ -773,7 +783,15 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo mInFrontTint = Color.TRANSPARENT; mInFrontTint = Color.TRANSPARENT; mBehindTint = Color.TRANSPARENT; mBehindTint = Color.TRANSPARENT; mBubbleTint = Color.TRANSPARENT; mBubbleTint = Color.TRANSPARENT; updateScrimColor(mScrimInFront, mInFrontAlpha, mInFrontTint); updateScrimColor(mScrimBehind, mBehindAlpha, mBehindTint); updateScrimColor(mScrimForBubble, mBubbleAlpha, mBubbleTint); } } } private boolean hasReachedFinalState(ScrimView scrim) { return scrim.getViewAlpha() == getCurrentScrimAlpha(scrim) && scrim.getTint() == getCurrentScrimTint(scrim); } } private boolean isAnimating(View scrim) { private boolean isAnimating(View scrim) { Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java +1 −0 Original line number Original line Diff line number Diff line Loading @@ -433,6 +433,7 @@ public class ScrimControllerTest extends SysuiTestCase { TRANSPARENT /* behind */, TRANSPARENT /* behind */, TRANSPARENT /* bubble */); TRANSPARENT /* bubble */); // Make sure at the very end of the animation, we're reset to transparent assertScrimTint(false /* front */, assertScrimTint(false /* front */, false /* behind */, false /* behind */, false /* bubble */); false /* bubble */); Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java +18 −0 Original line number Original line Diff line number Diff line Loading @@ -754,6 +754,16 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo } } private void onFinished(Callback callback) { private void onFinished(Callback callback) { if (!hasReachedFinalState(mScrimBehind) || !hasReachedFinalState(mScrimInFront) || !hasReachedFinalState(mScrimForBubble)) { if (callback != null && callback != mCallback) { // Since we only notify the callback that we're finished once everything has // finished, we need to make sure that any changing callbacks are also invoked callback.onFinished(); } return; } if (mWakeLockHeld) { if (mWakeLockHeld) { mWakeLock.release(TAG); mWakeLock.release(TAG); mWakeLockHeld = false; mWakeLockHeld = false; Loading @@ -773,7 +783,15 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo mInFrontTint = Color.TRANSPARENT; mInFrontTint = Color.TRANSPARENT; mBehindTint = Color.TRANSPARENT; mBehindTint = Color.TRANSPARENT; mBubbleTint = Color.TRANSPARENT; mBubbleTint = Color.TRANSPARENT; updateScrimColor(mScrimInFront, mInFrontAlpha, mInFrontTint); updateScrimColor(mScrimBehind, mBehindAlpha, mBehindTint); updateScrimColor(mScrimForBubble, mBubbleAlpha, mBubbleTint); } } } private boolean hasReachedFinalState(ScrimView scrim) { return scrim.getViewAlpha() == getCurrentScrimAlpha(scrim) && scrim.getTint() == getCurrentScrimTint(scrim); } } private boolean isAnimating(View scrim) { private boolean isAnimating(View scrim) { Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java +1 −0 Original line number Original line Diff line number Diff line Loading @@ -433,6 +433,7 @@ public class ScrimControllerTest extends SysuiTestCase { TRANSPARENT /* behind */, TRANSPARENT /* behind */, TRANSPARENT /* bubble */); TRANSPARENT /* bubble */); // Make sure at the very end of the animation, we're reset to transparent assertScrimTint(false /* front */, assertScrimTint(false /* front */, false /* behind */, false /* behind */, false /* bubble */); false /* bubble */); Loading