diff --git a/vector/src/main/java/im/vector/app/features/settings/VectorSettingsAdvancedSettingsFragment.kt b/vector/src/main/java/im/vector/app/features/settings/VectorSettingsAdvancedSettingsFragment.kt index 1cefa17787..7c0f488b14 100644 --- a/vector/src/main/java/im/vector/app/features/settings/VectorSettingsAdvancedSettingsFragment.kt +++ b/vector/src/main/java/im/vector/app/features/settings/VectorSettingsAdvancedSettingsFragment.kt @@ -26,6 +26,7 @@ import im.vector.app.core.platform.VectorBaseActivity import im.vector.app.core.preference.VectorPreference import im.vector.app.core.preference.VectorPreferenceCategory import im.vector.app.core.preference.VectorSwitchPreference +import im.vector.app.core.resources.BuildMeta import im.vector.app.core.utils.copyToClipboard import im.vector.app.features.analytics.plan.MobileScreen import im.vector.app.features.home.NightlyProxy @@ -43,6 +44,8 @@ class VectorSettingsAdvancedSettingsFragment : @Inject lateinit var nightlyProxy: NightlyProxy + @Inject lateinit var buildMeta: BuildMeta + private var rageshake: RageShake? = null override fun onCreate(savedInstanceState: Bundle?) { @@ -112,16 +115,19 @@ class VectorSettingsAdvancedSettingsFragment : findPreference("SETTINGS_RAGE_SHAKE_CATEGORY_KEY")!!.isVisible = false } - findPreference("SETTINGS_APPLY_SC_DEFAULT_SETTINGS")?.onPreferenceClickListener = Preference.OnPreferenceClickListener { - MaterialAlertDialogBuilder(requireContext()) - .setTitle(R.string.settings_apply_sc_default_settings_dialog_title) - .setMessage(R.string.settings_apply_sc_default_settings_dialog_summary) - .setPositiveButton(R.string._continue) { _, _ -> - vectorPreferences.applyScDefaultValues() - } - .setNegativeButton(R.string.action_cancel) { _, _ -> /* Just close dialog */ } - .show() - true + findPreference("SETTINGS_APPLY_SC_DEFAULT_SETTINGS")?.let { + it.onPreferenceClickListener = Preference.OnPreferenceClickListener { + MaterialAlertDialogBuilder(requireContext()) + .setTitle(R.string.settings_apply_sc_default_settings_dialog_title) + .setMessage(R.string.settings_apply_sc_default_settings_dialog_summary) + .setPositiveButton(R.string._continue) { _, _ -> + vectorPreferences.applyScDefaultValues() + } + .setNegativeButton(R.string.action_cancel) { _, _ -> /* Just close dialog */ } + .show() + true + } + it.isVisible = buildMeta.isInternalBuild } }