mirror of
https://github.com/cmclark00/RetroMusicPlayer.git
synced 2025-05-19 16:45:20 +01:00
Edge-to-edge Code cleanup
This commit is contained in:
parent
421dc817a2
commit
5d8ad186d5
13 changed files with 29 additions and 29 deletions
|
@ -11,13 +11,11 @@ import androidx.core.view.WindowInsetsCompat
|
|||
import androidx.core.view.WindowInsetsControllerCompat
|
||||
import androidx.fragment.app.FragmentActivity
|
||||
import code.name.monkey.appthemehelper.ATH
|
||||
import code.name.monkey.appthemehelper.ThemeStore
|
||||
import code.name.monkey.appthemehelper.util.ATHUtil
|
||||
import code.name.monkey.appthemehelper.util.ColorUtil
|
||||
import code.name.monkey.appthemehelper.util.VersionUtils
|
||||
import code.name.monkey.retromusic.R
|
||||
import code.name.monkey.retromusic.util.PreferenceUtil
|
||||
import code.name.monkey.retromusic.util.RetroUtil
|
||||
|
||||
fun AppCompatActivity.toggleScreenOn() {
|
||||
if (PreferenceUtil.isScreenOnEnabled) {
|
||||
|
@ -60,9 +58,13 @@ private fun AppCompatActivity.hideStatusBar(fullscreen: Boolean) {
|
|||
}
|
||||
}
|
||||
|
||||
fun AppCompatActivity.setDrawUnderStatusBar() {
|
||||
fun AppCompatActivity.setDrawBehindSystemBars() {
|
||||
WindowCompat.setDecorFitsSystemWindows(window, false)
|
||||
window.statusBarColor = Color.TRANSPARENT
|
||||
window.navigationBarColor = Color.TRANSPARENT
|
||||
if (VersionUtils.hasQ()) {
|
||||
window.isNavigationBarContrastEnforced = false
|
||||
}
|
||||
}
|
||||
|
||||
fun FragmentActivity.setTaskDescriptionColor(color: Int) {
|
||||
|
@ -100,9 +102,7 @@ fun AppCompatActivity.setLightStatusBarAuto(bgColor: Int) {
|
|||
}
|
||||
|
||||
fun AppCompatActivity.setLightNavigationBar(enabled: Boolean) {
|
||||
if (!ATHUtil.isWindowBackgroundDark(this) and ThemeStore.coloredNavigationBar(this)) {
|
||||
ATH.setLightNavigationBar(this, enabled)
|
||||
}
|
||||
ATH.setLightNavigationBar(this, enabled)
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue