public class StatusBarCompat extends Object
| 构造器和说明 |
|---|
StatusBarCompat() |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
resetActionBarContainerTopMargin(Window window) |
static void |
resetActionBarContainerTopMargin(Window window,
int actionBarContainerId) |
static void |
setFitsSystemWindows(Window window,
boolean fitSystemWindows)
Sets whether or not this view should account for system screen decorations
|
static void |
setLightStatusBar(Window window,
boolean isLightStatusBar) |
static void |
setStatusBarColor(Activity activity,
int color) |
static void |
setStatusBarColor(Activity activity,
int color,
boolean lightStatusBar)
Set system status bar color.
|
static void |
setStatusBarColor(Window window,
int color,
boolean lightStatusBar)
Set the system status bar color
|
static void |
setTranslucent(Window window,
boolean translucent)
Set the status bar to be translucent
|
static int |
toGrey(int color)
把颜色转换成灰度值。
|
public static void setStatusBarColor(Activity activity, int color)
public static int toGrey(int color)
public static void setStatusBarColor(Activity activity, int color, boolean lightStatusBar)
activity - The activity to set.color - status bar colorlightStatusBar - if the status bar color is light. Only effective in some devices.public static void setStatusBarColor(Window window, int color, boolean lightStatusBar)
window - the windowcolor - status bar colorlightStatusBar - if the status bar color is light. Only effective in some devices.public static void setFitsSystemWindows(Window window, boolean fitSystemWindows)
window - The window to setfitSystemWindows - If true, the android content view would be applied the insetspublic static void resetActionBarContainerTopMargin(Window window)
public static void resetActionBarContainerTopMargin(Window window, int actionBarContainerId)
window - The window of the current activity.actionBarContainerId - android.support.v7.appcompat.R.id.action_bar_containerpublic static void setLightStatusBar(Window window, boolean isLightStatusBar)
window - the window will be setisLightStatusBar - if the status bar color is lightpublic static void setTranslucent(Window window, boolean translucent)
window - The window which status bar would be settranslucent - True if set the status bar to be translucent