修改聊天界面边距
This commit is contained in:
@@ -23,6 +23,7 @@ import androidx.compose.foundation.layout.navigationBars
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.foundation.layout.widthIn
|
||||
import androidx.compose.foundation.lazy.LazyColumn
|
||||
import androidx.compose.foundation.lazy.rememberLazyListState
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
@@ -57,6 +58,7 @@ import androidx.compose.ui.text.input.ImeAction
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.unit.Dp
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.max
|
||||
import androidx.compose.ui.unit.sp
|
||||
import androidx.lifecycle.ViewModel
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
@@ -221,9 +223,11 @@ fun ChatSelfItem(item: ChatItem) {
|
||||
Spacer(modifier = Modifier.height(4.dp))
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.widthIn(min = 20.dp, max = 250.dp)
|
||||
.clip(RoundedCornerShape(8.dp))
|
||||
.background(Color(0xFF000000))
|
||||
.padding(vertical = 8.dp, horizontal = 16.dp),
|
||||
.padding(vertical = 8.dp, horizontal = 16.dp)
|
||||
.padding(bottom = 3.dp)
|
||||
) {
|
||||
Text(
|
||||
text = item.message,
|
||||
@@ -231,17 +235,17 @@ fun ChatSelfItem(item: ChatItem) {
|
||||
color = Color.White,
|
||||
fontSize = 16.sp,
|
||||
),
|
||||
textAlign = TextAlign.End,
|
||||
textAlign = TextAlign.Start,
|
||||
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
Spacer(modifier = Modifier.width(16.dp))
|
||||
Spacer(modifier = Modifier.width(12.dp))
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.size(40.dp)
|
||||
.clip(RoundedCornerShape(16.dp))
|
||||
.clip(RoundedCornerShape(40.dp))
|
||||
) {
|
||||
CustomAsyncImage(
|
||||
imageUrl = item.avatar,
|
||||
@@ -267,7 +271,7 @@ fun ChatOtherItem(item: ChatItem) {
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.size(40.dp)
|
||||
.clip(RoundedCornerShape(16.dp))
|
||||
.clip(RoundedCornerShape(40.dp))
|
||||
) {
|
||||
CustomAsyncImage(
|
||||
imageUrl = item.avatar,
|
||||
@@ -275,7 +279,7 @@ fun ChatOtherItem(item: ChatItem) {
|
||||
contentDescription = "avatar"
|
||||
)
|
||||
}
|
||||
Spacer(modifier = Modifier.width(8.dp))
|
||||
Spacer(modifier = Modifier.width(12.dp))
|
||||
Column {
|
||||
Row() {
|
||||
Text(
|
||||
@@ -297,9 +301,11 @@ fun ChatOtherItem(item: ChatItem) {
|
||||
Spacer(modifier = Modifier.height(4.dp))
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.widthIn(min = 20.dp, max = 250.dp)
|
||||
.clip(RoundedCornerShape(8.dp))
|
||||
.background(Color(0xffFFFFFF))
|
||||
.padding(vertical = 8.dp, horizontal = 16.dp),
|
||||
.padding(vertical = 8.dp, horizontal = 16.dp)
|
||||
.padding(bottom = 3.dp)
|
||||
) {
|
||||
Text(
|
||||
text = item.message,
|
||||
|
||||
@@ -543,7 +543,7 @@ fun CommunicationOperatorGroup(
|
||||
contentDescription = ""
|
||||
)
|
||||
Text(
|
||||
text = "Chat",
|
||||
text = "CHAT",
|
||||
fontSize = 14.sp,
|
||||
color = Color.Black,
|
||||
fontWeight = FontWeight.Bold,
|
||||
|
||||
Reference in New Issue
Block a user