Format - no other change.

This commit is contained in:
Benoit Marty 2025-11-10 16:34:14 +01:00 committed by Benoit Marty
parent a902533247
commit c62f834917
2 changed files with 63 additions and 63 deletions

View file

@ -183,27 +183,27 @@ fun MessagesView(
Scaffold( Scaffold(
contentWindowInsets = WindowInsets.statusBars, contentWindowInsets = WindowInsets.statusBars,
topBar = { topBar = {
if (state.timelineState.timelineMode is Timeline.Mode.Thread) { if (state.timelineState.timelineMode is Timeline.Mode.Thread) {
ThreadTopBar( ThreadTopBar(
roomName = state.roomName, roomName = state.roomName,
roomAvatarData = state.roomAvatar, roomAvatarData = state.roomAvatar,
heroes = state.heroes, heroes = state.heroes,
isTombstoned = state.isTombstoned, isTombstoned = state.isTombstoned,
onBackClick = onBackClick, onBackClick = onBackClick,
) )
} else { } else {
MessagesViewTopBar( MessagesViewTopBar(
roomName = state.roomName, roomName = state.roomName,
roomAvatar = state.roomAvatar, roomAvatar = state.roomAvatar,
isTombstoned = state.isTombstoned, isTombstoned = state.isTombstoned,
heroes = state.heroes, heroes = state.heroes,
roomCallState = state.roomCallState, roomCallState = state.roomCallState,
dmUserIdentityState = state.dmUserVerificationState, dmUserIdentityState = state.dmUserVerificationState,
onBackClick = { hidingKeyboard { onBackClick() } }, onBackClick = { hidingKeyboard { onBackClick() } },
onRoomDetailsClick = { hidingKeyboard { onRoomDetailsClick() } }, onRoomDetailsClick = { hidingKeyboard { onRoomDetailsClick() } },
onJoinCallClick = onJoinCallClick, onJoinCallClick = onJoinCallClick,
) )
} }
}, },
content = { padding -> content = { padding ->
Box( Box(

View file

@ -140,8 +140,8 @@ fun TextComposer(
} }
val layoutModifier = modifier val layoutModifier = modifier
.fillMaxSize() .fillMaxSize()
.height(IntrinsicSize.Min) .height(IntrinsicSize.Min)
val composerOptionsButton: @Composable () -> Unit = remember(composerMode) { val composerOptionsButton: @Composable () -> Unit = remember(composerMode) {
@Composable { @Composable {
@ -178,18 +178,18 @@ fun TextComposer(
@Composable { @Composable {
TextInputBox( TextInputBox(
modifier = Modifier modifier = Modifier
.clickable( .clickable(
interactionSource = remember { MutableInteractionSource() }, interactionSource = remember { MutableInteractionSource() },
indication = null, indication = null,
) { ) {
coroutineScope.launch { coroutineScope.launch {
state.requestFocus() state.requestFocus()
view.showKeyboard() view.showKeyboard()
}
} }
.semantics { }
hideFromAccessibility() .semantics {
}, hideFromAccessibility()
},
composerMode = composerMode, composerMode = composerMode,
onResetComposerMode = onResetComposerMode, onResetComposerMode = onResetComposerMode,
isTextEmpty = state.richTextEditorState.messageHtml.isEmpty(), isTextEmpty = state.richTextEditorState.messageHtml.isEmpty(),
@ -199,8 +199,8 @@ fun TextComposer(
placeholder = placeholder, placeholder = placeholder,
registerStateUpdates = true, registerStateUpdates = true,
modifier = Modifier modifier = Modifier
.padding(top = 6.dp, bottom = 6.dp) .padding(top = 6.dp, bottom = 6.dp)
.fillMaxWidth(), .fillMaxWidth(),
style = ElementRichTextEditorStyle.composerStyle(hasFocus = state.richTextEditorState.hasFocus), style = ElementRichTextEditorStyle.composerStyle(hasFocus = state.richTextEditorState.hasFocus),
resolveMentionDisplay = resolveMentionDisplay, resolveMentionDisplay = resolveMentionDisplay,
resolveRoomMentionDisplay = resolveAtRoomMentionDisplay, resolveRoomMentionDisplay = resolveAtRoomMentionDisplay,
@ -420,8 +420,8 @@ private fun StandardLayout(
if (voiceMessageState is VoiceMessageState.Preview || voiceMessageState is VoiceMessageState.Recording) { if (voiceMessageState is VoiceMessageState.Preview || voiceMessageState is VoiceMessageState.Recording) {
Box( Box(
modifier = Modifier modifier = Modifier
.padding(bottom = 5.dp, top = 5.dp, end = 3.dp, start = 3.dp) .padding(bottom = 5.dp, top = 5.dp, end = 3.dp, start = 3.dp)
.size(48.dp), .size(48.dp),
contentAlignment = Alignment.Center, contentAlignment = Alignment.Center,
) { ) {
voiceDeleteButton() voiceDeleteButton()
@ -431,8 +431,8 @@ private fun StandardLayout(
} }
Box( Box(
modifier = Modifier modifier = Modifier
.padding(bottom = 8.dp, top = 8.dp) .padding(bottom = 8.dp, top = 8.dp)
.weight(1f) .weight(1f)
) { ) {
voiceRecording() voiceRecording()
} }
@ -445,17 +445,17 @@ private fun StandardLayout(
} }
Box( Box(
modifier = Modifier modifier = Modifier
.padding(bottom = 8.dp, top = 8.dp) .padding(bottom = 8.dp, top = 8.dp)
.weight(1f) .weight(1f)
) { ) {
textInput() textInput()
} }
} }
Box( Box(
Modifier Modifier
.padding(bottom = 5.dp, top = 5.dp, end = 6.dp, start = 6.dp) .padding(bottom = 5.dp, top = 5.dp, end = 6.dp, start = 6.dp)
.size(48.dp) .size(48.dp)
.clearAndSetSemantics(endButtonA11y), .clearAndSetSemantics(endButtonA11y),
contentAlignment = Alignment.Center, contentAlignment = Alignment.Center,
) { ) {
endButton() endButton()
@ -506,8 +506,8 @@ private fun TextFormattingLayout(
} }
Box( Box(
modifier = Modifier modifier = Modifier
.weight(1f) .weight(1f)
.padding(horizontal = 12.dp) .padding(horizontal = 12.dp)
) { ) {
textInput() textInput()
} }
@ -526,11 +526,11 @@ private fun TextFormattingLayout(
} }
Box( Box(
modifier = Modifier modifier = Modifier
.padding( .padding(
start = 14.dp, start = 14.dp,
end = 6.dp, end = 6.dp,
) )
.clearAndSetSemantics(endButtonA11y) .clearAndSetSemantics(endButtonA11y)
) { ) {
sendButton() sendButton()
} }
@ -552,12 +552,12 @@ private fun TextInputBox(
Column( Column(
modifier = Modifier modifier = Modifier
.clip(roundedCorners) .clip(roundedCorners)
.border(0.5.dp, borderColor, roundedCorners) .border(0.5.dp, borderColor, roundedCorners)
.background(color = bgColor) .background(color = bgColor)
.requiredHeightIn(min = 42.dp) .requiredHeightIn(min = 42.dp)
.fillMaxSize() .fillMaxSize()
.then(modifier), .then(modifier),
) { ) {
if (composerMode is MessageComposerMode.Special) { if (composerMode is MessageComposerMode.Special) {
ComposerModeView( ComposerModeView(
@ -567,8 +567,8 @@ private fun TextInputBox(
} }
Box( Box(
modifier = Modifier modifier = Modifier
.padding(top = 4.dp, bottom = 4.dp, start = 12.dp, end = 12.dp) .padding(top = 4.dp, bottom = 4.dp, start = 12.dp, end = 12.dp)
.then(Modifier.testTag(TestTags.textEditor)), .then(Modifier.testTag(TestTags.textEditor)),
contentAlignment = Alignment.CenterStart, contentAlignment = Alignment.CenterStart,
) { ) {
textInput() textInput()
@ -576,9 +576,9 @@ private fun TextInputBox(
var showBottomSheet by remember { mutableStateOf(false) } var showBottomSheet by remember { mutableStateOf(false) }
Icon( Icon(
modifier = Modifier modifier = Modifier
.clickable { showBottomSheet = true } .clickable { showBottomSheet = true }
.padding(horizontal = 8.dp, vertical = 4.dp) .padding(horizontal = 8.dp, vertical = 4.dp)
.align(Alignment.CenterEnd), .align(Alignment.CenterEnd),
imageVector = CompoundIcons.InfoSolid(), imageVector = CompoundIcons.InfoSolid(),
tint = ElementTheme.colors.iconCriticalPrimary, tint = ElementTheme.colors.iconCriticalPrimary,
contentDescription = null, contentDescription = null,