public class SystemBarTintManager
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
SystemBarTintManager.SystemBarConfig
Class which describes system bar sizing and other characteristics for the current
device configuration.
|
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_TINT_COLOR
The default system bar tint color value.
|
Constructor and Description |
---|
SystemBarTintManager(android.app.Activity activity)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
SystemBarTintManager.SystemBarConfig |
getConfig()
Get the system bar configuration.
|
boolean |
isNavBarTintEnabled()
Is tinting enabled for the system navigation bar?
|
boolean |
isStatusBarTintEnabled()
Is tinting enabled for the system status bar?
|
void |
setNavigationBarAlpha(float alpha)
Apply the specified alpha to the system navigation bar.
|
void |
setNavigationBarTintColor(int color)
Apply the specified color tint to the system navigation bar.
|
void |
setNavigationBarTintDrawable(android.graphics.drawable.Drawable drawable)
Apply the specified drawable to the system navigation bar.
|
void |
setNavigationBarTintEnabled(boolean enabled)
Enable tinting of the system navigation bar.
|
void |
setNavigationBarTintResource(int res)
Apply the specified drawable or color resource to the system navigation bar.
|
void |
setStatusBarAlpha(float alpha)
Apply the specified alpha to the system status bar.
|
void |
setStatusBarTintColor(int color)
Apply the specified color tint to the system status bar.
|
void |
setStatusBarTintDrawable(android.graphics.drawable.Drawable drawable)
Apply the specified drawable to the system status bar.
|
void |
setStatusBarTintEnabled(boolean enabled)
Enable tinting of the system status bar.
|
void |
setStatusBarTintResource(int res)
Apply the specified drawable or color resource to the system status bar.
|
void |
setTintAlpha(float alpha)
Apply the specified alpha to all system UI bars.
|
void |
setTintColor(int color)
Apply the specified color tint to all system UI bars.
|
void |
setTintDrawable(android.graphics.drawable.Drawable drawable)
Apply the specified drawable to all system UI bars.
|
void |
setTintResource(int res)
Apply the specified drawable or color resource to all system UI bars.
|
public static final int DEFAULT_TINT_COLOR
public SystemBarTintManager(android.app.Activity activity)
activity
- The host activity.public void setNavigationBarTintEnabled(boolean enabled)
If the platform does not have soft navigation keys, is running Jelly Bean or earlier, or translucent system UI modes have not been enabled in either the theme or via window flags, then this method does nothing.
enabled
- True to enable tinting, false to disable it (default).public void setTintColor(int color)
color
- The color of the background tint.public void setTintResource(int res)
res
- The identifier of the resource.public void setTintDrawable(android.graphics.drawable.Drawable drawable)
drawable
- The drawable to use as the background, or null to remove it.public void setTintAlpha(float alpha)
alpha
- The alpha to usepublic void setStatusBarTintColor(int color)
color
- The color of the background tint.public void setStatusBarTintResource(int res)
res
- The identifier of the resource.public void setStatusBarTintDrawable(android.graphics.drawable.Drawable drawable)
drawable
- The drawable to use as the background, or null to remove it.public void setStatusBarAlpha(float alpha)
alpha
- The alpha to usepublic void setNavigationBarTintColor(int color)
color
- The color of the background tint.public void setNavigationBarTintResource(int res)
res
- The identifier of the resource.public void setNavigationBarTintDrawable(android.graphics.drawable.Drawable drawable)
drawable
- The drawable to use as the background, or null to remove it.public void setNavigationBarAlpha(float alpha)
alpha
- The alpha to usepublic SystemBarTintManager.SystemBarConfig getConfig()
public boolean isStatusBarTintEnabled()
public void setStatusBarTintEnabled(boolean enabled)
If the platform is running Jelly Bean or earlier, or translucent system UI modes have not been enabled in either the theme or via window flags, then this method does nothing.
enabled
- True to enable tinting, false to disable it (default).public boolean isNavBarTintEnabled()