|
|
@ -20,7 +20,7 @@ import kotlinx.coroutines.MainScope |
|
|
|
import kotlinx.coroutines.cancel |
|
|
|
import kotlinx.coroutines.cancel |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
abstract class BaseActivity<VM : ViewModel> : AppCompatActivity(), CoroutineScope by MainScope() { |
|
|
|
abstract class BaseActivity<VM : ViewModel>(private var fullScreen: Boolean = true) : AppCompatActivity(), CoroutineScope by MainScope() { |
|
|
|
|
|
|
|
|
|
|
|
protected abstract val viewModel: VM |
|
|
|
protected abstract val viewModel: VM |
|
|
|
|
|
|
|
|
|
|
@ -80,13 +80,17 @@ abstract class BaseActivity<VM : ViewModel> : AppCompatActivity(), CoroutineScop |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private fun setupSystemBar() { |
|
|
|
private fun setupSystemBar() { |
|
|
|
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS or WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION) |
|
|
|
if (fullScreen) { |
|
|
|
window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN or View.SYSTEM_UI_FLAG_LAYOUT_STABLE |
|
|
|
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS or WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION) |
|
|
|
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS) |
|
|
|
window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN or View.SYSTEM_UI_FLAG_LAYOUT_STABLE |
|
|
|
if (getPrefBoolean("transparentStatusBar")) { |
|
|
|
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS) |
|
|
|
window.statusBarColor = Color.TRANSPARENT |
|
|
|
if (getPrefBoolean("transparentStatusBar")) { |
|
|
|
|
|
|
|
window.statusBarColor = Color.TRANSPARENT |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
window.statusBarColor = getCompatColor(R.color.status_bar_bag) |
|
|
|
|
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
window.statusBarColor = getCompatColor(R.color.status_bar_bag) |
|
|
|
window.statusBarColor = ThemeStore.statusBarColor(this, getPrefBoolean("transparentStatusBar")) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|