新增评论校验

This commit is contained in:
2024-09-15 09:16:53 +08:00
parent 6247ade1dd
commit 4b28a882a9
2 changed files with 35 additions and 10 deletions

View File

@@ -1,5 +1,7 @@
package com.aiosman.riderpro.ui.composables
import androidx.compose.animation.Crossfade
import androidx.compose.animation.core.tween
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
@@ -24,6 +26,7 @@ import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberUpdatedState
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
@@ -74,17 +77,26 @@ fun EditCommentBottomModal(
fontSize = 20.sp,
fontStyle = FontStyle.Italic
)
Crossfade(targetState = text.isNotEmpty(), animationSpec = tween(500)) { isNotEmpty ->
Image(
painter = painterResource(id = R.drawable.rider_pro_send),
painter = rememberUpdatedState(
if (isNotEmpty) painterResource(id = R.drawable.rider_pro_send) else painterResource(
id = R.drawable.rider_pro_send_disable
)
).value,
contentDescription = "Send",
modifier = Modifier
.size(32.dp)
.noRippleClickable {
if (text.isNotEmpty()){
onSend(text)
text = ""
}
},
)
}
}
Spacer(modifier = Modifier.height(16.dp))
if (replyComment != null) {
Row(

View File

@@ -0,0 +1,13 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:alpha="0.77" android:height="24dp" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">
<path android:fillColor="#e0e0e0" android:pathData="M12,12m-12,0a12,12 0,1 1,24 0a12,12 0,1 1,-24 0"/>
<group>
<clip-path android:pathData="M12,12m-12,0a12,12 0,1 1,24 0a12,12 0,1 1,-24 0"/>
<path android:fillColor="#fff" android:fillType="evenOdd" android:pathData="M12,11l6,4.5L18,19l-6,-4.5L6,19L6,15.5ZM12,5 L18,9.5L18,13L12,8.5 6,13L6,9.5Z"/>
</group>
</vector>