Skip to content

Commit

Permalink
Update ThemeUtils tool class.
Browse files Browse the repository at this point in the history
  • Loading branch information
xbdcc committed May 27, 2019
1 parent 07c982d commit ab0dfa4
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions cutils/src/main/java/com/carlos/cutils/util/ThemeUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,22 @@ object ThemeUtils {
isFitSystemWindow
}

/**
* hide top and bottom bar.
*/
fun hideBottomUIMenu(activity: Activity) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
val decorView = activity.window.decorView
val uiOptions =
View.SYSTEM_UI_FLAG_LAYOUT_STABLE or
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION or
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN or
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION or // hide nav bar
View.SYSTEM_UI_FLAG_FULLSCREEN or // hide status bar
View.SYSTEM_UI_FLAG_IMMERSIVE
decorView.systemUiVisibility = uiOptions
activity.window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION)
}
}

}

0 comments on commit ab0dfa4

Please sign in to comment.