Limit sensitivity setting to be between 0 and 4

This commit is contained in:
Finn M Glas 2020-12-30 22:13:37 +01:00
parent 40322bf5ca
commit cd2a9ed619
No known key found for this signature in database
GPG key ID: 902A30146014DFBF
2 changed files with 4 additions and 3 deletions

View file

@ -166,7 +166,7 @@ class SettingsFragmentLauncher : Fragment(), UIObject {
override fun onStartTrackingTouch(p0: SeekBar?) {}
override fun onStopTrackingTouch(p0: SeekBar?) {
launcherPreferences.edit()
.putInt(PREF_SLIDE_SENSITIVITY, p0!!.progress)
.putInt(PREF_SLIDE_SENSITIVITY, p0!!.progress * 100 / 4) // scale to %
.apply()
}
}
@ -252,6 +252,6 @@ class SettingsFragmentLauncher : Fragment(), UIObject {
}
}
settings_seekbar_sensitivity.progress = launcherPreferences.getInt(PREF_SLIDE_SENSITIVITY, 50)
settings_seekbar_sensitivity.progress = launcherPreferences.getInt(PREF_SLIDE_SENSITIVITY, 2) * 4 / 100
}
}

View file

@ -212,7 +212,8 @@
android:id="@+id/settings_seekbar_sensitivity"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:progress="50" />
android:max="4"
android:progress="2" />
</LinearLayout>