Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 217ccd2f authored by Adrian Roos's avatar Adrian Roos
Browse files

Add System UI Color API

Bug: 14564488
Change-Id: Ibebe87faeb1b730f9ac33bb5074a7b4f71b9d1c7
parent 951ecb77
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -796,7 +796,7 @@ package android {
    field public static final int manageSpaceActivity = 16842756; // 0x1010004
    field public static final int mapViewStyle = 16842890; // 0x101008a
    field public static final int marqueeRepeatLimit = 16843293; // 0x101021d
    field public static final int matchOrder = 16843861; // 0x1010455
    field public static final int matchOrder = 16843859; // 0x1010453
    field public static final int max = 16843062; // 0x1010136
    field public static final int maxDate = 16843584; // 0x1010340
    field public static final int maxEms = 16843095; // 0x1010157
@@ -829,6 +829,7 @@ package android {
    field public static final int moreIcon = 16843061; // 0x1010135
    field public static final int multiprocess = 16842771; // 0x1010013
    field public static final int name = 16842755; // 0x1010003
    field public static final int navigationBarColor = 16843862; // 0x1010456
    field public static final int navigationMode = 16843471; // 0x10102cf
    field public static final int negativeButtonText = 16843254; // 0x10101f6
    field public static final int nestedScrollingEnabled = 16843835; // 0x101043b
@@ -1083,6 +1084,7 @@ package android {
    field public static final int state_single = 16842915; // 0x10100a3
    field public static final int state_window_focused = 16842909; // 0x101009d
    field public static final int staticWallpaperPreview = 16843569; // 0x1010331
    field public static final int statusBarColor = 16843861; // 0x1010455
    field public static final int stepSize = 16843078; // 0x1010146
    field public static final int stopWithTask = 16843626; // 0x101036a
    field public static final int streamType = 16843273; // 0x1010209
@@ -1306,6 +1308,7 @@ package android {
    field public static final int windowContentTransitionManager = 16843796; // 0x1010414
    field public static final int windowContentTransitions = 16843795; // 0x1010413
    field public static final int windowDisablePreview = 16843298; // 0x1010222
    field public static final int windowDrawsSystemBarBackgrounds = 16843860; // 0x1010454
    field public static final int windowEnableSplitTouch = 16843543; // 0x1010317
    field public static final int windowEnterAnimation = 16842932; // 0x10100b4
    field public static final int windowEnterTransition = 16843836; // 0x101043c
@@ -32559,8 +32562,10 @@ package android.view {
    method protected final int getForcedWindowFlags();
    method public abstract android.view.LayoutInflater getLayoutInflater();
    method protected final int getLocalFeatures();
    method public abstract int getNavigationBarColor();
    method public android.transition.Transition getSharedElementEnterTransition();
    method public android.transition.Transition getSharedElementExitTransition();
    method public abstract int getStatusBarColor();
    method public android.transition.TransitionManager getTransitionManager();
    method public abstract int getVolumeControlStream();
    method public android.view.WindowManager getWindowManager();
@@ -32612,9 +32617,11 @@ package android.view {
    method public void setLayout(int, int);
    method public void setLocalFocus(boolean, boolean);
    method public void setLogo(int);
    method public abstract void setNavigationBarColor(int);
    method public void setSharedElementEnterTransition(android.transition.Transition);
    method public void setSharedElementExitTransition(android.transition.Transition);
    method public void setSoftInputMode(int);
    method public abstract void setStatusBarColor(int);
    method public abstract void setTitle(java.lang.CharSequence);
    method public abstract deprecated void setTitleColor(int);
    method public void setTransitionManager(android.transition.TransitionManager);
@@ -32772,6 +32779,7 @@ package android.view {
    field public static final int FLAG_DIM_BEHIND = 2; // 0x2
    field public static final int FLAG_DISMISS_KEYGUARD = 4194304; // 0x400000
    field public static final deprecated int FLAG_DITHER = 4096; // 0x1000
    field public static final int FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS = -2147483648; // 0x80000000
    field public static final int FLAG_FORCE_NOT_FULLSCREEN = 2048; // 0x800
    field public static final int FLAG_FULLSCREEN = 1024; // 0x400
    field public static final int FLAG_HARDWARE_ACCELERATED = 16777216; // 0x1000000
+40 −0
Original line number Diff line number Diff line
@@ -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);


}
+12 −1
Original line number Diff line number Diff line
@@ -914,6 +914,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.
         * 
@@ -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;

+29 −0
Original line number Diff line number Diff line
@@ -1775,6 +1775,35 @@
             finishes. Corresponds to
             {@link android.view.Window#setAllowExitTransitionOverlap(boolean)}. -->
        <attr name="windowAllowExitTransitionOverlap"/>

        <!-- Flag indicating whether this Window is responsible for drawing the background for the
             system bars. If true and the window is not floating, the system bars are drawn with a
             transparent background and the corresponding areas in this window are filled with the
             colors specified in {@link android.R.attr#statusBarColor} and
             {@link android.R.attr#navigationBarColor}. Corresponds to
             {@link android.view.WindowManager.LayoutParams#FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS}. -->
        <attr name="windowDrawsSystemBarBackgrounds" format="boolean" />

        <!-- The color for the status bar. If the 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}.
             For this to take effect, the window must be drawing the system bar backgrounds with
             {@link android.R.attr#windowDrawsSystemBarBackgrounds} and the status bar must not
             have been requested to be translucent with
             {@link android.R.attr#windowTranslucentStatus}.
             Corresponds to {@link android.view.Window#setStatusBarColor(int)}. -->
        <attr name="statusBarColor" format="color" />

        <!-- The color for the navigation bar. If the 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}.
             For this to take effect, the window must be drawing the system bar backgrounds with
             {@link android.R.attr#windowDrawsSystemBarBackgrounds} and the navigation bar must not
             have been requested to be translucent with
             {@link android.R.attr#windowTranslucentNavigation}.
             Corresponds to {@link android.view.Window#setNavigationBarColor(int)}. -->
        <attr name="navigationBarColor" format="color" />

    </declare-styleable>

    <!-- The set of attributes that describe a AlertDialog's theme. -->
+3 −0
Original line number Diff line number Diff line
@@ -2171,6 +2171,9 @@
  <public type="attr" name="targetViewName" />
  <public type="attr" name="excludeViewName" />
  <public type="attr" name="matchOrder" />
  <public type="attr" name="windowDrawsSystemBarBackgrounds" />
  <public type="attr" name="statusBarColor"/>
  <public type="attr" name="navigationBarColor"/>

  <public-padding type="dimen" name="l_resource_pad" end="0x01050010" />

Loading