Re-arrange room profile

- Show encryption status also in easy mode again
- Move encryption action down - it's a one-time action and not important
  enough to show prevalent on top
- Hide encryption action if permission missing
- TODO: hide encryption action when it's a public room (it's already
  hidden on room creation in that case)

Change-Id: I544704191fd7e3573ef35fa9de2f7023a01c4a04
This commit is contained in:
SpiritCroc 2020-12-01 11:21:25 +01:00
parent 3cb5f6087c
commit d6ea5648b6
1 changed files with 19 additions and 17 deletions

View File

@ -77,7 +77,6 @@ class RoomProfileController @Inject constructor(
}
// Security
if (enableNonSimplifiedMode) {
buildProfileSection(stringProvider.getString(R.string.room_profile_section_security))
val learnMoreSubtitle = if (roomSummary.isEncrypted) {
if (roomSummary.isDirect) R.string.direct_room_profile_encrypted_subtitle else R.string.room_profile_encrypted_subtitle
@ -89,13 +88,11 @@ class RoomProfileController @Inject constructor(
centered(false)
text(stringProvider.getString(learnMoreSubtitle))
}
buildEncryptionAction(data.actionPermissions, roomSummary)
}
// SC: Move down in the list, this one-time action is not important to enough to show this prevalent at the top
//buildEncryptionAction(data.actionPermissions, roomSummary)
// More | category header only if displaying other sections above
if (enableNonSimplifiedMode || roomSummary.topic.isNotEmpty()) {
// More
buildProfileSection(stringProvider.getString(R.string.room_profile_section_more))
}
buildProfileAction(
id = "settings",
title = stringProvider.getString(if (roomSummary.isDirect) {
@ -151,6 +148,9 @@ class RoomProfileController @Inject constructor(
action = { callback?.createShortcut() }
)
}
if (enableNonSimplifiedMode) {
buildEncryptionAction(data.actionPermissions, roomSummary)
}
buildProfileAction(
id = "leave",
title = stringProvider.getString(if (roomSummary.isDirect) {
@ -193,6 +193,7 @@ class RoomProfileController @Inject constructor(
editable = false,
action = { callback?.onEnableEncryptionClicked() }
)
/* SC: disable useless button
} else {
buildProfileAction(
id = "enableEncryption",
@ -202,6 +203,7 @@ class RoomProfileController @Inject constructor(
divider = false,
editable = false
)
*/
}
}
}