Improve room profile UX

This commit is contained in:
Benoit Marty 2021-02-10 17:32:36 +01:00
parent 1b210d42ed
commit ba24c30d38
5 changed files with 33 additions and 31 deletions

View file

@ -6,6 +6,7 @@ Features ✨:
Improvements 🙌:
- VoIP : new tiles in timeline
- Improve room profile UX
Bugfix 🐛:
- VoIP : fix audio devices output

View file

@ -54,6 +54,8 @@ class RoomProfileController @Inject constructor(
fun createShortcut()
fun onSettingsClicked()
fun onLeaveRoomClicked()
fun onRoomAliasesClicked()
fun onRoomPermissionsClicked()
fun onRoomIdClicked()
fun onUrlInTopicLongClicked(url: String)
}
@ -174,8 +176,29 @@ class RoomProfileController @Inject constructor(
)
// Advanced
buildProfileSection(stringProvider.getString(R.string.room_settings_category_advanced_title))
buildProfileAction(
id = "alias",
title = stringProvider.getString(R.string.room_settings_alias_title),
subtitle = stringProvider.getString(R.string.room_settings_alias_subtitle),
dividerColor = dividerColor,
divider = true,
editable = true,
action = { callback?.onRoomAliasesClicked() }
)
buildProfileAction(
id = "permissions",
title = stringProvider.getString(R.string.room_settings_permissions_title),
subtitle = stringProvider.getString(R.string.room_settings_permissions_subtitle),
dividerColor = dividerColor,
divider = true,
editable = true,
action = { callback?.onRoomPermissionsClicked() }
)
if (vectorPreferences.developerMode()) {
buildProfileSection(stringProvider.getString(R.string.room_settings_category_advanced_title))
buildProfileAction(
id = "roomId",
title = stringProvider.getString(R.string.room_settings_room_internal_id),

View file

@ -269,6 +269,14 @@ class RoomProfileFragment @Inject constructor(
}
}
override fun onRoomAliasesClicked() {
roomProfileSharedActionViewModel.post(RoomProfileSharedAction.OpenRoomAliasesSettings)
}
override fun onRoomPermissionsClicked() {
roomProfileSharedActionViewModel.post(RoomProfileSharedAction.OpenRoomPermissionsSettings)
}
override fun onRoomIdClicked() {
copyToClipboard(requireContext(), roomProfileArgs.roomId)
}

View file

@ -45,8 +45,6 @@ class RoomSettingsController @Inject constructor(
fun onNameChanged(name: String)
fun onTopicChanged(topic: String)
fun onHistoryVisibilityClicked()
fun onRoomAliasesClicked()
fun onRoomPermissionsClicked()
fun onJoinRuleClicked()
}
@ -106,26 +104,6 @@ class RoomSettingsController @Inject constructor(
}
}
buildProfileAction(
id = "alias",
title = stringProvider.getString(R.string.room_settings_alias_title),
subtitle = stringProvider.getString(R.string.room_settings_alias_subtitle),
dividerColor = dividerColor,
divider = true,
editable = true,
action = { callback?.onRoomAliasesClicked() }
)
buildProfileAction(
id = "permissions",
title = stringProvider.getString(R.string.room_settings_permissions_title),
subtitle = stringProvider.getString(R.string.room_settings_permissions_subtitle),
dividerColor = dividerColor,
divider = true,
editable = true,
action = { callback?.onRoomPermissionsClicked() }
)
buildProfileAction(
id = "historyReadability",
title = stringProvider.getString(R.string.room_settings_room_read_history_rules_pref_title),

View file

@ -174,14 +174,6 @@ class RoomSettingsFragment @Inject constructor(
.show(childFragmentManager, "RoomHistoryVisibilityBottomSheet")
}
override fun onRoomAliasesClicked() {
roomProfileSharedActionViewModel.post(RoomProfileSharedAction.OpenRoomAliasesSettings)
}
override fun onRoomPermissionsClicked() {
roomProfileSharedActionViewModel.post(RoomProfileSharedAction.OpenRoomPermissionsSettings)
}
override fun onJoinRuleClicked() = withState(viewModel) { state ->
val currentJoinRule = state.newRoomJoinRules.newJoinRules ?: state.currentRoomJoinRules
val currentGuestAccess = state.newRoomJoinRules.newGuestAccess ?: state.currentGuestAccess