标签页调整
This commit is contained in:
@@ -37,12 +37,12 @@ fun TabItem(
|
||||
) {
|
||||
Text(
|
||||
text = text,
|
||||
fontSize = 14.sp,
|
||||
fontSize = 15.sp,
|
||||
color = if (isSelected) AppColors.tabSelectedText else AppColors.tabUnselectedText,
|
||||
modifier = Modifier
|
||||
.clip(RoundedCornerShape(8.dp))
|
||||
.clip(RoundedCornerShape(12.dp))
|
||||
.background(if (isSelected) AppColors.tabSelectedBackground else AppColors.tabUnselectedBackground)
|
||||
.padding(horizontal = 11.dp, vertical = 4.dp)
|
||||
.padding(horizontal = 16.dp, vertical = 8.dp)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,8 +23,6 @@ import com.aiosman.ravenow.exp.formatChatTime
|
||||
import com.aiosman.ravenow.ui.NavigationRoute
|
||||
import com.aiosman.ravenow.ui.navigateToChat
|
||||
import com.aiosman.ravenow.utils.TrtcHelper
|
||||
// 临时兼容层 - TODO: 完成 OpenIM 迁移后删除
|
||||
import com.aiosman.ravenow.compat.*
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
@@ -143,140 +143,180 @@ fun NotificationsScreen() {
|
||||
Row(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(horizontal = 15.dp),
|
||||
.height(44.dp)
|
||||
.padding(horizontal = 16.dp),
|
||||
horizontalArrangement = Arrangement.Start,
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
) {
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.size(24.dp)
|
||||
)
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.weight(1f)
|
||||
.align(Alignment.CenterVertically),
|
||||
horizontalAlignment = Alignment.CenterHorizontally
|
||||
) {
|
||||
Text(
|
||||
text = stringResource(R.string.main_message),
|
||||
fontSize = 17.sp,
|
||||
fontWeight = FontWeight.W700,
|
||||
fontSize = 20.sp,
|
||||
fontWeight = FontWeight.W900,
|
||||
color = AppColors.text
|
||||
)
|
||||
}
|
||||
|
||||
Spacer(modifier = Modifier.weight(1f))
|
||||
|
||||
Image(
|
||||
painter = painterResource(id = R.drawable.rider_pro_group),
|
||||
contentDescription = "add",
|
||||
painter = painterResource(id = R.drawable.rider_pro_nav_search),
|
||||
contentDescription = "search",
|
||||
modifier = Modifier
|
||||
.size(24.dp)
|
||||
.noRippleClickable {
|
||||
debouncer {
|
||||
navController.navigate(NavigationRoute.CreateGroupChat.route)
|
||||
}
|
||||
// TODO: 实现搜索功能
|
||||
},
|
||||
colorFilter = ColorFilter.tint(AppColors.text)
|
||||
)
|
||||
|
||||
Spacer(modifier = Modifier.width(16.dp))
|
||||
|
||||
Box {
|
||||
Image(
|
||||
painter = painterResource(id = R.drawable.rider_pro_notification),
|
||||
contentDescription = "notifications",
|
||||
modifier = Modifier
|
||||
.size(24.dp)
|
||||
.noRippleClickable {
|
||||
// TODO: 实现通知功能
|
||||
},
|
||||
colorFilter = ColorFilter.tint(AppColors.text)
|
||||
)
|
||||
|
||||
}
|
||||
// 搜索栏//
|
||||
// 通知红点
|
||||
val totalNoticeCount = MessageListViewModel.likeNoticeCount +
|
||||
MessageListViewModel.followNoticeCount +
|
||||
MessageListViewModel.commentNoticeCount +
|
||||
MessageListViewModel.favouriteNoticeCount
|
||||
|
||||
if (totalNoticeCount > 0) {
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(horizontal = 16.dp, vertical = 8.dp)
|
||||
.height(40.dp)
|
||||
|
||||
.noRippleClickable {
|
||||
},
|
||||
contentAlignment = Alignment.CenterStart
|
||||
) {
|
||||
Row(
|
||||
modifier = Modifier
|
||||
.height(36.dp)
|
||||
.fillMaxWidth()
|
||||
.clip(shape = RoundedCornerShape(8.dp))
|
||||
.background(AppColors.inputBackground)
|
||||
.padding(horizontal = 8.dp, vertical = 0.dp)
|
||||
.noRippleClickable {
|
||||
// 搜索框点击事件
|
||||
},
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
) {
|
||||
Icon(
|
||||
painter = painterResource(id = R.drawable.rider_pro_nav_search),
|
||||
contentDescription = null,
|
||||
tint = AppColors.inputHint
|
||||
.size(8.dp)
|
||||
.background(
|
||||
color = Color(0xFFFF3B30),
|
||||
shape = CircleShape
|
||||
)
|
||||
Box {
|
||||
androidx.compose.material.Text(
|
||||
text = stringResource(R.string.search),
|
||||
modifier = Modifier.padding(start = 8.dp),
|
||||
color = AppColors.inputHint,
|
||||
fontSize = 17.sp
|
||||
.align(Alignment.TopEnd)
|
||||
.offset(x = 8.dp, y = (-4).dp)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Row(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(horizontal = 16.dp),
|
||||
horizontalArrangement = Arrangement.SpaceBetween,
|
||||
) {
|
||||
val likeDebouncer = rememberDebouncer()
|
||||
val followDebouncer = rememberDebouncer()
|
||||
val commentDebouncer = rememberDebouncer()
|
||||
//创建群聊//
|
||||
// Image(
|
||||
// painter = painterResource(id = R.drawable.rider_pro_group),
|
||||
// contentDescription = "add",
|
||||
// modifier = Modifier
|
||||
// .size(24.dp)
|
||||
// .noRippleClickable {
|
||||
// debouncer {
|
||||
// navController.navigate(NavigationRoute.CreateGroupChat.route)
|
||||
// }
|
||||
// },
|
||||
// colorFilter = ColorFilter.tint(AppColors.text)
|
||||
// )
|
||||
|
||||
NotificationIndicator(
|
||||
MessageListViewModel.likeNoticeCount,
|
||||
R.mipmap.rider_pro_like,
|
||||
stringResource(R.string.like_upper),
|
||||
Color(0xFFFAFD5D)
|
||||
) {
|
||||
likeDebouncer {
|
||||
if (MessageListViewModel.likeNoticeCount > 0) {
|
||||
// 刷新点赞消息列表
|
||||
LikeNoticeViewModel.isFirstLoad = true
|
||||
// 清除点赞消息数量
|
||||
MessageListViewModel.clearLikeNoticeCount()
|
||||
}
|
||||
navController.navigate(NavigationRoute.Likes.route)
|
||||
}
|
||||
}
|
||||
NotificationIndicator(
|
||||
MessageListViewModel.followNoticeCount,
|
||||
R.mipmap.rider_pro_followers,
|
||||
stringResource(R.string.followers_upper),
|
||||
Color(0xFFF470FE)
|
||||
) {
|
||||
followDebouncer {
|
||||
if (MessageListViewModel.followNoticeCount > 0) {
|
||||
// 刷新关注消息列表
|
||||
FollowerNoticeViewModel.isFirstLoad = true
|
||||
MessageListViewModel.clearFollowNoticeCount()
|
||||
}
|
||||
navController.navigate(NavigationRoute.Followers.route)
|
||||
}
|
||||
}
|
||||
NotificationIndicator(
|
||||
MessageListViewModel.commentNoticeCount,
|
||||
R.mipmap.rider_pro_comment,
|
||||
stringResource(R.string.comment).uppercase(),
|
||||
Color(0xFF6246FF)
|
||||
) {
|
||||
commentDebouncer {
|
||||
navController.navigate(NavigationRoute.CommentNoticeScreen.route)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// // 搜索栏//
|
||||
// Box(
|
||||
// modifier = Modifier
|
||||
// .fillMaxWidth()
|
||||
// .padding(horizontal = 16.dp, vertical = 8.dp)
|
||||
// .height(40.dp)
|
||||
//
|
||||
// .noRippleClickable {
|
||||
// },
|
||||
// contentAlignment = Alignment.CenterStart
|
||||
// )
|
||||
// {
|
||||
// Row(
|
||||
// modifier = Modifier
|
||||
// .height(36.dp)
|
||||
// .fillMaxWidth()
|
||||
// .clip(shape = RoundedCornerShape(8.dp))
|
||||
// .background(AppColors.inputBackground)
|
||||
// .padding(horizontal = 8.dp, vertical = 0.dp)
|
||||
// .noRippleClickable {
|
||||
// // 搜索框点击事件
|
||||
// },
|
||||
// verticalAlignment = Alignment.CenterVertically
|
||||
// ) {
|
||||
// Icon(
|
||||
// painter = painterResource(id = R.drawable.rider_pro_nav_search),
|
||||
// contentDescription = null,
|
||||
// tint = AppColors.inputHint
|
||||
// )
|
||||
// Box {
|
||||
// androidx.compose.material.Text(
|
||||
// text = stringResource(R.string.search),
|
||||
// modifier = Modifier.padding(start = 8.dp),
|
||||
// color = AppColors.inputHint,
|
||||
// fontSize = 17.sp
|
||||
// )
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
//赞、粉丝、评论//
|
||||
// Row(
|
||||
// modifier = Modifier
|
||||
// .fillMaxWidth()
|
||||
// .padding(horizontal = 16.dp),
|
||||
// horizontalArrangement = Arrangement.SpaceBetween,
|
||||
// ) {
|
||||
// val likeDebouncer = rememberDebouncer()
|
||||
// val followDebouncer = rememberDebouncer()
|
||||
// val commentDebouncer = rememberDebouncer()
|
||||
//
|
||||
// NotificationIndicator(
|
||||
// MessageListViewModel.likeNoticeCount,
|
||||
// R.mipmap.rider_pro_like,
|
||||
// stringResource(R.string.like_upper),
|
||||
// Color(0xFFFAFD5D)
|
||||
// ) {
|
||||
// likeDebouncer {
|
||||
// if (MessageListViewModel.likeNoticeCount > 0) {
|
||||
// // 刷新点赞消息列表
|
||||
// LikeNoticeViewModel.isFirstLoad = true
|
||||
// // 清除点赞消息数量
|
||||
// MessageListViewModel.clearLikeNoticeCount()
|
||||
// }
|
||||
// navController.navigate(NavigationRoute.Likes.route)
|
||||
// }
|
||||
// }
|
||||
// NotificationIndicator(
|
||||
// MessageListViewModel.followNoticeCount,
|
||||
// R.mipmap.rider_pro_followers,
|
||||
// stringResource(R.string.followers_upper),
|
||||
// Color(0xFFF470FE)
|
||||
// ) {
|
||||
// followDebouncer {
|
||||
// if (MessageListViewModel.followNoticeCount > 0) {
|
||||
// // 刷新关注消息列表
|
||||
// FollowerNoticeViewModel.isFirstLoad = true
|
||||
// MessageListViewModel.clearFollowNoticeCount()
|
||||
// }
|
||||
// navController.navigate(NavigationRoute.Followers.route)
|
||||
// }
|
||||
// }
|
||||
// NotificationIndicator(
|
||||
// MessageListViewModel.commentNoticeCount,
|
||||
// R.mipmap.rider_pro_comment,
|
||||
// stringResource(R.string.comment).uppercase(),
|
||||
// Color(0xFF6246FF)
|
||||
// ) {
|
||||
// commentDebouncer {
|
||||
// navController.navigate(NavigationRoute.CommentNoticeScreen.route)
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
Spacer(modifier = Modifier.height(23.dp))
|
||||
Row(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.wrapContentHeight()
|
||||
.padding(start = 16.dp,bottom = 16.dp),
|
||||
// center the tabs
|
||||
horizontalArrangement = Arrangement.Start,
|
||||
verticalAlignment = Alignment.Bottom
|
||||
) {
|
||||
|
||||
@@ -88,6 +88,7 @@ fun MomentsList() {
|
||||
horizontalArrangement = Arrangement.Start,
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
) {
|
||||
//原探索//
|
||||
// Column(
|
||||
// modifier = Modifier
|
||||
// .noRippleClickable {
|
||||
@@ -154,10 +155,10 @@ fun MomentsList() {
|
||||
) {
|
||||
val tabDebouncer = rememberDebouncer()
|
||||
|
||||
// 探索标签
|
||||
// 新探索标签
|
||||
Box {
|
||||
CustomTabItem(
|
||||
text = stringResource(R.string.index_dynamic),
|
||||
text = stringResource(R.string.index_worldwide),
|
||||
isSelected = pagerState.currentPage == 0,
|
||||
onClick = {
|
||||
tabDebouncer {
|
||||
@@ -274,9 +275,9 @@ fun CustomTabItem(
|
||||
fontSize = 15.sp,
|
||||
color = if (isSelected) AppColors.tabSelectedText else AppColors.tabUnselectedText,
|
||||
modifier = Modifier
|
||||
.clip(RoundedCornerShape(10.dp))
|
||||
.clip(RoundedCornerShape(12.dp))
|
||||
.background(if (isSelected) AppColors.tabSelectedBackground else AppColors.tabUnselectedBackground)
|
||||
.padding(horizontal = 11.dp, vertical = 4.dp)
|
||||
.padding(horizontal = 16.dp, vertical = 8.dp)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user