Merge branch 'dev' of https://github.com/rebelonion/Dantotsu into dev
This commit is contained in:
commit
4838e69aea
4 changed files with 15 additions and 7 deletions
|
@ -167,6 +167,7 @@ fun initActivity(a: Activity) {
|
|||
navBarHeight = insets.bottom
|
||||
}
|
||||
}
|
||||
if (a !is MainActivity) a.setNavigationTheme()
|
||||
}
|
||||
|
||||
fun Activity.hideSystemBars() {
|
||||
|
@ -178,11 +179,11 @@ fun Activity.hideSystemBars() {
|
|||
}
|
||||
|
||||
fun Activity.setNavigationTheme() {
|
||||
val a = TypedValue()
|
||||
theme.resolveAttribute(android.R.attr.colorBackground, a, true)
|
||||
if ((Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q && a.isColorType)
|
||||
|| (a.type >= TypedValue.TYPE_FIRST_COLOR_INT && a.type <= TypedValue.TYPE_LAST_COLOR_INT)) {
|
||||
window.navigationBarColor = a.data
|
||||
val tv = TypedValue()
|
||||
theme.resolveAttribute(android.R.attr.colorBackground, tv, true)
|
||||
if ((Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q && tv.isColorType)
|
||||
|| (tv.type >= TypedValue.TYPE_FIRST_COLOR_INT && tv.type <= TypedValue.TYPE_LAST_COLOR_INT)) {
|
||||
window.navigationBarColor = tv.data
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue