From f76b4c06c5f45c42663541057357340c199795f0 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Wed, 10 Feb 2021 17:41:43 +0100 Subject: [PATCH] Add some click shortcut --- .../features/roomprofile/RoomProfileFragment.kt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/vector/src/main/java/im/vector/app/features/roomprofile/RoomProfileFragment.kt b/vector/src/main/java/im/vector/app/features/roomprofile/RoomProfileFragment.kt index 3c5e050935..dd920cda18 100644 --- a/vector/src/main/java/im/vector/app/features/roomprofile/RoomProfileFragment.kt +++ b/vector/src/main/java/im/vector/app/features/roomprofile/RoomProfileFragment.kt @@ -116,6 +116,7 @@ class RoomProfileFragment @Inject constructor( .observe() .subscribe { handleQuickActions(it) } .disposeOnDestroyView() + setupClicks() setupLongClicks() } @@ -124,6 +125,22 @@ class RoomProfileFragment @Inject constructor( views.waitingView.waitingStatusText.isVisible = true } + private fun setupClicks() { + // Shortcut to room settings + listOf( + headerViews.roomProfileNameView, + views.matrixProfileToolbarTitleView, + ).forEach { + it.setOnClickListener { + roomProfileSharedActionViewModel.post(RoomProfileSharedAction.OpenRoomSettings) + } + } + // Shortcut to room alias + headerViews.roomProfileAliasView.setOnClickListener { + roomProfileSharedActionViewModel.post(RoomProfileSharedAction.OpenRoomAliasesSettings) + } + } + private fun setupLongClicks() { headerViews.roomProfileNameView.copyOnLongClick() headerViews.roomProfileAliasView.copyOnLongClick()