mirror of
https://github.com/LittleTurtle2333/SimplicityTools.git
synced 2026-07-13 03:41:19 +08:00
更新XSPUtils
This commit is contained in:
@@ -7,12 +7,15 @@ object XSPUtils {
|
|||||||
var prefs = XSharedPreferences(BuildConfig.APPLICATION_ID, "config")
|
var prefs = XSharedPreferences(BuildConfig.APPLICATION_ID, "config")
|
||||||
|
|
||||||
fun getBoolean(key: String, defValue: Boolean): Boolean {
|
fun getBoolean(key: String, defValue: Boolean): Boolean {
|
||||||
|
|
||||||
if (prefs.hasFileChanged()) {
|
if (prefs.hasFileChanged()) {
|
||||||
prefs.reload()
|
prefs.reload()
|
||||||
}
|
}
|
||||||
|
|
||||||
return prefs.getBoolean(key, defValue)
|
return prefs.getBoolean(key, defValue)
|
||||||
|
}
|
||||||
|
fun getInt(key: String, defValue: Int): Int {
|
||||||
|
if (prefs.hasFileChanged()) {
|
||||||
|
prefs.reload()
|
||||||
|
}
|
||||||
|
return prefs.getInt(key, defValue)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user