mirror of
https://github.com/LittleTurtle2333/SimplicityTools.git
synced 2026-07-13 11:51:22 +08:00
壁纸缩放功能
This commit is contained in:
@@ -395,6 +395,10 @@ fun <T> T.setLongField(field: String?, value: Long) = apply {
|
||||
XposedHelpers.setLongField(this, field, value)
|
||||
}
|
||||
|
||||
fun <T> T.setFloatField(field: String?, value: Float) = apply {
|
||||
XposedHelpers.setFloatField(this, field, value)
|
||||
}
|
||||
|
||||
fun <T> T.setObjectField(field: String?, value: Any?) = apply {
|
||||
XposedHelpers.setObjectField(this, field, value)
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import com.lt2333.simplicitytools.BuildConfig
|
||||
import de.robv.android.xposed.XSharedPreferences
|
||||
|
||||
object XSPUtils {
|
||||
var prefs = XSharedPreferences(BuildConfig.APPLICATION_ID, "config")
|
||||
private var prefs = XSharedPreferences(BuildConfig.APPLICATION_ID, "config")
|
||||
|
||||
fun getBoolean(key: String, defValue: Boolean): Boolean {
|
||||
if (prefs.hasFileChanged()) {
|
||||
@@ -18,6 +18,13 @@ object XSPUtils {
|
||||
}
|
||||
return prefs.getInt(key, defValue)
|
||||
}
|
||||
|
||||
fun getFloat(key: String, defValue: Float): Float {
|
||||
if (prefs.hasFileChanged()) {
|
||||
prefs.reload()
|
||||
}
|
||||
return prefs.getFloat(key, defValue)
|
||||
}
|
||||
}
|
||||
|
||||
inline fun hasEnable(key: String, default: Boolean = false, noinline extraCondition: (() -> Boolean)? = null, crossinline block: () -> Unit) {
|
||||
|
||||
Reference in New Issue
Block a user