SmartKey icon indicating copy to clipboard operation
SmartKey copied to clipboard

⚙ 利用Kotlin委托实现优雅地持久化存储配置。

Results 3 SmartKey issues
Sort by recently updated
recently updated
newest added

Boolean类型更改无效,别的类型没事 1、var haveMask:Boolean by smartKey(true) 2、AppConfig.INSTANCE.setHaveMask(false); 杀掉进程重启,发现还是true

1. 下载 [SmartKeyDataStore.kt](https://gist.github.com/Vove7/c2b36b92121780c845232de4db45c482) 到你的项目 2. 设置 ` preferenceManager.preferenceDataStore = SmartKeyDataStore(YourConfig)` ```kotlin class SettingsFragment : PreferenceFragmentCompat() { override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { preferenceManager.preferenceDataStore = SmartKeyDataStore(AppConfig) setPreferencesFromResource(R.xml.root_preferences, rootKey) } }...