android: restyle chat composer to telegram-like container
Some checks are pending
CI / test (push) Has started running
Some checks are pending
CI / test (push) Has started running
This commit is contained in:
@@ -333,36 +333,51 @@ fun ChatScreen(
|
||||
}
|
||||
}
|
||||
|
||||
Row(
|
||||
Surface(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.navigationBarsPadding()
|
||||
.imePadding()
|
||||
.padding(horizontal = 12.dp, vertical = 8.dp),
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
horizontalArrangement = Arrangement.spacedBy(8.dp),
|
||||
.padding(horizontal = 10.dp, vertical = 8.dp),
|
||||
color = MaterialTheme.colorScheme.surfaceVariant.copy(alpha = 0.92f),
|
||||
shape = RoundedCornerShape(22.dp),
|
||||
) {
|
||||
Button(
|
||||
onClick = onPickMedia,
|
||||
enabled = state.canSendMessages && !state.isUploadingMedia,
|
||||
Row(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(horizontal = 8.dp, vertical = 6.dp),
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
horizontalArrangement = Arrangement.spacedBy(6.dp),
|
||||
) {
|
||||
Text(if (state.isUploadingMedia) "..." else "Attach")
|
||||
}
|
||||
OutlinedTextField(
|
||||
value = state.inputText,
|
||||
onValueChange = onInputChanged,
|
||||
modifier = Modifier.weight(1f),
|
||||
label = { Text("Message") },
|
||||
maxLines = 4,
|
||||
)
|
||||
Button(
|
||||
onClick = onSendClick,
|
||||
enabled = state.canSendMessages &&
|
||||
Button(
|
||||
onClick = { /* emoji placeholder */ },
|
||||
enabled = state.canSendMessages,
|
||||
) {
|
||||
Text("\uD83D\uDE03")
|
||||
}
|
||||
OutlinedTextField(
|
||||
value = state.inputText,
|
||||
onValueChange = onInputChanged,
|
||||
modifier = Modifier.weight(1f),
|
||||
placeholder = { Text("Message") },
|
||||
maxLines = 4,
|
||||
)
|
||||
Button(
|
||||
onClick = onPickMedia,
|
||||
enabled = state.canSendMessages && !state.isUploadingMedia,
|
||||
) {
|
||||
Text(if (state.isUploadingMedia) "..." else "\uD83D\uDCCE")
|
||||
}
|
||||
val canSend = state.canSendMessages &&
|
||||
!state.isSending &&
|
||||
!state.isUploadingMedia &&
|
||||
state.inputText.isNotBlank(),
|
||||
) {
|
||||
Text(if (state.isSending) "..." else "Send")
|
||||
state.inputText.isNotBlank()
|
||||
Button(
|
||||
onClick = { if (canSend) onSendClick() },
|
||||
enabled = state.canSendMessages && !state.isUploadingMedia,
|
||||
) {
|
||||
Text(if (canSend) "\u27A4" else "\uD83C\uDFA4")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user