diff --git a/changelog.d/6646.misc b/changelog.d/6646.misc new file mode 100644 index 0000000000..0f2e3f0881 --- /dev/null +++ b/changelog.d/6646.misc @@ -0,0 +1 @@ +[App Layout] Obsolete settings are not shown when App Layout flag is enabled diff --git a/vector/src/main/java/im/vector/app/features/settings/VectorPreferences.kt b/vector/src/main/java/im/vector/app/features/settings/VectorPreferences.kt index cefbe64d9d..d60d0ea73a 100755 --- a/vector/src/main/java/im/vector/app/features/settings/VectorPreferences.kt +++ b/vector/src/main/java/im/vector/app/features/settings/VectorPreferences.kt @@ -165,6 +165,11 @@ class VectorPreferences @Inject constructor( const val SETTINGS_LABS_AUTO_REPORT_UISI = "SETTINGS_LABS_AUTO_REPORT_UISI" const val SETTINGS_PREF_SPACE_SHOW_ALL_ROOM_IN_HOME = "SETTINGS_PREF_SPACE_SHOW_ALL_ROOM_IN_HOME" + /** + * This is not preference, but category on preferences screen which contains [SETTINGS_PREF_SPACE_SHOW_ALL_ROOM_IN_HOME]. + * Needed to show/hide this category, depending on visibility of [SETTINGS_PREF_SPACE_SHOW_ALL_ROOM_IN_HOME]. */ + const val SETTINGS_PREF_SPACE_SHOW_ALL_ROOM_IN_HOME_CATEGORY = "SETTINGS_PREF_SPACE_SHOW_ALL_ROOM_IN_HOME_CATEGORY" + private const val SETTINGS_DEVELOPER_MODE_PREFERENCE_KEY = "SETTINGS_DEVELOPER_MODE_PREFERENCE_KEY" private const val SETTINGS_LABS_SHOW_HIDDEN_EVENTS_PREFERENCE_KEY = "SETTINGS_LABS_SHOW_HIDDEN_EVENTS_PREFERENCE_KEY" private const val SETTINGS_LABS_ENABLE_SWIPE_TO_REPLY = "SETTINGS_LABS_ENABLE_SWIPE_TO_REPLY" diff --git a/vector/src/main/java/im/vector/app/features/settings/VectorSettingsLabsFragment.kt b/vector/src/main/java/im/vector/app/features/settings/VectorSettingsLabsFragment.kt index eb7864a89d..c1253f4ab4 100644 --- a/vector/src/main/java/im/vector/app/features/settings/VectorSettingsLabsFragment.kt +++ b/vector/src/main/java/im/vector/app/features/settings/VectorSettingsLabsFragment.kt @@ -27,6 +27,7 @@ import im.vector.app.R import im.vector.app.core.preference.VectorSwitchPreference import im.vector.app.features.MainActivity import im.vector.app.features.MainActivityArgs +import im.vector.app.features.VectorFeatures import im.vector.app.features.analytics.plan.MobileScreen import im.vector.app.features.home.room.threads.ThreadsManager import org.matrix.android.sdk.api.settings.LightweightSettingsStorage @@ -39,6 +40,7 @@ class VectorSettingsLabsFragment : @Inject lateinit var vectorPreferences: VectorPreferences @Inject lateinit var lightweightSettingsStorage: LightweightSettingsStorage @Inject lateinit var threadsManager: ThreadsManager + @Inject lateinit var vectorFeatures: VectorFeatures override var titleRes = R.string.room_settings_labs_pref_title override val preferenceXmlRes = R.xml.vector_settings_labs @@ -72,6 +74,10 @@ class VectorSettingsLabsFragment : true } } + + findPreference(VectorPreferences.SETTINGS_LABS_UNREAD_NOTIFICATIONS_AS_TAB)!!.let { + it.isVisible = !vectorFeatures.isNewAppLayoutEnabled() + } } /** diff --git a/vector/src/main/java/im/vector/app/features/settings/VectorSettingsPreferencesFragment.kt b/vector/src/main/java/im/vector/app/features/settings/VectorSettingsPreferencesFragment.kt index 0bd5316b8f..458ba79ee3 100644 --- a/vector/src/main/java/im/vector/app/features/settings/VectorSettingsPreferencesFragment.kt +++ b/vector/src/main/java/im/vector/app/features/settings/VectorSettingsPreferencesFragment.kt @@ -28,9 +28,11 @@ import im.vector.app.core.dialogs.PhotoOrVideoDialog import im.vector.app.core.extensions.restart import im.vector.app.core.preference.VectorListPreference 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.features.MainActivity import im.vector.app.features.MainActivityArgs +import im.vector.app.features.VectorFeatures import im.vector.app.features.analytics.plan.MobileScreen import im.vector.app.features.settings.font.FontScaleSettingActivity import im.vector.app.features.themes.ThemeUtils @@ -44,6 +46,7 @@ class VectorSettingsPreferencesFragment : @Inject lateinit var vectorPreferences: VectorPreferences @Inject lateinit var fontScalePreferences: FontScalePreferences + @Inject lateinit var vectorFeatures: VectorFeatures override var titleRes = R.string.settings_preferences override val preferenceXmlRes = R.xml.vector_settings_preferences @@ -99,6 +102,10 @@ class VectorSettingsPreferencesFragment : } } + findPreference(VectorPreferences.SETTINGS_PREF_SPACE_SHOW_ALL_ROOM_IN_HOME_CATEGORY)!!.let { pref -> + pref.isVisible = !vectorFeatures.isNewAppLayoutEnabled() + } + // Url preview /* TODO Note: we keep the setting client side for now diff --git a/vector/src/main/res/xml/vector_settings_preferences.xml b/vector/src/main/res/xml/vector_settings_preferences.xml index a3b8a3476c..7700de6986 100644 --- a/vector/src/main/res/xml/vector_settings_preferences.xml +++ b/vector/src/main/res/xml/vector_settings_preferences.xml @@ -30,7 +30,9 @@ - +