mirror of
https://github.com/gedoor/legado.git
synced 2025-08-10 00:52:30 +00:00
优化
Some checks failed
Test Build / prepare (push) Has been cancelled
Test Build / build (app, release) (push) Has been cancelled
Test Build / build (app, releaseA) (push) Has been cancelled
Test Build / prerelease (push) Has been cancelled
Test Build / lanzou (push) Has been cancelled
Test Build / test_Branch (push) Has been cancelled
Test Build / telegram (push) Has been cancelled
closeStaleIssue / stale (push) Has been cancelled
Some checks failed
Test Build / prepare (push) Has been cancelled
Test Build / build (app, release) (push) Has been cancelled
Test Build / build (app, releaseA) (push) Has been cancelled
Test Build / prerelease (push) Has been cancelled
Test Build / lanzou (push) Has been cancelled
Test Build / test_Branch (push) Has been cancelled
Test Build / telegram (push) Has been cancelled
closeStaleIssue / stale (push) Has been cancelled
This commit is contained in:
@@ -28,7 +28,7 @@ import io.legado.app.help.RuleBigDataHelp
|
||||
import io.legado.app.help.book.BookHelp
|
||||
import io.legado.app.help.config.AppConfig
|
||||
import io.legado.app.help.config.ThemeConfig.applyDayNight
|
||||
import io.legado.app.help.config.ThemeConfig.initNightMode
|
||||
import io.legado.app.help.config.ThemeConfig.applyDayNightInit
|
||||
import io.legado.app.help.coroutine.Coroutine
|
||||
import io.legado.app.help.http.Cronet
|
||||
import io.legado.app.help.http.ObsoleteUrlFactory
|
||||
@@ -60,7 +60,7 @@ class App : Application() {
|
||||
ThreadUtils.setThreadAssertsDisabledForTesting(true)
|
||||
}
|
||||
oldConfig = Configuration(resources.configuration)
|
||||
initNightMode()
|
||||
applyDayNightInit(this)
|
||||
registerActivityLifecycleCallbacks(LifecycleHelp)
|
||||
defaultSharedPreferences.registerOnSharedPreferenceChangeListener(AppConfig)
|
||||
Coroutine.async {
|
||||
|
||||
@@ -57,7 +57,12 @@ object ThemeConfig {
|
||||
postEvent(EventBus.RECREATE, "")
|
||||
}
|
||||
|
||||
fun initNightMode() {
|
||||
fun applyDayNightInit(context: Context) {
|
||||
applyTheme(context)
|
||||
initNightMode()
|
||||
}
|
||||
|
||||
private fun initNightMode() {
|
||||
val targetMode =
|
||||
if (AppConfig.isNightTheme) {
|
||||
AppCompatDelegate.MODE_NIGHT_YES
|
||||
|
||||
Reference in New Issue
Block a user