This commit is contained in:
2025-09-18 18:19:19 +08:00
parent 6d2133545f
commit a200d00587
5 changed files with 72 additions and 22 deletions

View File

@@ -92,16 +92,22 @@ fun MomentCard(
showFollowButton = showFollowButton
)
}
val lastClickTime = remember { mutableStateOf(0L) }
val clickDelay = 500L
Column(
modifier = Modifier
.fillMaxWidth()
.noRippleClickable {
val currentTime = System.currentTimeMillis()
if (currentTime - lastClickTime.value > clickDelay) {
lastClickTime.value = currentTime
navController.navigateToPost(
momentEntity.id,
highlightCommentId = 0,
initImagePagerIndex = imageIndex
)
}
}
) {
MomentContentGroup(
momentEntity = momentEntity,
@@ -213,7 +219,6 @@ fun MomentPostLocation(location: String) {
text = location,
color = AppColors.secondaryText,
fontSize = 12.sp,
)
}
@@ -238,6 +243,8 @@ fun MomentTopRowGroup(
Row(
modifier = Modifier
) {
val lastClickTime = remember { mutableStateOf(0L) }
val clickDelay = 500L
CustomAsyncImage(
context,
momentEntity.avatar,
@@ -246,12 +253,16 @@ fun MomentTopRowGroup(
.size(40.dp)
.clip(RoundedCornerShape(40.dp))
.noRippleClickable {
val currentTime = System.currentTimeMillis()
if (currentTime - lastClickTime.value > clickDelay) {
lastClickTime.value = currentTime
navController.navigate(
NavigationRoute.AccountProfile.route.replace(
"{id}",
momentEntity.authorId.toString()
)
)
}
},
contentScale = ContentScale.Crop
)
@@ -267,7 +278,19 @@ fun MomentTopRowGroup(
verticalAlignment = Alignment.CenterVertically
) {
MomentName(
modifier = Modifier.weight(1f),
modifier = Modifier.weight(1f)
.noRippleClickable {
val currentTime = System.currentTimeMillis()
if (currentTime - lastClickTime.value > clickDelay) {
lastClickTime.value = currentTime
navController.navigate(
NavigationRoute.AccountProfile.route.replace(
"{id}",
momentEntity.authorId.toString()
)
)
}
},
name = momentEntity.nickname
)
Spacer(modifier = Modifier.width(16.dp))
@@ -416,6 +439,8 @@ fun MomentBottomOperateRowGroup(
momentEntity: MomentEntity,
imageIndex: Int = 0
) {
val lastClickTime = remember { mutableStateOf(0L) }
val clickDelay = 500L
var showCommentModal by remember { mutableStateOf(false) }
if (showCommentModal) {
ModalBottomSheet(
@@ -454,7 +479,6 @@ fun MomentBottomOperateRowGroup(
Column(
modifier = Modifier.fillMaxSize()
) {
// 图片指示器放在操作按钮上方
if (momentEntity.images.size > 1) {
Row(
modifier = Modifier
@@ -507,7 +531,11 @@ fun MomentBottomOperateRowGroup(
.wrapContentWidth()
.fillMaxHeight()
.noRippleClickable {
val currentTime = System.currentTimeMillis()
if (currentTime - lastClickTime.value > clickDelay) {
lastClickTime.value = currentTime
onCommentClick()
}
},
contentAlignment = Alignment.CenterEnd
) {

View File

@@ -362,7 +362,7 @@ fun IndexScreen() {
Text(
text = it.label(),
fontSize = 10.sp,
color = if (isSelected) AppColors.brandColorsColor else AppColors.text,
color = if (isSelected) Color.Blue else AppColors.text,
fontWeight = if (isSelected) FontWeight.W600 else FontWeight.Normal
)
}

View File

@@ -49,6 +49,8 @@ import com.aiosman.ravenow.ui.index.tabs.search.SearchViewModel
import com.aiosman.ravenow.ui.modifiers.noRippleClickable
import kotlinx.coroutines.launch
import androidx.compose.foundation.layout.wrapContentHeight
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.ColorFilter
import com.aiosman.ravenow.ui.composables.TabItem
@@ -120,6 +122,8 @@ fun MomentsList() {
//
// }
// Spacer(modifier = Modifier.width(16.dp))
val lastClickTime = remember { mutableStateOf(0L) }
val clickDelay = 500L
Text(
text = stringResource(R.string.moment),
fontSize = 20.sp,
@@ -137,7 +141,11 @@ fun MomentsList() {
modifier = Modifier
.size(24.dp)
.noRippleClickable {
val currentTime = System.currentTimeMillis()
if (currentTime - lastClickTime.value > clickDelay) {
lastClickTime.value = currentTime
navController.navigate(NavigationRoute.Search.route)
}
},
colorFilter = ColorFilter.tint(AppColors.text)
)

View File

@@ -279,6 +279,7 @@ fun LoginPage() {
contentDescription = "Rave Now",
modifier = Modifier
.size(52.dp)
.clip(RoundedCornerShape(10.dp))
)
Spacer(modifier = Modifier.height(8.dp))
Text(

View File

@@ -917,7 +917,20 @@ fun Header(
Text(
text = nickname ?: "",
fontWeight = FontWeight.Bold,
modifier = Modifier.weight(1f),
modifier = Modifier
.weight(1f)
.debouncedClickable(debounceTime = 1000L) {
userId?.let {
debouncedNavigation {
navController.navigate(
NavigationRoute.AccountProfile.route.replace(
"{id}",
userId.toString()
)
)
}
}
},
color = AppColors.text,
fontSize = 17.sp
)
@@ -1196,7 +1209,7 @@ fun PostImageView(
)
}
// Navigation and Indicator container
// 图片导航控件
if (images.size > 1) {
Row(
modifier = Modifier