Loading packages/SystemUI/src/com/android/systemui/statusbar/policy/BrightnessMirrorController.java +8 −1 Original line number Diff line number Diff line Loading @@ -25,12 +25,14 @@ import com.android.systemui.Interpolators; import com.android.systemui.R; import com.android.systemui.statusbar.ScrimView; import com.android.systemui.statusbar.phone.StatusBarWindowView; import com.android.systemui.statusbar.stack.NotificationStackScrollLayout; /** * Controls showing and hiding of the brightness mirror. */ public class BrightnessMirrorController { private final NotificationStackScrollLayout mStackScroller; public long TRANSITION_DURATION_OUT = 150; public long TRANSITION_DURATION_IN = 200; Loading @@ -45,10 +47,13 @@ public class BrightnessMirrorController { mScrimBehind = (ScrimView) statusBarWindow.findViewById(R.id.scrim_behind); mBrightnessMirror = statusBarWindow.findViewById(R.id.brightness_mirror); mNotificationPanel = statusBarWindow.findViewById(R.id.notification_panel); mStackScroller = (NotificationStackScrollLayout) statusBarWindow.findViewById( R.id.notification_stack_scroller); } public void showMirror() { mBrightnessMirror.setVisibility(View.VISIBLE); mStackScroller.setFadedOut(true); mScrimBehind.animateViewAlpha(0.0f, TRANSITION_DURATION_OUT, Interpolators.ALPHA_OUT); outAnimation(mNotificationPanel.animate()) .withLayer(); Loading @@ -62,6 +67,7 @@ public class BrightnessMirrorController { @Override public void run() { mBrightnessMirror.setVisibility(View.INVISIBLE); mStackScroller.setFadedOut(false); } }); } Loading @@ -69,7 +75,8 @@ public class BrightnessMirrorController { private ViewPropertyAnimator outAnimation(ViewPropertyAnimator a) { return a.alpha(0.0f) .setDuration(TRANSITION_DURATION_OUT) .setInterpolator(Interpolators.ALPHA_OUT); .setInterpolator(Interpolators.ALPHA_OUT) .withEndAction(null); } private ViewPropertyAnimator inAnimation(ViewPropertyAnimator a) { return a.alpha(1.0f) Loading packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +30 −2 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.animation.PropertyValuesHolder; import android.animation.TimeAnimator; import android.animation.ValueAnimator; import android.animation.ValueAnimator.AnimatorUpdateListener; import android.annotation.FloatRange; import android.annotation.Nullable; import android.content.Context; import android.content.res.Configuration; Loading Loading @@ -327,6 +328,8 @@ public class NotificationStackScrollLayout extends ViewGroup }; private PorterDuffXfermode mSrcMode = new PorterDuffXfermode(PorterDuff.Mode.SRC); private boolean mPulsing; private boolean mDrawBackgroundAsSrc; private boolean mFadedOut; public NotificationStackScrollLayout(Context context) { this(context, null); Loading Loading @@ -439,7 +442,12 @@ public class NotificationStackScrollLayout extends ViewGroup } public void setDrawBackgroundAsSrc(boolean asSrc) { mBackgroundPaint.setXfermode(asSrc ? mSrcMode : null); mDrawBackgroundAsSrc = asSrc; updateSrcDrawing(); } private void updateSrcDrawing() { mBackgroundPaint.setXfermode(mDrawBackgroundAsSrc && !mFadedOut ? mSrcMode : null); invalidate(); } Loading Loading @@ -1743,7 +1751,9 @@ public class NotificationStackScrollLayout extends ViewGroup } private void applyCurrentBackgroundBounds() { if (!mFadedOut) { mScrimController.setExcludedBackgroundArea(mCurrentBounds); } invalidate(); } Loading Loading @@ -3421,6 +3431,24 @@ public class NotificationStackScrollLayout extends ViewGroup updateNotificationAnimationStates(); } public void setFadedOut(boolean fadingOut) { if (fadingOut != mFadedOut) { mFadedOut = fadingOut; if (fadingOut) { mScrimController.setExcludedBackgroundArea(null); } else { applyCurrentBackgroundBounds(); } updateSrcDrawing(); } } @Override public void setAlpha(@FloatRange(from = 0.0, to = 1.0) float alpha) { super.setAlpha(alpha); setFadedOut(alpha != 1.0f); } /** * A listener that is notified when some child locations might have changed. */ Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/policy/BrightnessMirrorController.java +8 −1 Original line number Diff line number Diff line Loading @@ -25,12 +25,14 @@ import com.android.systemui.Interpolators; import com.android.systemui.R; import com.android.systemui.statusbar.ScrimView; import com.android.systemui.statusbar.phone.StatusBarWindowView; import com.android.systemui.statusbar.stack.NotificationStackScrollLayout; /** * Controls showing and hiding of the brightness mirror. */ public class BrightnessMirrorController { private final NotificationStackScrollLayout mStackScroller; public long TRANSITION_DURATION_OUT = 150; public long TRANSITION_DURATION_IN = 200; Loading @@ -45,10 +47,13 @@ public class BrightnessMirrorController { mScrimBehind = (ScrimView) statusBarWindow.findViewById(R.id.scrim_behind); mBrightnessMirror = statusBarWindow.findViewById(R.id.brightness_mirror); mNotificationPanel = statusBarWindow.findViewById(R.id.notification_panel); mStackScroller = (NotificationStackScrollLayout) statusBarWindow.findViewById( R.id.notification_stack_scroller); } public void showMirror() { mBrightnessMirror.setVisibility(View.VISIBLE); mStackScroller.setFadedOut(true); mScrimBehind.animateViewAlpha(0.0f, TRANSITION_DURATION_OUT, Interpolators.ALPHA_OUT); outAnimation(mNotificationPanel.animate()) .withLayer(); Loading @@ -62,6 +67,7 @@ public class BrightnessMirrorController { @Override public void run() { mBrightnessMirror.setVisibility(View.INVISIBLE); mStackScroller.setFadedOut(false); } }); } Loading @@ -69,7 +75,8 @@ public class BrightnessMirrorController { private ViewPropertyAnimator outAnimation(ViewPropertyAnimator a) { return a.alpha(0.0f) .setDuration(TRANSITION_DURATION_OUT) .setInterpolator(Interpolators.ALPHA_OUT); .setInterpolator(Interpolators.ALPHA_OUT) .withEndAction(null); } private ViewPropertyAnimator inAnimation(ViewPropertyAnimator a) { return a.alpha(1.0f) Loading
packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +30 −2 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.animation.PropertyValuesHolder; import android.animation.TimeAnimator; import android.animation.ValueAnimator; import android.animation.ValueAnimator.AnimatorUpdateListener; import android.annotation.FloatRange; import android.annotation.Nullable; import android.content.Context; import android.content.res.Configuration; Loading Loading @@ -327,6 +328,8 @@ public class NotificationStackScrollLayout extends ViewGroup }; private PorterDuffXfermode mSrcMode = new PorterDuffXfermode(PorterDuff.Mode.SRC); private boolean mPulsing; private boolean mDrawBackgroundAsSrc; private boolean mFadedOut; public NotificationStackScrollLayout(Context context) { this(context, null); Loading Loading @@ -439,7 +442,12 @@ public class NotificationStackScrollLayout extends ViewGroup } public void setDrawBackgroundAsSrc(boolean asSrc) { mBackgroundPaint.setXfermode(asSrc ? mSrcMode : null); mDrawBackgroundAsSrc = asSrc; updateSrcDrawing(); } private void updateSrcDrawing() { mBackgroundPaint.setXfermode(mDrawBackgroundAsSrc && !mFadedOut ? mSrcMode : null); invalidate(); } Loading Loading @@ -1743,7 +1751,9 @@ public class NotificationStackScrollLayout extends ViewGroup } private void applyCurrentBackgroundBounds() { if (!mFadedOut) { mScrimController.setExcludedBackgroundArea(mCurrentBounds); } invalidate(); } Loading Loading @@ -3421,6 +3431,24 @@ public class NotificationStackScrollLayout extends ViewGroup updateNotificationAnimationStates(); } public void setFadedOut(boolean fadingOut) { if (fadingOut != mFadedOut) { mFadedOut = fadingOut; if (fadingOut) { mScrimController.setExcludedBackgroundArea(null); } else { applyCurrentBackgroundBounds(); } updateSrcDrawing(); } } @Override public void setAlpha(@FloatRange(from = 0.0, to = 1.0) float alpha) { super.setAlpha(alpha); setFadedOut(alpha != 1.0f); } /** * A listener that is notified when some child locations might have changed. */ Loading