Match ReaderActivity theme with the rest of the app (#5450)

* Match ReaderActivity theme with the rest of the app

* Fix viewer inset when fullscreen reader is off

* Fix incorrect toolbar color after recreate

* Remove animated inset

* Move isDarkMode to PreferencesHelper
This commit is contained in:
Ivan Iskandar
2021-06-26 10:28:19 +07:00
committed by GitHub
parent feddd9285d
commit 64c95305b9
9 changed files with 113 additions and 169 deletions

View File

@@ -3,32 +3,11 @@ package eu.kanade.tachiyomi.util.view
import android.content.Context
import android.graphics.Color
import android.os.Build
import android.view.View
import android.view.Window
import android.view.WindowManager
import eu.kanade.tachiyomi.util.system.InternalResourceHelper
import eu.kanade.tachiyomi.util.system.getResourceColor
fun Window.showBar() {
decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN or
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION or
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
}
fun Window.hideBar() {
decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN or
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION or
View.SYSTEM_UI_FLAG_FULLSCREEN or
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION or
View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
}
fun Window.defaultBar() {
decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_VISIBLE
}
fun Window.isDefaultBar() = decorView.systemUiVisibility == View.SYSTEM_UI_FLAG_VISIBLE
/**
* Sets navigation bar color to transparent if system's config_navBarNeedsScrim is false,
* otherwise it will use the theme navigationBarColor with 70% opacity.