Add cancel buttons to tag watching and tag filtering settings. Fix the - sign saying there was a input error in the tag filtering input

This commit is contained in:
Jobobby04 2020-07-20 20:54:39 -04:00
parent 2ee69c2ac4
commit f3b6855684

View File

@ -243,7 +243,7 @@ class SettingsEhController : SettingsController() {
val inputField = dialog.getInputField() val inputField = dialog.getInputField()
val value = number.toString().toIntOrNull() val value = number.toString().toIntOrNull()
if (value != null && value in -9999..0) { if ((value != null && value in -9999..0) || number.toString() == "-") {
inputField.error = null inputField.error = null
} else { } else {
inputField.error = context.getString(R.string.tag_filtering_threshhold_error) inputField.error = context.getString(R.string.tag_filtering_threshhold_error)
@ -256,6 +256,7 @@ class SettingsEhController : SettingsController() {
summary = context.getString(R.string.tag_filtering_threshhold_summary, preferences.ehTagFilterValue().get()) summary = context.getString(R.string.tag_filtering_threshhold_summary, preferences.ehTagFilterValue().get())
preferences.ehTagFilterValue().reconfigure() preferences.ehTagFilterValue().reconfigure()
} }
.negativeButton(android.R.string.cancel)
.show() .show()
} }
}.dependency = PreferenceKeys.eh_enableExHentai }.dependency = PreferenceKeys.eh_enableExHentai
@ -292,6 +293,7 @@ class SettingsEhController : SettingsController() {
summary = context.getString(R.string.tag_watching_threshhold_summary, preferences.ehTagWatchingValue().get()) summary = context.getString(R.string.tag_watching_threshhold_summary, preferences.ehTagWatchingValue().get())
preferences.ehTagWatchingValue().reconfigure() preferences.ehTagWatchingValue().reconfigure()
} }
.negativeButton(android.R.string.cancel)
.show() .show()
} }
}.dependency = PreferenceKeys.eh_enableExHentai }.dependency = PreferenceKeys.eh_enableExHentai