From 4c864595bdb19bb3dea5884f385aedb012073159 Mon Sep 17 00:00:00 2001 From: Adrian Roos Date: Wed, 10 Apr 2019 14:47:57 +0200 Subject: System Bars: Ensure contrast when app requested transparent bar Bug: 129533768 Test: atest EnsureBarContrastTest Change-Id: Ib8f4045b9e8e7bf65c13437133f114d91d0cb050 --- core/java/android/view/Window.java | 64 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) (limited to 'core/java/android/view/Window.java') diff --git a/core/java/android/view/Window.java b/core/java/android/view/Window.java index 3544a8733c68..a9463e998bbb 100644 --- a/core/java/android/view/Window.java +++ b/core/java/android/view/Window.java @@ -2329,6 +2329,70 @@ public abstract class Window { return 0; } + /** + * Sets whether the system should ensure that the status bar has enough + * contrast when a fully transparent background is requested. + * + *

If set to this value, the system will determine whether a scrim is necessary + * to ensure that the status bar has enough contrast with the contents of + * this app, and set an appropriate effective bar background color accordingly. + * + *

When the status bar color has a non-zero alpha value, the value of this + * property has no effect. + * + * @see android.R.attr#ensureStatusBarContrastWhenTransparent + * @hide pending API + */ + public void setEnsureStatusBarContrastWhenTransparent(boolean ensureContrast) { + } + + /** + * Returns whether the system is ensuring that the status bar has enough contrast when a + * fully transparent background is requested. + * + *

When the status bar color has a non-zero alpha value, the value of this + * property has no effect. + * + * @see android.R.attr#ensureStatusBarContrastWhenTransparent + * @return true, if the system is ensuring contrast, false otherwise. + * @hide pending API + */ + public boolean isEnsureStatusBarContrastWhenTransparent() { + return false; + } + + /** + * Sets whether the system should ensure that the navigation bar has enough + * contrast when a fully transparent background is requested. + * + *

If set to this value, the system will determine whether a scrim is necessary + * to ensure that the navigation bar has enough contrast with the contents of + * this app, and set an appropriate effective bar background color accordingly. + * + *

When the navigation bar color has a non-zero alpha value, the value of this + * property has no effect. + * + * @see android.R.attr#ensureNavigationBarContrastWhenTransparent + * @hide pending API + */ + public void setEnsureNavigationBarContrastWhenTransparent(boolean ensureContrast) { + } + + /** + * Returns whether the system is ensuring that the navigation bar has enough contrast when a + * fully transparent background is requested. + * + *

When the navigation bar color has a non-zero alpha value, the value of this + * property has no effect. + * + * @return true, if the system is ensuring contrast, false otherwise. + * @see android.R.attr#ensureNavigationBarContrastWhenTransparent + * @hide pending API + */ + public boolean isEnsureNavigationBarContrastWhenTransparent() { + return false; + } + /** @hide */ public void setTheme(int resId) { } -- cgit v1.2.3