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"
val configFilePath = FileUtils.getPath(App.INSTANCE.filesDir, configFileName)
val configList = arrayListOf<Config>()
init {
upConfig()
val configList: ArrayList<Config> by lazy {
val cList = getConfigs() ?: DefaultData.defaultThemeConfigs
ArrayList(cList)
}
fun upConfig() {
(getConfigs() ?: DefaultData.defaultThemeConfigs).let {
configList.clear()
configList.addAll(it)
getConfigs()?.let {
it.forEach { config ->
addConfig(config)
}
}
}

Loading…
Cancel
Save