|
|
@ -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,6 +80,7 @@ abstract class BaseActivity<VM : ViewModel> : AppCompatActivity(), CoroutineScop |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private fun setupSystemBar() { |
|
|
|
private fun setupSystemBar() { |
|
|
|
|
|
|
|
if (fullScreen) { |
|
|
|
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS or WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION) |
|
|
|
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS or WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION) |
|
|
|
window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN or View.SYSTEM_UI_FLAG_LAYOUT_STABLE |
|
|
|
window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN or View.SYSTEM_UI_FLAG_LAYOUT_STABLE |
|
|
|
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS) |
|
|
|
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS) |
|
|
@ -88,6 +89,9 @@ abstract class BaseActivity<VM : ViewModel> : AppCompatActivity(), CoroutineScop |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
window.statusBarColor = getCompatColor(R.color.status_bar_bag) |
|
|
|
window.statusBarColor = getCompatColor(R.color.status_bar_bag) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
window.statusBarColor = ThemeStore.statusBarColor(this, getPrefBoolean("transparentStatusBar")) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
open fun observeLiveBus() { |
|
|
|
open fun observeLiveBus() { |
|
|
|