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