pull/440/head
gedoor 4 years ago
parent 5368103d3a
commit 7b80ec9380
  1. 14
      app/src/main/java/io/legado/app/help/ThemeConfig.kt

@ -15,16 +15,16 @@ object ThemeConfig {
const val configFileName = "themeConfig.json" const val configFileName = "themeConfig.json"
val configFilePath = FileUtils.getPath(App.INSTANCE.filesDir, configFileName) val configFilePath = FileUtils.getPath(App.INSTANCE.filesDir, configFileName)
val configList = arrayListOf<Config>() val configList: ArrayList<Config> by lazy {
val cList = getConfigs() ?: DefaultData.defaultThemeConfigs
init { ArrayList(cList)
upConfig()
} }
fun upConfig() { fun upConfig() {
(getConfigs() ?: DefaultData.defaultThemeConfigs).let { getConfigs()?.let {
configList.clear() it.forEach { config ->
configList.addAll(it) addConfig(config)
}
} }
} }

Loading…
Cancel
Save