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

Commit e1f366fa authored by John Spurlock's avatar John Spurlock
Browse files

Introduce new transparent bars sysui flags.

Two new public sysui flags for views to request transparent
bars:
  View.SYSTEM_UI_FLAG_TRANSPARENT_STATUS
  View.SYSTEM_UI_FLAG_TRANSPARENT_NAVIGATION

This first change simply introduces the flags at the framework
level, and makes the requisite layout tweaks to WM.

As part of this change, expunge the term "hideybars" from the
codebase. The flag to declare support for transient bars is called:
  View.SYSTEM_UI_FLAG_ALLOW_TRANSIENT

Final visuals/transitions between opaque/transparent bars will be
done as a subsequent change. Right now the transparent style is
identical to the transient bars.

Change-Id: I5ead9c5e7b77f212df5b2a5f6e770596cd2226f3
parent 1ea19f4e
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -27256,13 +27256,15 @@ package android.view {
    field public static final int SOUND_EFFECTS_ENABLED = 134217728; // 0x8000000
    field public static final deprecated int STATUS_BAR_HIDDEN = 1; // 0x1
    field public static final deprecated int STATUS_BAR_VISIBLE = 0; // 0x0
    field public static final int SYSTEM_UI_FLAG_ALLOW_OVERLAY = 2048; // 0x800
    field public static final int SYSTEM_UI_FLAG_ALLOW_TRANSIENT = 2048; // 0x800
    field public static final int SYSTEM_UI_FLAG_FULLSCREEN = 4; // 0x4
    field public static final int SYSTEM_UI_FLAG_HIDE_NAVIGATION = 2; // 0x2
    field public static final int SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN = 1024; // 0x400
    field public static final int SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION = 512; // 0x200
    field public static final int SYSTEM_UI_FLAG_LAYOUT_STABLE = 256; // 0x100
    field public static final int SYSTEM_UI_FLAG_LOW_PROFILE = 1; // 0x1
    field public static final int SYSTEM_UI_FLAG_TRANSPARENT_NAVIGATION = 8192; // 0x2000
    field public static final int SYSTEM_UI_FLAG_TRANSPARENT_STATUS = 4096; // 0x1000
    field public static final int SYSTEM_UI_FLAG_VISIBLE = 0; // 0x0
    field public static final int SYSTEM_UI_LAYOUT_FLAGS = 1536; // 0x600
    field public static final int TEXT_ALIGNMENT_CENTER = 4; // 0x4
+24 −10
Original line number Diff line number Diff line
@@ -2379,9 +2379,27 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     * when hiding the status bar with {@link #SYSTEM_UI_FLAG_FULLSCREEN} and/or hiding the
     * navigation bar with {@link #SYSTEM_UI_FLAG_HIDE_NAVIGATION} instead of having the system
     * clear these flags upon interaction.  The system may compensate by temporarily overlaying
     * transparent system ui while also delivering the event.
     * transparent system bars while also delivering the event.
     */
    public static final int SYSTEM_UI_FLAG_ALLOW_OVERLAY = 0x00000800;
    public static final int SYSTEM_UI_FLAG_ALLOW_TRANSIENT = 0x00000800;
    /**
     * Flag for {@link #setSystemUiVisibility(int)}: View would like the status bar to have
     * transparency.
     *
     * <p>The transparency request may be denied if the bar is in another mode with a specific
     * style, like {@link #SYSTEM_UI_FLAG_ALLOW_TRANSIENT transient mode}.
     */
    public static final int SYSTEM_UI_FLAG_TRANSPARENT_STATUS = 0x00001000;
    /**
     * Flag for {@link #setSystemUiVisibility(int)}: View would like the navigation bar to have
     * transparency.
     *
     * <p>The transparency request may be denied if the bar is in another mode with a specific
     * style, like {@link #SYSTEM_UI_FLAG_ALLOW_TRANSIENT transient mode}.
     */
    public static final int SYSTEM_UI_FLAG_TRANSPARENT_NAVIGATION = 0x00002000;
    /**
     * @deprecated Use {@link #SYSTEM_UI_FLAG_LOW_PROFILE} instead.
@@ -2508,11 +2526,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     * NOTE: This flag may only be used in subtreeSystemUiVisibility. It is masked
     * out of the public fields to keep the undefined bits out of the developer's way.
     *
     * Flag to specify that the status bar should temporarily overlay underlying content
     * that is otherwise assuming the status bar is hidden.  The status bar may
     * have some degree of transparency while in this temporary overlay mode.
     * Flag to specify that the status bar is displayed in transient mode.
     */
    public static final int STATUS_BAR_OVERLAY = 0x04000000;
    public static final int STATUS_BAR_TRANSIENT = 0x04000000;
    /**
     * @hide
@@ -2520,11 +2536,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     * NOTE: This flag may only be used in subtreeSystemUiVisibility. It is masked
     * out of the public fields to keep the undefined bits out of the developer's way.
     *
     * Flag to specify that the navigation bar should temporarily overlay underlying content
     * that is otherwise assuming the navigation bar is hidden.  The navigation bar mayu
     * have some degree of transparency while in this temporary overlay mode.
     * Flag to specify that the navigation bar is displayed in transient mode.
     */
    public static final int NAVIGATION_BAR_OVERLAY = 0x08000000;
    public static final int NAVIGATION_BAR_TRANSIENT = 0x08000000;
    /**
     * @hide
+1 −1
Original line number Diff line number Diff line
@@ -16,5 +16,5 @@
*/
-->
<resources>
    <item type="string" name="hideybar_confirmation_message">@string/hideybar_confirmation_message_long</item>
    <item type="string" name="hiding_navigation_confirmation_message">@string/hiding_navigation_confirmation_message_long</item>
</resources>
+1 −1
Original line number Diff line number Diff line
@@ -16,5 +16,5 @@
*/
-->
<resources>
    <item type="string" name="hideybar_confirmation_message">@string/hideybar_confirmation_message_long</item>
    <item type="string" name="hiding_navigation_confirmation_message">@string/hiding_navigation_confirmation_message_long</item>
</resources>
+2 −2
Original line number Diff line number Diff line
@@ -502,8 +502,8 @@
    <string name="status_bar_help_text">Access them anytime by swiping down.\nSwipe down again for system controls.</string>

    <!-- Toast bar message when hiding the navigation bar -->
    <string name="hideybar_confirmation_message">Swipe edge of screen to reveal bar</string>
    <string name="hiding_navigation_confirmation_message">Swipe edge of screen to reveal bar</string>

    <!-- Longer version of toast bar message when hiding the navigation bar (if room) -->
    <string name="hideybar_confirmation_message_long">Swipe from edge of screen to reveal system bar</string>
    <string name="hiding_navigation_confirmation_message_long">Swipe from edge of screen to reveal system bar</string>
</resources>
Loading