From 9f9a017ffa6f2cdf498819a7db0e0fb3c73ce8b0 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Thu, 8 Jan 2026 11:42:05 +0100 Subject: [PATCH] Small rework to prepare a bugfix. No behavior / UI change. --- .../libraries/textcomposer/TextComposer.kt | 37 +++++++++---------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/libraries/textcomposer/impl/src/main/kotlin/io/element/android/libraries/textcomposer/TextComposer.kt b/libraries/textcomposer/impl/src/main/kotlin/io/element/android/libraries/textcomposer/TextComposer.kt index 2bc8e27320..b96a7e1462 100644 --- a/libraries/textcomposer/impl/src/main/kotlin/io/element/android/libraries/textcomposer/TextComposer.kt +++ b/libraries/textcomposer/impl/src/main/kotlin/io/element/android/libraries/textcomposer/TextComposer.kt @@ -452,7 +452,14 @@ private fun StandardLayout( Spacer(Modifier.height(4.dp)) } Row(verticalAlignment = Alignment.Bottom) { - if (voiceMessageState !is VoiceMessageState.Idle) { + if (voiceMessageState is VoiceMessageState.Idle) { + Box( + Modifier + .padding(bottom = 5.dp, top = 5.dp, start = 3.dp) + ) { + composerOptionsButton() + } + } else { Box( modifier = Modifier .padding(bottom = 5.dp, top = 5.dp, end = 3.dp, start = 3.dp) @@ -461,26 +468,16 @@ private fun StandardLayout( ) { voiceDeleteButton() } - Box( - modifier = Modifier - .padding(bottom = 8.dp, top = 8.dp) - .weight(1f) - ) { - voiceRecording() - } - } else { - Box( - Modifier - .padding(bottom = 5.dp, top = 5.dp, start = 3.dp) - ) { - composerOptionsButton() - } - Box( - modifier = Modifier - .padding(bottom = 8.dp, top = 8.dp) - .weight(1f) - ) { + } + Box( + modifier = Modifier + .padding(bottom = 8.dp, top = 8.dp) + .weight(1f) + ) { + if (voiceMessageState is VoiceMessageState.Idle) { textInput() + } else { + voiceRecording() } } // To avoid loosing keyboard focus, the IconButton has to be defined here and has to be always enabled.