新增评论校验
This commit is contained in:
@@ -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,16 +77,25 @@ fun EditCommentBottomModal(
|
||||
fontSize = 20.sp,
|
||||
fontStyle = FontStyle.Italic
|
||||
)
|
||||
Image(
|
||||
painter = painterResource(id = R.drawable.rider_pro_send),
|
||||
contentDescription = "Send",
|
||||
modifier = Modifier
|
||||
.size(32.dp)
|
||||
.noRippleClickable {
|
||||
onSend(text)
|
||||
text = ""
|
||||
},
|
||||
)
|
||||
Crossfade(targetState = text.isNotEmpty(), animationSpec = tween(500)) { isNotEmpty ->
|
||||
Image(
|
||||
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) {
|
||||
|
||||
Reference in New Issue
Block a user