Add 'unencrypted room' badges and labels (#4445)

* Add 'unencrypted room' icon and label to composer

* Modify colors for room details screen info labels

* Add exception to Konsist's preview check

* Update screenshots

---------

Co-authored-by: ElementBot <android@element.io>
This commit is contained in:
Jorge Martin Espinosa
2025-03-25 12:26:25 +01:00
committed by GitHub
parent 56683259d9
commit bb97015e59
113 changed files with 493 additions and 196 deletions

View File

@@ -73,7 +73,7 @@ class AttachmentsPreviewPresenter @AssistedInject constructor(
val markdownTextEditorState = rememberMarkdownTextEditorState(initialText = null, initialFocus = false)
val textEditorState by rememberUpdatedState(
TextEditorState.Markdown(markdownTextEditorState)
TextEditorState.Markdown(markdownTextEditorState, isRoomEncrypted = null)
)
val ongoingSendAttachmentJob = remember { mutableStateOf<Job?>(null) }

View File

@@ -141,6 +141,8 @@ class MessageComposerPresenter @AssistedInject constructor(
override fun present(): MessageComposerState {
val localCoroutineScope = rememberCoroutineScope()
val roomInfo by room.roomInfoFlow.collectAsState()
val richTextEditorState = richTextEditorStateFactory.remember()
if (isTesting) {
richTextEditorState.isReadyToProcessActions = true
@@ -242,9 +244,9 @@ class MessageComposerPresenter @AssistedInject constructor(
val textEditorState by rememberUpdatedState(
if (showTextFormatting) {
TextEditorState.Rich(richTextEditorState)
TextEditorState.Rich(richTextEditorState, roomInfo.isEncrypted == true)
} else {
TextEditorState.Markdown(markdownTextEditorState)
TextEditorState.Markdown(markdownTextEditorState, roomInfo.isEncrypted == true)
}
)

View File

@@ -469,14 +469,14 @@ private fun RoomBadge.toMatrixBadgeData(): MatrixBadgeAtom.MatrixBadgeData {
MatrixBadgeAtom.MatrixBadgeData(
text = stringResource(R.string.screen_room_details_badge_not_encrypted),
icon = CompoundIcons.LockOff(),
type = MatrixBadgeAtom.Type.Neutral,
type = MatrixBadgeAtom.Type.Info,
)
}
RoomBadge.PUBLIC -> {
MatrixBadgeAtom.MatrixBadgeData(
text = stringResource(R.string.screen_room_details_badge_public),
icon = CompoundIcons.Public(),
type = MatrixBadgeAtom.Type.Neutral,
type = MatrixBadgeAtom.Type.Info,
)
}
}