MessageEntryView: appearance tweaks
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
package net.buzzert.kordophonedroid.ui.messagelist
|
||||
|
||||
import androidx.compose.foundation.BorderStroke
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.imePadding
|
||||
import androidx.compose.foundation.layout.navigationBarsPadding
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.foundation.text.BasicTextField
|
||||
import androidx.compose.material.Button
|
||||
import androidx.compose.material.MaterialTheme
|
||||
@@ -15,6 +16,7 @@ import androidx.compose.material.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.shadow
|
||||
import androidx.compose.ui.graphics.SolidColor
|
||||
import androidx.compose.ui.text.input.KeyboardType
|
||||
import androidx.compose.ui.text.input.TextFieldValue
|
||||
@@ -29,28 +31,24 @@ fun MessageEntry(
|
||||
) {
|
||||
Row(
|
||||
modifier = Modifier
|
||||
.background(MaterialTheme.colors.onSurface.copy(alpha = 0.18f))
|
||||
.fillMaxWidth()
|
||||
.padding(8.dp)
|
||||
.padding(vertical = 8.dp, horizontal = 12.dp)
|
||||
.imePadding()
|
||||
.navigationBarsPadding()
|
||||
) {
|
||||
Surface(
|
||||
shape = RoundedCornerShape(8.dp),
|
||||
border = BorderStroke(1.dp, color = MaterialTheme.colors.onBackground.copy(0.4f))
|
||||
) {
|
||||
Row(modifier = Modifier
|
||||
.padding(horizontal = 8.dp)
|
||||
.weight(1f)
|
||||
.align(Alignment.Bottom)
|
||||
.imePadding()
|
||||
.navigationBarsPadding()
|
||||
Surface(
|
||||
shape = MaterialTheme.shapes.medium,
|
||||
modifier = Modifier.weight(1f)
|
||||
.align(Alignment.CenterVertically)
|
||||
.shadow(4.dp)
|
||||
) {
|
||||
BasicTextField(
|
||||
value = textFieldValue,
|
||||
onValueChange = { onTextChanged(it) },
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.weight(1f)
|
||||
.align(Alignment.CenterVertically)
|
||||
.padding(horizontal = 8.dp),
|
||||
.padding(horizontal = 8.dp, vertical = 8.dp),
|
||||
cursorBrush = SolidColor(MaterialTheme.colors.onBackground),
|
||||
textStyle = MaterialTheme.typography.body1.copy(MaterialTheme.colors.onBackground),
|
||||
decorationBox = { textContent ->
|
||||
@@ -66,11 +64,12 @@ fun MessageEntry(
|
||||
textContent()
|
||||
}
|
||||
)
|
||||
|
||||
Button(onClick = onSend) {
|
||||
Text(text = "Send")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Spacer(Modifier.width(8.dp))
|
||||
|
||||
Button(onClick = onSend) {
|
||||
Text(text = "Send")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -184,6 +184,7 @@ fun Messages(
|
||||
LazyColumn(
|
||||
reverseLayout = true,
|
||||
state = scrollState,
|
||||
contentPadding = PaddingValues(vertical = 8.dp),
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.padding(horizontal = 16.dp)
|
||||
|
||||
Reference in New Issue
Block a user