Loading packages/SystemUI/src/com/android/systemui/settings/brightness/BrightnessSliderController.java +1 −2 Original line number Diff line number Diff line Loading @@ -235,8 +235,7 @@ public class BrightnessSliderController extends ViewController<BrightnessSliderV if (mBrightnessWarningToast.isToastActive()) { return; } mBrightnessWarningToast.show(mView.getContext(), R.string.quick_settings_brightness_unable_adjust_msg); mBrightnessWarningToast.show(mView.getContext(), resId); } @Override Loading packages/SystemUI/src/com/android/systemui/settings/brightness/ui/BrightnessWarningToast.kt +8 −3 Original line number Diff line number Diff line Loading @@ -37,6 +37,9 @@ constructor( private var toastView: View? = null fun show(viewContext: Context, @StringRes resId: Int) { if (isToastActive()) { return } val res = viewContext.resources // Show the brightness warning toast with passing the toast inflation required context, // userId and resId from SystemUI package. Loading Loading @@ -79,13 +82,15 @@ constructor( val inAnimator = systemUIToast.inAnimation inAnimator?.start() toastView!!.postDelayed({ toastView?.postDelayed({ val outAnimator = systemUIToast.outAnimation if (outAnimator != null) { outAnimator.start() outAnimator.addListener(object : AnimatorListenerAdapter() { override fun onAnimationEnd(animator: Animator) { if (isToastActive()) { windowManager.removeViewImmediate(toastView) } toastView = null } }) Loading @@ -94,7 +99,7 @@ constructor( } fun isToastActive(): Boolean { return toastView != null && toastView!!.isAttachedToWindow return toastView?.isAttachedToWindow == true } companion object { Loading Loading
packages/SystemUI/src/com/android/systemui/settings/brightness/BrightnessSliderController.java +1 −2 Original line number Diff line number Diff line Loading @@ -235,8 +235,7 @@ public class BrightnessSliderController extends ViewController<BrightnessSliderV if (mBrightnessWarningToast.isToastActive()) { return; } mBrightnessWarningToast.show(mView.getContext(), R.string.quick_settings_brightness_unable_adjust_msg); mBrightnessWarningToast.show(mView.getContext(), resId); } @Override Loading
packages/SystemUI/src/com/android/systemui/settings/brightness/ui/BrightnessWarningToast.kt +8 −3 Original line number Diff line number Diff line Loading @@ -37,6 +37,9 @@ constructor( private var toastView: View? = null fun show(viewContext: Context, @StringRes resId: Int) { if (isToastActive()) { return } val res = viewContext.resources // Show the brightness warning toast with passing the toast inflation required context, // userId and resId from SystemUI package. Loading Loading @@ -79,13 +82,15 @@ constructor( val inAnimator = systemUIToast.inAnimation inAnimator?.start() toastView!!.postDelayed({ toastView?.postDelayed({ val outAnimator = systemUIToast.outAnimation if (outAnimator != null) { outAnimator.start() outAnimator.addListener(object : AnimatorListenerAdapter() { override fun onAnimationEnd(animator: Animator) { if (isToastActive()) { windowManager.removeViewImmediate(toastView) } toastView = null } }) Loading @@ -94,7 +99,7 @@ constructor( } fun isToastActive(): Boolean { return toastView != null && toastView!!.isAttachedToWindow return toastView?.isAttachedToWindow == true } companion object { Loading