Add some click shortcut

This commit is contained in:
Benoit Marty 2021-02-10 17:41:43 +01:00
parent ba24c30d38
commit f76b4c06c5
1 changed files with 17 additions and 0 deletions

View File

@ -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()