|
|
@ -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) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|