Bugfixes #171

Merged
AmineB merged 12 commits from bugfixes into master 2024-12-30 22:32:12 +00:00
Showing only changes of commit b7f3a9877a - Show all commits

View File

@ -105,7 +105,9 @@ class SettingsActivity :
preferenceManager.findPreference<Preference>("currentMode")?.onPreferenceChangeListener =
Preference.OnPreferenceChangeListener { _, newValue ->
AppCompatDelegate.setDefaultNightMode(newValue.toString().toInt()) // ListPreference Only takes string-arrays ¯\_(ツ)_/¯
AppCompatDelegate.setDefaultNightMode(
newValue.toString().toInt()
) // ListPreference Only takes string-arrays ¯\_(ツ)_/¯
true
}
@ -129,7 +131,8 @@ class SettingsActivity :
) {
setPreferencesFromResource(R.xml.pref_general, rootKey)
val editTextPreference = preferenceManager.findPreference<EditTextPreference>("prefer_api_items_number")
val editTextPreference =
preferenceManager.findPreference<EditTextPreference>("prefer_api_items_number")
editTextPreference?.setOnBindEditTextListener { editText ->
editText.inputType = InputType.TYPE_CLASS_NUMBER
editText.filters =
@ -139,8 +142,11 @@ class SettingsActivity :
val input: Int = (dest.toString() + source.toString()).toInt()
if (input in 1..200) return@InputFilter null
} catch (nfe: NumberFormatException) {
nfe.sendSilentlyWithAcraWithName("GeneralPreferenceFragment")
Toast.makeText(activity, R.string.items_number_should_be_number, Toast.LENGTH_LONG).show()
Toast.makeText(
activity,
R.string.items_number_should_be_number,
Toast.LENGTH_LONG
).show()
}
""
},
@ -222,7 +228,9 @@ class SettingsActivity :
preferenceManager.findPreference<Preference>("currentMode")?.onPreferenceChangeListener =
Preference.OnPreferenceChangeListener { _, newValue ->
AppCompatDelegate.setDefaultNightMode(newValue.toString().toInt()) // ListPreference Only takes string-arrays ¯\_(ツ)_/¯
AppCompatDelegate.setDefaultNightMode(
newValue.toString().toInt()
) // ListPreference Only takes string-arrays ¯\_(ツ)_/¯
true
}
}
@ -268,4 +276,4 @@ class SettingsActivity :
setPreferencesFromResource(R.xml.pref_experimental, rootKey)
}
}
}
}