Merge pull request #7375 from vector-im/feature/mna/device-manager-go-to-new-screen

[Device Management] Redirect to the new screen everywhere when lab flag is on
This commit is contained in:
Benoit Marty 2022-10-17 11:44:02 +02:00 committed by GitHub
commit 36e5166051
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 2 deletions

1
changelog.d/7374.feature Normal file
View file

@ -0,0 +1 @@
[Device Management] Redirect to the new screen everywhere when lab flag is on

View file

@ -63,6 +63,8 @@ class VectorSettingsActivity : VectorBaseActivity<ActivityVectorSettingsBinding>
@Inject lateinit var session: Session @Inject lateinit var session: Session
@Inject lateinit var vectorPreferences: VectorPreferences
override fun initUiAndData() { override fun initUiAndData() {
setupToolbar(views.settingsToolbar) setupToolbar(views.settingsToolbar)
.allowBack() .allowBack()
@ -77,13 +79,19 @@ class VectorSettingsActivity : VectorBaseActivity<ActivityVectorSettingsBinding>
replaceFragment(views.vectorSettingsPage, VectorSettingsAdvancedSettingsFragment::class.java, null, FRAGMENT_TAG) replaceFragment(views.vectorSettingsPage, VectorSettingsAdvancedSettingsFragment::class.java, null, FRAGMENT_TAG)
SettingsActivityPayload.SecurityPrivacy -> SettingsActivityPayload.SecurityPrivacy ->
replaceFragment(views.vectorSettingsPage, VectorSettingsSecurityPrivacyFragment::class.java, null, FRAGMENT_TAG) replaceFragment(views.vectorSettingsPage, VectorSettingsSecurityPrivacyFragment::class.java, null, FRAGMENT_TAG)
SettingsActivityPayload.SecurityPrivacyManageSessions -> SettingsActivityPayload.SecurityPrivacyManageSessions -> {
val fragmentClass = if (vectorPreferences.isNewSessionManagerEnabled()) {
im.vector.app.features.settings.devices.v2.VectorSettingsDevicesFragment::class.java
} else {
VectorSettingsDevicesFragment::class.java
}
replaceFragment( replaceFragment(
views.vectorSettingsPage, views.vectorSettingsPage,
VectorSettingsDevicesFragment::class.java, fragmentClass,
null, null,
FRAGMENT_TAG FRAGMENT_TAG
) )
}
SettingsActivityPayload.Notifications -> { SettingsActivityPayload.Notifications -> {
requestHighlightPreferenceKeyOnResume(VectorPreferences.SETTINGS_ENABLE_THIS_DEVICE_PREFERENCE_KEY) requestHighlightPreferenceKeyOnResume(VectorPreferences.SETTINGS_ENABLE_THIS_DEVICE_PREFERENCE_KEY)
replaceFragment(views.vectorSettingsPage, VectorSettingsNotificationPreferenceFragment::class.java, null, FRAGMENT_TAG) replaceFragment(views.vectorSettingsPage, VectorSettingsNotificationPreferenceFragment::class.java, null, FRAGMENT_TAG)