新增评论校验
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
package com.aiosman.riderpro.ui.composables
|
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.Image
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
import androidx.compose.foundation.layout.Box
|
import androidx.compose.foundation.layout.Box
|
||||||
@@ -24,6 +26,7 @@ import androidx.compose.runtime.LaunchedEffect
|
|||||||
import androidx.compose.runtime.getValue
|
import androidx.compose.runtime.getValue
|
||||||
import androidx.compose.runtime.mutableStateOf
|
import androidx.compose.runtime.mutableStateOf
|
||||||
import androidx.compose.runtime.remember
|
import androidx.compose.runtime.remember
|
||||||
|
import androidx.compose.runtime.rememberUpdatedState
|
||||||
import androidx.compose.runtime.setValue
|
import androidx.compose.runtime.setValue
|
||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
@@ -74,16 +77,25 @@ fun EditCommentBottomModal(
|
|||||||
fontSize = 20.sp,
|
fontSize = 20.sp,
|
||||||
fontStyle = FontStyle.Italic
|
fontStyle = FontStyle.Italic
|
||||||
)
|
)
|
||||||
Image(
|
Crossfade(targetState = text.isNotEmpty(), animationSpec = tween(500)) { isNotEmpty ->
|
||||||
painter = painterResource(id = R.drawable.rider_pro_send),
|
Image(
|
||||||
contentDescription = "Send",
|
painter = rememberUpdatedState(
|
||||||
modifier = Modifier
|
if (isNotEmpty) painterResource(id = R.drawable.rider_pro_send) else painterResource(
|
||||||
.size(32.dp)
|
id = R.drawable.rider_pro_send_disable
|
||||||
.noRippleClickable {
|
)
|
||||||
onSend(text)
|
).value,
|
||||||
text = ""
|
contentDescription = "Send",
|
||||||
},
|
modifier = Modifier
|
||||||
)
|
.size(32.dp)
|
||||||
|
.noRippleClickable {
|
||||||
|
if (text.isNotEmpty()){
|
||||||
|
onSend(text)
|
||||||
|
text = ""
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Spacer(modifier = Modifier.height(16.dp))
|
Spacer(modifier = Modifier.height(16.dp))
|
||||||
if (replyComment != null) {
|
if (replyComment != null) {
|
||||||
|
|||||||
13
app/src/main/res/drawable/rider_pro_send_disable.xml
Normal file
13
app/src/main/res/drawable/rider_pro_send_disable.xml
Normal 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>
|
||||||
Reference in New Issue
Block a user