Skip to content

Commit

Permalink
增加对底部操作栏的icon颜色变化操作
Browse files Browse the repository at this point in the history
  • Loading branch information
你需要一台永动机 committed Mar 1, 2021
1 parent 2501f9a commit 7c6492c
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions lib/src/main/java/com/pmm/ui/core/StatusNavigationBar.kt
Original file line number Diff line number Diff line change
Expand Up @@ -113,5 +113,23 @@ object StatusNavigationBar {
}


/**
* 修改底部操作栏的颜色为白色
*/
fun change2LightNavigationBar(window: Window?) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) return
val decorView = window?.decorView ?: return
decorView.systemUiVisibility = decorView.systemUiVisibility or View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR
}

/**
* 修改底部操作栏的颜色为黑色,也就是Dark模式
*/
fun change2DarkNavigationBar(window: Window?) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) return
val decorView = window?.decorView ?: return
decorView.systemUiVisibility = decorView.systemUiVisibility and View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR.inv()
}

}

0 comments on commit 7c6492c

Please sign in to comment.