From 8c7e7a8f3571beb477b60878ee3c166bed0834cc Mon Sep 17 00:00:00 2001 From: Valere Date: Mon, 3 Oct 2022 14:22:13 +0200 Subject: [PATCH] open global settings from room settings --- .../features/roomprofile/settings/RoomSettingsController.kt | 2 ++ .../features/roomprofile/settings/RoomSettingsFragment.kt | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/vector/src/main/java/im/vector/app/features/roomprofile/settings/RoomSettingsController.kt b/vector/src/main/java/im/vector/app/features/roomprofile/settings/RoomSettingsController.kt index 04727eca2c..c54c6d5db8 100644 --- a/vector/src/main/java/im/vector/app/features/roomprofile/settings/RoomSettingsController.kt +++ b/vector/src/main/java/im/vector/app/features/roomprofile/settings/RoomSettingsController.kt @@ -56,6 +56,7 @@ class RoomSettingsController @Inject constructor( fun onJoinRuleClicked() fun onToggleGuestAccess() fun setEncryptedToVerifiedDevicesOnly(enabled: Boolean) + fun openGlobalBlockSettings() } var callback: Callback? = null @@ -170,6 +171,7 @@ class RoomSettingsController @Inject constructor( }.toEpoxyCharSequence() ) itemClickAction { + host.callback?.openGlobalBlockSettings() } } } else { diff --git a/vector/src/main/java/im/vector/app/features/roomprofile/settings/RoomSettingsFragment.kt b/vector/src/main/java/im/vector/app/features/roomprofile/settings/RoomSettingsFragment.kt index b7d8f13343..093f146a53 100644 --- a/vector/src/main/java/im/vector/app/features/roomprofile/settings/RoomSettingsFragment.kt +++ b/vector/src/main/java/im/vector/app/features/roomprofile/settings/RoomSettingsFragment.kt @@ -43,6 +43,7 @@ import im.vector.app.core.utils.toast import im.vector.app.databinding.FragmentRoomSettingGenericBinding import im.vector.app.features.analytics.plan.MobileScreen import im.vector.app.features.home.AvatarRenderer +import im.vector.app.features.navigation.SettingsActivityPayload import im.vector.app.features.roomprofile.RoomProfileArgs import im.vector.app.features.roomprofile.RoomProfileSharedActionViewModel import im.vector.app.features.roomprofile.settings.historyvisibility.RoomHistoryVisibilityBottomSheet @@ -203,6 +204,10 @@ class RoomSettingsFragment : viewModel.handle(RoomSettingsAction.SetEncryptToVerifiedDeviceOnly(enabled)) } + override fun openGlobalBlockSettings() { + navigator.openSettings(requireContext(), SettingsActivityPayload.SecurityPrivacy) + } + override fun onImageReady(uri: Uri?) { uri ?: return viewModel.handle(