Bind the margin ratio as a float preference and rename variables

- Fixed the floatListPreference that was used in the SettingsReaderController
- Created new extension for binding float preferences in the ReaderSettingsSheet
- Renamed the ratio variables to include the `webtoon` naming
This commit is contained in:
John Leehey
2019-12-02 14:19:22 -08:00
parent 4014c48c62
commit f14af7cf83
8 changed files with 39 additions and 26 deletions
@@ -51,7 +51,7 @@ object PreferenceKeys {
const val readWithVolumeKeysInverted = "reader_volume_keys_inverted"
const val webtoonMarginRatio = "margin_ratio"
const val marginRatioWebtoon = "margin_ratio_webtoon"
const val portraitColumns = "pref_library_columns_portrait_key"
@@ -71,6 +71,8 @@ class PreferencesHelper(val context: Context) {
fun cropBordersWebtoon() = rxPrefs.getBoolean(Keys.cropBordersWebtoon, false)
fun marginRatioWebtoon() = rxPrefs.getFloat(Keys.marginRatioWebtoon, 0f)
fun readWithTapping() = rxPrefs.getBoolean(Keys.readWithTapping, true)
fun readWithLongTap() = rxPrefs.getBoolean(Keys.readWithLongTap, true)
@@ -79,8 +81,6 @@ class PreferencesHelper(val context: Context) {
fun readWithVolumeKeysInverted() = rxPrefs.getBoolean(Keys.readWithVolumeKeysInverted, false)
fun marginRatio() = rxPrefs.getInteger(Keys.webtoonMarginRatio, 0)
fun portraitColumns() = rxPrefs.getInteger(Keys.portraitColumns, 0)
fun landscapeColumns() = rxPrefs.getInteger(Keys.landscapeColumns, 0)