* fix(#373): compact full-width chat input bar * fix(#373): replace contentPadding with Modifier.padding for backward API compat --------- Co-authored-by: M57 <hy4ri@users.noreply.github.com>
This commit is contained in:
1 parent
2a9d4fa5be
commit
ef4c14e550
1 file changed
+11
-8
@@ -379,7 +379,7 @@ private fun ChatInputBar(
|
|||||||
modifier =
|
modifier =
|
||||||
Modifier
|
Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.padding(horizontal = 12.dp, vertical = 8.dp),
|
.padding(horizontal = 4.dp, vertical = 4.dp),
|
||||||
shape = RoundedCornerShape(24.dp),
|
shape = RoundedCornerShape(24.dp),
|
||||||
colors =
|
colors =
|
||||||
CardDefaults.cardColors(
|
CardDefaults.cardColors(
|
||||||
@@ -470,8 +470,8 @@ private fun ChatInputBar(
|
|||||||
modifier =
|
modifier =
|
||||||
Modifier
|
Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.padding(horizontal = 12.dp, vertical = 8.dp),
|
.padding(horizontal = 8.dp, vertical = 4.dp),
|
||||||
verticalAlignment = Alignment.Bottom,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
) {
|
) {
|
||||||
OutlinedTextField(
|
OutlinedTextField(
|
||||||
value = inputText,
|
value = inputText,
|
||||||
@@ -479,7 +479,8 @@ private fun ChatInputBar(
|
|||||||
modifier =
|
modifier =
|
||||||
Modifier
|
Modifier
|
||||||
.weight(1f)
|
.weight(1f)
|
||||||
.heightIn(max = 140.dp)
|
.heightIn(min = 36.dp, max = 120.dp)
|
||||||
|
.padding(horizontal = 12.dp, vertical = 8.dp)
|
||||||
.testTag("chat_input"),
|
.testTag("chat_input"),
|
||||||
placeholder = {
|
placeholder = {
|
||||||
Text(
|
Text(
|
||||||
@@ -490,10 +491,12 @@ private fun ChatInputBar(
|
|||||||
} else {
|
} else {
|
||||||
stringResource(R.string.chat_input_placeholder_type_message)
|
stringResource(R.string.chat_input_placeholder_type_message)
|
||||||
},
|
},
|
||||||
|
style = MaterialTheme.typography.bodyMedium,
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
enabled = isConnected,
|
enabled = isConnected,
|
||||||
maxLines = 5,
|
singleLine = false,
|
||||||
|
maxLines = 4,
|
||||||
shape = RoundedCornerShape(20.dp),
|
shape = RoundedCornerShape(20.dp),
|
||||||
colors =
|
colors =
|
||||||
OutlinedTextFieldDefaults.colors(
|
OutlinedTextFieldDefaults.colors(
|
||||||
@@ -503,7 +506,7 @@ private fun ChatInputBar(
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
Spacer(modifier = Modifier.width(8.dp))
|
Spacer(modifier = Modifier.width(6.dp))
|
||||||
|
|
||||||
if (isAgentTyping) {
|
if (isAgentTyping) {
|
||||||
// Interrupt button
|
// Interrupt button
|
||||||
@@ -511,7 +514,7 @@ private fun ChatInputBar(
|
|||||||
onClick = onInterrupt,
|
onClick = onInterrupt,
|
||||||
modifier =
|
modifier =
|
||||||
Modifier
|
Modifier
|
||||||
.size(48.dp)
|
.size(40.dp)
|
||||||
.testTag("interrupt_button"),
|
.testTag("interrupt_button"),
|
||||||
shape = CircleShape,
|
shape = CircleShape,
|
||||||
contentPadding = PaddingValues(0.dp),
|
contentPadding = PaddingValues(0.dp),
|
||||||
@@ -529,7 +532,7 @@ private fun ChatInputBar(
|
|||||||
enabled = canSend,
|
enabled = canSend,
|
||||||
modifier =
|
modifier =
|
||||||
Modifier
|
Modifier
|
||||||
.size(48.dp)
|
.size(40.dp)
|
||||||
.testTag("send_button"),
|
.testTag("send_button"),
|
||||||
shape = CircleShape,
|
shape = CircleShape,
|
||||||
contentPadding = PaddingValues(0.dp),
|
contentPadding = PaddingValues(0.dp),
|
||||||
|
|||||||
Reference in new issue
Block a user