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

View file

@ -77,25 +77,22 @@ class RoomProfileController @Inject constructor(
} }
// Security // Security
if (enableNonSimplifiedMode) { buildProfileSection(stringProvider.getString(R.string.room_profile_section_security))
buildProfileSection(stringProvider.getString(R.string.room_profile_section_security)) val learnMoreSubtitle = if (roomSummary.isEncrypted) {
val learnMoreSubtitle = if (roomSummary.isEncrypted) { if (roomSummary.isDirect) R.string.direct_room_profile_encrypted_subtitle else R.string.room_profile_encrypted_subtitle
if (roomSummary.isDirect) R.string.direct_room_profile_encrypted_subtitle else R.string.room_profile_encrypted_subtitle } else {
} else { if (roomSummary.isDirect) R.string.direct_room_profile_not_encrypted_subtitle else R.string.room_profile_not_encrypted_subtitle
if (roomSummary.isDirect) R.string.direct_room_profile_not_encrypted_subtitle else R.string.room_profile_not_encrypted_subtitle
}
genericFooterItem {
id("e2e info")
centered(false)
text(stringProvider.getString(learnMoreSubtitle))
}
buildEncryptionAction(data.actionPermissions, roomSummary)
} }
genericFooterItem {
id("e2e info")
centered(false)
text(stringProvider.getString(learnMoreSubtitle))
}
// 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 // More
if (enableNonSimplifiedMode || roomSummary.topic.isNotEmpty()) { buildProfileSection(stringProvider.getString(R.string.room_profile_section_more))
buildProfileSection(stringProvider.getString(R.string.room_profile_section_more))
}
buildProfileAction( buildProfileAction(
id = "settings", id = "settings",
title = stringProvider.getString(if (roomSummary.isDirect) { title = stringProvider.getString(if (roomSummary.isDirect) {
@ -151,6 +148,9 @@ class RoomProfileController @Inject constructor(
action = { callback?.createShortcut() } action = { callback?.createShortcut() }
) )
} }
if (enableNonSimplifiedMode) {
buildEncryptionAction(data.actionPermissions, roomSummary)
}
buildProfileAction( buildProfileAction(
id = "leave", id = "leave",
title = stringProvider.getString(if (roomSummary.isDirect) { title = stringProvider.getString(if (roomSummary.isDirect) {
@ -193,6 +193,7 @@ class RoomProfileController @Inject constructor(
editable = false, editable = false,
action = { callback?.onEnableEncryptionClicked() } action = { callback?.onEnableEncryptionClicked() }
) )
/* SC: disable useless button
} else { } else {
buildProfileAction( buildProfileAction(
id = "enableEncryption", id = "enableEncryption",
@ -202,6 +203,7 @@ class RoomProfileController @Inject constructor(
divider = false, divider = false,
editable = false editable = false
) )
*/
} }
} }
} }