Skip to content

Commit

Permalink
add documents
Browse files Browse the repository at this point in the history
  • Loading branch information
niorgai committed Nov 7, 2016
1 parent 431ba1c commit f691c71
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions library/src/main/java/qiu/niorgai/StatusBarCompatKitKat.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ private static void removeMarginTopOfContentChild(View mContentChild, int status

/**
* set StatusBarColor
*
* 1. set Window Flag : WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS
* 2. removeFakeStatusBarViewIfExist
* 3. addFakeStatusBarView
Expand All @@ -126,6 +127,7 @@ static void setStatusBarColor(Activity activity, int statusColor) {

/**
* translucentStatusBar
*
* 1. set Window Flag : WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS
* 2. removeFakeStatusBarViewIfExist
* 3. removeMarginTopOfContentChild
Expand All @@ -147,6 +149,7 @@ static void translucentStatusBar(Activity activity) {

/**
* compat for CollapsingToolbarLayout
*
* 1. set Window Flag : WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS
* 2. set FitsSystemWindows for views.
* 3. removeFakeStatusBarViewIfExist
Expand Down
14 changes: 14 additions & 0 deletions library/src/main/java/qiu/niorgai/StatusBarCompatLollipop.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ private static int getStatusBarHeight(Context context) {

/**
* set StatusBarColor
*
* 1. set Flags to call setStatusBarColor
* 2. call setSystemUiVisibility to clear translucentStatusBar's Flag.
* 3. set FitsSystemWindows to false
*/
static void setStatusBarColor(Activity activity, int statusColor) {
Window window = activity.getWindow();
Expand All @@ -56,6 +60,10 @@ static void setStatusBarColor(Activity activity, int statusColor) {

/**
* translucentStatusBar(full-screen)
*
* 1. set Flags to full-screen
* 2. set FitsSystemWindows to false
*
* @param hideStatusBarBackground hide statusBar's shadow
*/
static void translucentStatusBar(Activity activity, boolean hideStatusBarBackground) {
Expand All @@ -81,6 +89,12 @@ static void translucentStatusBar(Activity activity, boolean hideStatusBarBackgro

/**
* compat for CollapsingToolbarLayout
*
* 1. change to full-screen mode(like translucentStatusBar).
* 2. set View's FitsSystemWindow to false.
* 3. adjust toolbar's height to layout.
* 4. cancel CollapsingToolbarLayout's WindowInsets, let it layout as normal.
* 5. call setStatusBarScrimColor to set Color.
*/
static void setStatusBarColorForCollapsingToolbar(Activity activity, final AppBarLayout appBarLayout, CollapsingToolbarLayout collapsingToolbarLayout,
Toolbar toolbar, int statusColor) {
Expand Down

0 comments on commit f691c71

Please sign in to comment.