pro版本添加自定义启动画面
This commit is contained in:
@@ -66,6 +66,7 @@ abstract class BaseActivity<VB : ViewBinding>(
|
|||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
window.decorView.disableAutoFill()
|
window.decorView.disableAutoFill()
|
||||||
initTheme()
|
initTheme()
|
||||||
|
upBackgroundImage()
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
setContentView(binding.root)
|
setContentView(binding.root)
|
||||||
setupSystemBar()
|
setupSystemBar()
|
||||||
@@ -121,7 +122,7 @@ abstract class BaseActivity<VB : ViewBinding>(
|
|||||||
|
|
||||||
open fun onCompatOptionsItemSelected(item: MenuItem) = super.onOptionsItemSelected(item)
|
open fun onCompatOptionsItemSelected(item: MenuItem) = super.onOptionsItemSelected(item)
|
||||||
|
|
||||||
private fun initTheme() {
|
open fun initTheme() {
|
||||||
when (theme) {
|
when (theme) {
|
||||||
Theme.Transparent -> setTheme(R.style.AppTheme_Transparent)
|
Theme.Transparent -> setTheme(R.style.AppTheme_Transparent)
|
||||||
Theme.Dark -> {
|
Theme.Dark -> {
|
||||||
@@ -141,6 +142,9 @@ abstract class BaseActivity<VB : ViewBinding>(
|
|||||||
window.decorView.applyBackgroundTint(backgroundColor)
|
window.decorView.applyBackgroundTint(backgroundColor)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
open fun upBackgroundImage() {
|
||||||
if (imageBg) {
|
if (imageBg) {
|
||||||
try {
|
try {
|
||||||
ThemeConfig.getBgImage(this, windowSize)?.let {
|
ThemeConfig.getBgImage(this, windowSize)?.let {
|
||||||
|
|||||||
@@ -95,6 +95,7 @@ object PreferKey {
|
|||||||
const val uploadRule = "uploadRule"
|
const val uploadRule = "uploadRule"
|
||||||
const val tocUiUseReplace = "tocUiUseReplace"
|
const val tocUiUseReplace = "tocUiUseReplace"
|
||||||
const val enableReadRecord = "enableReadRecord"
|
const val enableReadRecord = "enableReadRecord"
|
||||||
|
const val customWelcome = "customWelcome"
|
||||||
const val welcomeImage = "welcomeImagePath"
|
const val welcomeImage = "welcomeImagePath"
|
||||||
const val welcomeImageDark = "welcomeImagePathDark"
|
const val welcomeImageDark = "welcomeImagePathDark"
|
||||||
const val welcomeShowText = "welcomeShowText"
|
const val welcomeShowText = "welcomeShowText"
|
||||||
|
|||||||
@@ -69,6 +69,14 @@ open class WelcomeActivity : BaseActivity<ActivityWelcomeBinding>() {
|
|||||||
binding.root.postDelayed({ startMainActivity() }, 500)
|
binding.root.postDelayed({ startMainActivity() }, 500)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun upBackgroundImage() {
|
||||||
|
if (getPrefBoolean(PreferKey.customWelcome)) {
|
||||||
|
super.upBackgroundImage()
|
||||||
|
} else {
|
||||||
|
super.upBackgroundImage()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun startMainActivity() {
|
private fun startMainActivity() {
|
||||||
startActivity<MainActivity>()
|
startActivity<MainActivity>()
|
||||||
if (getPrefBoolean(PreferKey.defaultToRead)) {
|
if (getPrefBoolean(PreferKey.defaultToRead)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user