public class SystemBarHelper extends Object
hideSystemBars(android.view.Window)
will completely hide the system navigation bar and change the status bar to transparent, and
layout the screen contents (usually the illustration) behind it.Constructor and Description |
---|
SystemBarHelper() |
Modifier and Type | Method and Description |
---|---|
static void |
addVisibilityFlag(View view,
int flag)
Convenience method to add a visibility flag in addition to the existing ones.
|
static void |
addVisibilityFlag(Window window,
int flag)
Convenience method to add a visibility flag in addition to the existing ones.
|
static void |
hideSystemBars(Dialog dialog)
Hide the navigation bar for a dialog.
|
static void |
hideSystemBars(Window window)
Hide the navigation bar, make the color of the status and navigation bars transparent, and
specify
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN flag so that the content is laid-out
behind the transparent status bar. |
static void |
removeVisibilityFlag(View view,
int flag)
Convenience method to remove a visibility flag from the view, leaving other flags that are
not specified intact.
|
static void |
removeVisibilityFlag(Window window,
int flag)
Convenience method to remove a visibility flag from the window, leaving other flags that are
not specified intact.
|
static void |
setBackButtonVisible(Window window,
boolean visible) |
static void |
setImeInsetView(View view)
Set a view to be resized when the keyboard is shown.
|
static void |
showSystemBars(Dialog dialog,
Context context)
Revert the actions of hideSystemBars.
|
static void |
showSystemBars(Window window,
Context context)
Revert the actions of hideSystemBars.
|
public static void hideSystemBars(Dialog dialog)
This will only take effect in versions Lollipop or above. Otherwise this is a no-op.
public static void hideSystemBars(Window window)
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
flag so that the content is laid-out
behind the transparent status bar. This is commonly used with
Activity.getWindow()
to make the navigation and status bars follow the
Setup Wizard style.
This will only take effect in versions Lollipop or above. Otherwise this is a no-op.
public static void showSystemBars(Dialog dialog, Context context)
public static void showSystemBars(Window window, Context context)
public static void addVisibilityFlag(View view, int flag)
public static void addVisibilityFlag(Window window, int flag)
public static void removeVisibilityFlag(View view, int flag)
public static void removeVisibilityFlag(Window window, int flag)
public static void setBackButtonVisible(Window window, boolean visible)
public static void setImeInsetView(View view)
Note that you must set android.R.attr#windowSoftInputMode
to adjustResize
for this class to work. Otherwise window insets are not dispatched and this method will have
no effect.
This will only take effect in versions Lollipop or above. Otherwise this is a no-op.
view
- The view to be resized when the keyboard is shown.