Add documentation for settings

This commit is contained in:
Mygod
2018-12-26 11:46:58 +08:00
parent a206d9e32c
commit 479d1bdfca
6 changed files with 61 additions and 16 deletions

View File

@@ -120,7 +120,7 @@ class SettingsPreferenceFragment : PreferenceFragmentCompat() {
true
}
findPreference("misc.source").setOnPreferenceClickListener {
(activity as MainActivity).launchUrl("https://github.com/Mygod/VPNHotspot".toUri())
(activity as MainActivity).launchUrl("https://github.com/Mygod/VPNHotspot/blob/master/README.md".toUri())
true
}
findPreference("misc.donate").setOnPreferenceClickListener {

View File

@@ -14,7 +14,7 @@ class WifiDoubleLock(lockType: Int) : AutoCloseable {
companion object : SharedPreferences.OnSharedPreferenceChangeListener {
private const val KEY = "service.wifiLock"
private val lockType get() =
WifiDoubleLock.Mode.valueOf(app.pref.getString(KEY, WifiDoubleLock.Mode.None.toString()) ?: "").lockType
WifiDoubleLock.Mode.valueOf(app.pref.getString(KEY, WifiDoubleLock.Mode.Full.toString()) ?: "").lockType
private val service by lazy { app.getSystemService<PowerManager>()!! }
private var referenceCount = 0