|
|
@ -19,8 +19,11 @@ import kotlinx.coroutines.MainScope |
|
|
|
import kotlinx.coroutines.cancel |
|
|
|
import kotlinx.coroutines.cancel |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
abstract class BaseActivity(private val layoutID: Int, private val fullScreen: Boolean = true) : |
|
|
|
abstract class BaseActivity( |
|
|
|
AppCompatActivity(), |
|
|
|
private val layoutID: Int, |
|
|
|
|
|
|
|
private val fullScreen: Boolean = true, |
|
|
|
|
|
|
|
private val initTheme: Boolean = true |
|
|
|
|
|
|
|
) : AppCompatActivity(), |
|
|
|
CoroutineScope by MainScope() { |
|
|
|
CoroutineScope by MainScope() { |
|
|
|
|
|
|
|
|
|
|
|
override fun onCreate(savedInstanceState: Bundle?) { |
|
|
|
override fun onCreate(savedInstanceState: Bundle?) { |
|
|
@ -73,10 +76,12 @@ abstract class BaseActivity(private val layoutID: Int, private val fullScreen: B |
|
|
|
|
|
|
|
|
|
|
|
private fun initTheme() { |
|
|
|
private fun initTheme() { |
|
|
|
ATH.applyBackgroundTint(window.decorView) |
|
|
|
ATH.applyBackgroundTint(window.decorView) |
|
|
|
if (ColorUtils.isColorLight(primaryColor)) { |
|
|
|
if (initTheme) { |
|
|
|
setTheme(R.style.AppTheme_Light) |
|
|
|
if (ColorUtils.isColorLight(primaryColor)) { |
|
|
|
} else { |
|
|
|
setTheme(R.style.AppTheme_Light) |
|
|
|
setTheme(R.style.AppTheme_Dark) |
|
|
|
} else { |
|
|
|
|
|
|
|
setTheme(R.style.AppTheme_Dark) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|