动态输入评论UI调整

This commit is contained in:
2025-09-03 18:38:11 +08:00
parent e49e509c38
commit 1f1101e260

View File

@@ -3,6 +3,7 @@ package com.aiosman.ravenow.ui.composables
import androidx.compose.animation.Crossfade
import androidx.compose.animation.core.tween
import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
@@ -32,6 +33,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.focus.FocusRequester
import androidx.compose.ui.focus.focusRequester
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.SolidColor
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.painterResource
@@ -79,25 +81,6 @@ fun EditCommentBottomModal(
fontStyle = FontStyle.Italic,
color = AppColors.text
)
Crossfade(
targetState = text.isNotEmpty(), animationSpec = tween(500),
label = ""
) { isNotEmpty ->
Icon(
painter = painterResource(id = R.drawable.rider_pro_video_share),
contentDescription = "Emoji",
modifier = Modifier
.size(32.dp)
.noRippleClickable {
if (text.isNotEmpty()) {
onSend(text)
text = ""
}
},
tint = if (isNotEmpty) AppColors.main else AppColors.nonActive
)
}
}
Spacer(modifier = Modifier.height(16.dp))
if (replyComment != null) {
@@ -139,33 +122,59 @@ fun EditCommentBottomModal(
Row(
modifier = Modifier
.fillMaxWidth(),
verticalAlignment = Alignment.CenterVertically
verticalAlignment = Alignment.Top
) {
Box(
modifier = Modifier
.fillMaxWidth()
.weight(1f)
.clip(RoundedCornerShape(20.dp))
.background(AppColors.inputBackground)
.background(Color.White)
.border(1.dp, Color.Black, RoundedCornerShape(20.dp))
.padding(horizontal = 16.dp, vertical = 16.dp)
) {
BasicTextField(
value = text,
onValueChange = {
text = it
},
cursorBrush = SolidColor(AppColors.text),
modifier = Modifier
.fillMaxWidth()
.focusRequester(focusRequester),
textStyle = TextStyle(
color = AppColors.text,
fontWeight = FontWeight.Normal
),
minLines = 5
)
Row(
verticalAlignment = Alignment.Top
) {
BasicTextField(
value = text,
onValueChange = {
text = it
},
cursorBrush = SolidColor(AppColors.text),
modifier = Modifier
.weight(1f)
.focusRequester(focusRequester),
textStyle = TextStyle(
color = AppColors.text,
fontWeight = FontWeight.Normal
),
minLines = 1
)
Spacer(modifier = Modifier.width(8.dp))
Crossfade(
targetState = text.isNotEmpty(), animationSpec = tween(500),
label = ""
) { isNotEmpty ->
Icon(
painter = painterResource(id = R.mipmap.rider_pro_moment_post),
contentDescription = "Send",
modifier = Modifier
.size(25.dp)
.align(Alignment.Top)
.noRippleClickable {
if (text.isNotEmpty()) {
onSend(text)
text = ""
}
},
tint = if (isNotEmpty) AppColors.main else AppColors.nonActive
)
}
}
}
}
Spacer(modifier = Modifier.height(navBarHeight))
}
}
}