壁纸缩放功能

This commit is contained in:
YuKongA
2022-03-12 15:39:20 +08:00
parent 8ba9132d4e
commit 0a8b43c344
16 changed files with 110 additions and 37 deletions

View File

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

View File

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