Class SystemBars
java.lang.Object
com.codename1.ui.SystemBars
Styles the system bars: the status bar's icon style, color and visibility, the Android navigation bar's color, and drawing behind both bars (edge to edge).
Each call is a request. A platform that cannot honor one ignores it:
iOS has no status bar color of its own (the form's title area shows
through) and no navigation bar, and the simulator ignores all of them.
#isSupported() tells whether the port styles the bars at all.
SystemBars.setStatusBarStyle(SystemBars.STYLE_LIGHT_CONTENT);
SystemBars.setStatusBarColor(0xff1a237e);
SystemBars.setNavigationBarColor(0xff1a237e, true);
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDark icons, for a light bar background.static final intLet the platform choose the icon style from the theme.static final intLight icons, for a dark bar background. -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanTrue when the port styles the system bars.static voidsetEdgeToEdge(boolean edgeToEdge) Lets the application draw behind the status and navigation bars.static voidsetNavigationBarColor(int argb, boolean lightIcons) Sets the navigation bar background color and icon style.static voidsetStatusBarColor(int argb) Sets the status bar background color.static voidsetStatusBarHidden(boolean hidden) Hides or shows the status bar.static voidsetStatusBarStyle(int style) Sets the status bar icon style.
-
Field Details
-
STYLE_DEFAULT
public static final int STYLE_DEFAULTLet the platform choose the icon style from the theme.- See Also:
-
STYLE_LIGHT_CONTENT
public static final int STYLE_LIGHT_CONTENTLight icons, for a dark bar background.- See Also:
-
STYLE_DARK_CONTENT
public static final int STYLE_DARK_CONTENTDark icons, for a light bar background.- See Also:
-
-
Method Details
-
isSupported
public static boolean isSupported()True when the port styles the system bars.
Returns
true when the calls in this class have an effect
-
setStatusBarStyle
public static void setStatusBarStyle(int style) Sets the status bar icon style.
Parameters
style:STYLE_DEFAULT,STYLE_LIGHT_CONTENTorSTYLE_DARK_CONTENT
-
setStatusBarColor
public static void setStatusBarColor(int argb) Sets the status bar background color. Android only.
Parameters
argb: the color, with alpha in the high byte
-
setStatusBarHidden
public static void setStatusBarHidden(boolean hidden) Hides or shows the status bar.
Parameters
hidden: true to hide it
-
setEdgeToEdge
public static void setEdgeToEdge(boolean edgeToEdge) Lets the application draw behind the status and navigation bars. Use the safe area insets to keep content clear of them.
Parameters
edgeToEdge: true to draw behind the bars
-