2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-22 09:58:08 +00:00

Fix invalid device name condition

This commit is contained in:
Rocket Aaron 2024-11-06 22:51:25 +08:00
parent 8b9b99275d
commit 741e24c984
No known key found for this signature in database
GPG Key ID: 28031158FFDD6853

View File

@ -80,7 +80,7 @@ class SettingsFragment : PreferenceFragmentCompat() {
setNegativeButtonText(R.string.cancel) setNegativeButtonText(R.string.cancel)
onPreferenceChangeListener = Preference.OnPreferenceChangeListener { _: Preference?, new: Any? -> onPreferenceChangeListener = Preference.OnPreferenceChangeListener { _: Preference?, new: Any? ->
val name = new as String? val name = new as String?
if (!name.isNullOrBlank()) { if (name.isNullOrBlank()) {
if (view != null) { if (view != null) {
val snackbar = Snackbar.make(requireView(), R.string.invalid_device_name, Snackbar.LENGTH_LONG) val snackbar = Snackbar.make(requireView(), R.string.invalid_device_name, Snackbar.LENGTH_LONG)
val currentTheme = resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK val currentTheme = resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK