Easy mode: Hide encryption status and action in room profile

Change-Id: Ia12cd69a5c4cad5577049020478987fb588932a1
This commit is contained in:
SpiritCroc 2020-11-29 13:31:41 +01:00
parent f23bea23e5
commit 6830ffd3f0
1 changed files with 17 additions and 14 deletions

View File

@ -60,6 +60,7 @@ class RoomProfileController @Inject constructor(
return return
} }
val roomSummary = data.roomSummary() ?: return val roomSummary = data.roomSummary() ?: return
val enableNonSimplifiedMode = !vectorPreferences.simplifiedMode()
// Topic // Topic
roomSummary roomSummary
@ -76,21 +77,23 @@ class RoomProfileController @Inject constructor(
} }
// Security // Security
buildProfileSection(stringProvider.getString(R.string.room_profile_section_security)) if (enableNonSimplifiedMode) {
val learnMoreSubtitle = if (roomSummary.isEncrypted) { buildProfileSection(stringProvider.getString(R.string.room_profile_section_security))
if (roomSummary.isDirect) R.string.direct_room_profile_encrypted_subtitle else R.string.room_profile_encrypted_subtitle val learnMoreSubtitle = if (roomSummary.isEncrypted) {
} else { 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_not_encrypted_subtitle else R.string.room_profile_not_encrypted_subtitle } else {
} if (roomSummary.isDirect) R.string.direct_room_profile_not_encrypted_subtitle else R.string.room_profile_not_encrypted_subtitle
genericFooterItem { }
id("e2e info") genericFooterItem {
centered(false) id("e2e info")
text(stringProvider.getString(learnMoreSubtitle)) centered(false)
} text(stringProvider.getString(learnMoreSubtitle))
buildEncryptionAction(data.actionPermissions, roomSummary) }
buildEncryptionAction(data.actionPermissions, roomSummary)
// More // More
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) {