@@ -9,18 +9,20 @@ import androidx.compose.animation.fadeOut
99import androidx.compose.animation.shrinkVertically
1010import androidx.compose.foundation.layout.Arrangement
1111import androidx.compose.foundation.layout.Column
12+ import androidx.compose.foundation.layout.RowScope
1213import androidx.compose.foundation.layout.fillMaxWidth
1314import androidx.compose.foundation.layout.heightIn
1415import androidx.compose.foundation.layout.padding
15- import androidx.compose.foundation.shape.RoundedCornerShape
1616import androidx.compose.foundation.text.KeyboardOptions
1717import androidx.compose.material.icons.automirrored.filled.KeyboardReturn
1818import androidx.compose.material.icons.automirrored.filled.Send
1919import androidx.compose.material.icons.Icons
2020import androidx.compose.material.icons.filled.Clear
21+ import androidx.compose.material3.Button
22+ import androidx.compose.material3.ButtonDefaults
23+ import androidx.compose.material3.FilledTonalButton
2124import androidx.compose.material3.Icon
2225import androidx.compose.material3.MaterialTheme
23- import androidx.compose.material3.OutlinedButton
2426import androidx.compose.material3.Text
2527import androidx.compose.runtime.Composable
2628import androidx.compose.ui.Modifier
@@ -196,13 +198,8 @@ private fun PcTypingTextActionButton(
196198 PcTypingTextAction .SendAndEnter -> R .string.pc_typing_send_enter
197199 PcTypingTextAction .Clear -> R .string.pc_typing_clear
198200 }
199-
200- OutlinedButton (
201- onClick = onClick,
202- enabled = enabled,
203- modifier = modifier.heightIn(min = 48 .dp),
204- shape = RoundedCornerShape (8 .dp)
205- ) {
201+ val buttonModifier = modifier.heightIn(min = 48 .dp)
202+ val content: @Composable RowScope .() -> Unit = {
206203 Icon (
207204 imageVector = icon,
208205 contentDescription = null
@@ -214,6 +211,37 @@ private fun PcTypingTextActionButton(
214211 overflow = TextOverflow .Ellipsis
215212 )
216213 }
214+
215+ when (action) {
216+ PcTypingTextAction .Send -> Button (
217+ onClick = onClick,
218+ enabled = enabled,
219+ modifier = buttonModifier,
220+ content = content
221+ )
222+
223+ PcTypingTextAction .SendAndEnter -> FilledTonalButton (
224+ onClick = onClick,
225+ enabled = enabled,
226+ modifier = buttonModifier,
227+ colors = ButtonDefaults .filledTonalButtonColors(
228+ containerColor = MaterialTheme .colorScheme.surfaceContainerHigh,
229+ contentColor = MaterialTheme .colorScheme.primary
230+ ),
231+ content = content
232+ )
233+
234+ PcTypingTextAction .Clear -> FilledTonalButton (
235+ onClick = onClick,
236+ enabled = enabled,
237+ modifier = buttonModifier,
238+ colors = ButtonDefaults .filledTonalButtonColors(
239+ containerColor = MaterialTheme .colorScheme.errorContainer,
240+ contentColor = MaterialTheme .colorScheme.onErrorContainer
241+ ),
242+ content = content
243+ )
244+ }
217245}
218246
219247@Composable
0 commit comments