Fix settings crash when accelerometer unavailable

Signed-off-by: Alex Baker <alex@beeper.com>
This commit is contained in:
Alex Baker 2021-09-28 09:34:38 -05:00
parent 5929095523
commit 2d707720f6
2 changed files with 3 additions and 1 deletions

1
changelog.d/4103.bugfix Normal file
View File

@ -0,0 +1 @@
Fix settings crash when accelerometer not available

View File

@ -20,6 +20,7 @@ import androidx.preference.Preference
import androidx.preference.SeekBarPreference
import im.vector.app.R
import im.vector.app.core.platform.VectorBaseActivity
import im.vector.app.core.preference.VectorPreferenceCategory
import im.vector.app.core.preference.VectorSwitchPreference
import im.vector.app.features.rageshake.RageShake
@ -72,7 +73,7 @@ class VectorSettingsAdvancedSettingsFragment : VectorSettingsBaseFragment() {
true
}
} else {
findPreference<VectorSwitchPreference>("SETTINGS_RAGE_SHAKE_CATEGORY_KEY")!!.isVisible = false
findPreference<VectorPreferenceCategory>("SETTINGS_RAGE_SHAKE_CATEGORY_KEY")!!.isVisible = false
}
}
}