diff options
Diffstat (limited to 'core/java')
-rw-r--r-- | core/java/android/view/Window.java | 40 | ||||
-rw-r--r-- | core/java/android/view/WindowManager.java | 13 |
2 files changed, 52 insertions, 1 deletions
diff --git a/core/java/android/view/Window.java b/core/java/android/view/Window.java index 375f5e3..4acc608 100644 --- a/core/java/android/view/Window.java +++ b/core/java/android/view/Window.java @@ -1527,4 +1527,44 @@ public abstract class Window { * until the called Activity's exiting transition completes. */ public boolean getAllowExitTransitionOverlap() { return true; } + + /** + * @return the color of the status bar. + */ + public abstract int getStatusBarColor(); + + /** + * Sets the color of the status bar to {@param color}. + * + * For this to take effect, + * the window must be drawing the system bar backgrounds with + * {@link android.view.WindowManager.LayoutParams#FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS} and + * {@link android.view.WindowManager.LayoutParams#FLAG_TRANSLUCENT_STATUS} must not be set. + * + * If {@param color} is not opaque, consider setting + * {@link android.view.View#SYSTEM_UI_FLAG_LAYOUT_STABLE} and + * {@link android.view.View#SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN}. + */ + public abstract void setStatusBarColor(int color); + + /** + * @return the color of the navigation bar. + */ + public abstract int getNavigationBarColor(); + + /** + * Sets the color of the navigation bar to {@param color}. + * + * For this to take effect, + * the window must be drawing the system bar backgrounds with + * {@link android.view.WindowManager.LayoutParams#FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS} and + * {@link android.view.WindowManager.LayoutParams#FLAG_TRANSLUCENT_NAVIGATION} must not be set. + * + * If {@param color} is not opaque, consider setting + * {@link android.view.View#SYSTEM_UI_FLAG_LAYOUT_STABLE} and + * {@link android.view.View#SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION}. + */ + public abstract void setNavigationBarColor(int color); + + } diff --git a/core/java/android/view/WindowManager.java b/core/java/android/view/WindowManager.java index 032a82f..031ad80 100644 --- a/core/java/android/view/WindowManager.java +++ b/core/java/android/view/WindowManager.java @@ -915,6 +915,14 @@ public interface WindowManager extends ViewManager { public static final int FLAG_NEEDS_MENU_KEY = 0x40000000; /** + * Flag indicating that this Window is responsible for drawing the background for the + * system bars. If set, the system bars are drawn with a transparent background and the + * corresponding areas in this window are filled with the colors specified in + * {@link Window#getStatusBarColor()} and {@link Window#getNavigationBarColor()}. + */ + public static final int FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS = 0x80000000; + + /** * Various behavioral options/flags. Default is none. * * @see #FLAG_ALLOW_LOCK_WHILE_SCREEN_ON @@ -941,6 +949,7 @@ public interface WindowManager extends ViewManager { * @see #FLAG_SPLIT_TOUCH * @see #FLAG_HARDWARE_ACCELERATED * @see #FLAG_LOCAL_FOCUS_MODE + * @see #FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS */ @ViewDebug.ExportedProperty(flagMapping = { @ViewDebug.FlagToString(mask = FLAG_ALLOW_LOCK_WHILE_SCREEN_ON, equals = FLAG_ALLOW_LOCK_WHILE_SCREEN_ON, @@ -998,7 +1007,9 @@ public interface WindowManager extends ViewManager { @ViewDebug.FlagToString(mask = FLAG_TRANSLUCENT_STATUS, equals = FLAG_TRANSLUCENT_STATUS, name = "FLAG_TRANSLUCENT_STATUS"), @ViewDebug.FlagToString(mask = FLAG_TRANSLUCENT_NAVIGATION, equals = FLAG_TRANSLUCENT_NAVIGATION, - name = "FLAG_TRANSLUCENT_NAVIGATION") + name = "FLAG_TRANSLUCENT_NAVIGATION"), + @ViewDebug.FlagToString(mask = FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS, equals = FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS, + name = "FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS") }) public int flags; |