优化通知页面UI
关闭列表中的顶部占位,用户名Text增加maxLines = 1和overflow = TextOverflow.Ellipsis,超长昵称会自动截断显示…。 关于派派UI调整 更换图标和文本
This commit is contained in:
@@ -2,6 +2,7 @@ package com.aiosman.ravenow.ui.about
|
||||
|
||||
import androidx.compose.foundation.Image
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
@@ -40,22 +41,21 @@ fun AboutScreen() {
|
||||
modifier = Modifier.padding(horizontal = 24.dp, vertical = 16.dp)
|
||||
) {
|
||||
NoticeScreenHeader(
|
||||
title = stringResource(R.string.about_rave_now),
|
||||
title = stringResource(R.string.about_paipai),
|
||||
moreIcon = false
|
||||
)
|
||||
}
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.weight(1f)
|
||||
.fillMaxWidth()
|
||||
.padding(start = 24.dp),
|
||||
horizontalAlignment = Alignment.CenterHorizontally
|
||||
.fillMaxWidth(),
|
||||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
verticalArrangement = Arrangement.Center
|
||||
) {
|
||||
Spacer(modifier = Modifier.height(48.dp))
|
||||
// app icon
|
||||
// app icondww
|
||||
Box {
|
||||
Image(
|
||||
painter = painterResource(id = R.mipmap.rider_pro_color_logo_next),
|
||||
painter = painterResource(id = R.mipmap.invalid_name),
|
||||
contentDescription = "app icon",
|
||||
modifier = Modifier.size(80.dp)
|
||||
)
|
||||
@@ -63,7 +63,7 @@ fun AboutScreen() {
|
||||
Spacer(modifier = Modifier.height(24.dp))
|
||||
// app name
|
||||
Text(
|
||||
text = "Rave Now".uppercase(),
|
||||
text = stringResource(R.string.paipai),
|
||||
fontSize = 24.sp,
|
||||
color = appColors.text,
|
||||
fontWeight = FontWeight.ExtraBold
|
||||
|
||||
@@ -50,7 +50,7 @@ import kotlinx.coroutines.launch
|
||||
import com.aiosman.ravenow.utils.NetworkUtils
|
||||
import com.aiosman.ravenow.ui.network.ReloadButton
|
||||
@Composable
|
||||
fun CommentNoticeScreen() {
|
||||
fun CommentNoticeScreen(includeStatusBarPadding: Boolean = true){
|
||||
val viewModel = viewModel<CommentNoticeListViewModel>(
|
||||
key = "CommentNotice",
|
||||
factory = object : ViewModelProvider.Factory {
|
||||
@@ -252,7 +252,9 @@ fun CommentNoticeItem(
|
||||
text = commentItem.name,
|
||||
fontSize = 18.sp,
|
||||
modifier = Modifier,
|
||||
color = AppColors.text
|
||||
color = AppColors.text,
|
||||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis
|
||||
)
|
||||
Spacer(modifier = Modifier.height(4.dp))
|
||||
Row {
|
||||
|
||||
@@ -36,6 +36,7 @@ fun StatusBarMaskLayout(
|
||||
modifier: Modifier = Modifier,
|
||||
darkIcons: Boolean = true,
|
||||
useNavigationBarMask: Boolean = true,
|
||||
includeStatusBarPadding: Boolean = true,
|
||||
maskBoxBackgroundColor: Color = Color.Transparent,
|
||||
content: @Composable ColumnScope.() -> Unit
|
||||
) {
|
||||
@@ -50,13 +51,13 @@ fun StatusBarMaskLayout(
|
||||
Column(
|
||||
modifier = modifier.fillMaxSize()
|
||||
) {
|
||||
if (includeStatusBarPadding) {
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.height(paddingValues.calculateTopPadding())
|
||||
.fillMaxWidth()
|
||||
.background(maskBoxBackgroundColor)
|
||||
) {
|
||||
|
||||
)
|
||||
}
|
||||
content()
|
||||
if (navigationBarPaddings > 24.dp && useNavigationBarMask) {
|
||||
|
||||
@@ -21,6 +21,7 @@ import androidx.compose.runtime.rememberCoroutineScope
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.clip
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.res.stringResource
|
||||
@@ -48,13 +49,14 @@ import com.aiosman.ravenow.utils.NetworkUtils
|
||||
* 关注消息列表
|
||||
*/
|
||||
@Composable
|
||||
fun FollowerNoticeScreen() {
|
||||
fun FollowerNoticeScreen(includeStatusBarPadding: Boolean = true) {
|
||||
val scope = rememberCoroutineScope()
|
||||
val AppColors = LocalAppTheme.current
|
||||
StatusBarMaskLayout(
|
||||
modifier = Modifier.background(color = AppColors.background).padding(horizontal = 16.dp),
|
||||
darkIcons = !AppState.darkMode,
|
||||
maskBoxBackgroundColor = AppColors.background
|
||||
maskBoxBackgroundColor = AppColors.background,
|
||||
includeStatusBarPadding = includeStatusBarPadding
|
||||
) {
|
||||
val model = FollowerNoticeViewModel
|
||||
var dataFlow = model.followerItemsFlow
|
||||
@@ -199,7 +201,14 @@ fun FollowItem(
|
||||
Column(
|
||||
modifier = Modifier.weight(1f)
|
||||
) {
|
||||
Text(nickname, fontWeight = FontWeight.Bold, fontSize = 16.sp, color = AppColors.text)
|
||||
Text(
|
||||
text = nickname,
|
||||
fontWeight = FontWeight.Bold,
|
||||
fontSize = 16.sp,
|
||||
color = AppColors.text,
|
||||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis
|
||||
)
|
||||
}
|
||||
if (!isFollowing && userId != AppState.UserId) {
|
||||
FollowButton(
|
||||
|
||||
@@ -28,6 +28,7 @@ import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.text.style.TextOverflow
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
@@ -49,7 +50,7 @@ import com.aiosman.ravenow.utils.NetworkUtils
|
||||
import com.aiosman.ravenow.ui.network.ReloadButton
|
||||
@Preview
|
||||
@Composable
|
||||
fun LikeNoticeScreen() {
|
||||
fun LikeNoticeScreen(includeStatusBarPadding: Boolean = true) {
|
||||
val model = LikeNoticeViewModel
|
||||
val listState = rememberLazyListState()
|
||||
var dataFlow = model.likeItemsFlow
|
||||
@@ -63,7 +64,8 @@ fun LikeNoticeScreen() {
|
||||
|
||||
StatusBarMaskLayout(
|
||||
darkIcons = !AppState.darkMode,
|
||||
maskBoxBackgroundColor = AppColors.background
|
||||
maskBoxBackgroundColor = AppColors.background,
|
||||
includeStatusBarPadding = includeStatusBarPadding
|
||||
) {
|
||||
Column(
|
||||
modifier = Modifier
|
||||
@@ -219,7 +221,14 @@ fun ActionPostNoticeItem(
|
||||
)
|
||||
}
|
||||
) {
|
||||
Text(nickName, fontWeight = FontWeight.Bold, fontSize = 16.sp, color = AppColors.text)
|
||||
Text(
|
||||
text = nickName,
|
||||
fontWeight = FontWeight.Bold,
|
||||
fontSize = 16.sp,
|
||||
color = AppColors.text,
|
||||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis
|
||||
)
|
||||
Spacer(modifier = Modifier.height(2.dp))
|
||||
when (action) {
|
||||
"like" -> Text(stringResource(R.string.like_your_post), color = AppColors.text)
|
||||
@@ -283,7 +292,14 @@ fun LikeCommentNoticeItem(
|
||||
modifier = Modifier
|
||||
.weight(1f)
|
||||
) {
|
||||
Text(item.user.nickName, fontWeight = FontWeight.Bold, fontSize = 16.sp, color = AppColors.text)
|
||||
Text(
|
||||
text = item.user.nickName,
|
||||
fontWeight = FontWeight.Bold,
|
||||
fontSize = 16.sp,
|
||||
color = AppColors.text,
|
||||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis
|
||||
)
|
||||
Spacer(modifier = Modifier.height(2.dp))
|
||||
Text(stringResource(R.string.like_your_comment), color = AppColors.text)
|
||||
Spacer(modifier = Modifier.height(2.dp))
|
||||
|
||||
@@ -22,6 +22,7 @@ import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.rememberCoroutineScope
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.graphics.ColorFilter
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.res.stringResource
|
||||
@@ -89,7 +90,7 @@ fun NotificationScreen() {
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.wrapContentHeight()
|
||||
.padding(start = 16.dp, top = 8.dp, bottom = 16.dp),
|
||||
.padding(start = 16.dp, top = 8.dp),
|
||||
horizontalArrangement = Arrangement.Start,
|
||||
verticalAlignment = Alignment.Bottom
|
||||
) {
|
||||
@@ -135,9 +136,9 @@ fun NotificationScreen() {
|
||||
.weight(1f)
|
||||
) { page ->
|
||||
when (page) {
|
||||
0 -> LikeNoticeScreen()
|
||||
1 -> FollowerNoticeScreen()
|
||||
2 -> CommentNoticeScreen()
|
||||
0 -> LikeNoticeScreen(includeStatusBarPadding = false)
|
||||
1 -> FollowerNoticeScreen(includeStatusBarPadding = false)
|
||||
2 -> CommentNoticeScreen(includeStatusBarPadding = false)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -221,6 +221,8 @@
|
||||
<string name="add_memory">上部のボタンをクリックしてグループ記憶を追加してください</string>
|
||||
<string name="recent_search">けんさくりれき</string>
|
||||
<string name="people">人</string>
|
||||
<string name="paipai">Paip.ai</string>
|
||||
<string name="null_search">まだここは空です</string>
|
||||
|
||||
<!-- Create Bottom Sheet -->
|
||||
<string name="create_title">作成</string>
|
||||
|
||||
@@ -222,13 +222,14 @@
|
||||
<string name="no_drafts">暂无草稿</string>
|
||||
<string name="only_save_the_last_5_drafts">仅保存最近5个草稿</string>
|
||||
<string name="recent_search">历史搜索</string>
|
||||
|
||||
<string name="null_search">这里还空着呢~</string>
|
||||
<!-- Create Bottom Sheet -->
|
||||
<string name="create_title">创建</string>
|
||||
<string name="create_ai">AI</string>
|
||||
<string name="create_group_chat_option">群聊</string>
|
||||
<string name="create_moment">动态</string>
|
||||
<string name="create_close">关闭</string>
|
||||
<string name="paipai">派派</string>
|
||||
|
||||
<!-- Create Agent Page -->
|
||||
<string name="welcome_1">你好呀!今天想创造什么?</string>
|
||||
|
||||
@@ -220,6 +220,8 @@
|
||||
<string name="add_memory">Click the button above to add group memory</string>
|
||||
<string name="recent_search">Recent Search</string>
|
||||
<string name="people">people</string>
|
||||
<string name="paipai">Paip.ai</string>
|
||||
<string name="null_search">It\'s still empty here</string>
|
||||
|
||||
<!-- Create Bottom Sheet -->
|
||||
<string name="create_title">Create</string>
|
||||
@@ -347,7 +349,7 @@
|
||||
<!-- Side Menu -->
|
||||
<string name="scan_qr">Scan QR</string>
|
||||
<string name="edit_profile_info">Edit Profile</string>
|
||||
<string name="about_paipai">About Paipai</string>
|
||||
<string name="about_paipai">About Paip.ai</string>
|
||||
<string name="follow_system">Follow System</string>
|
||||
<string name="message_notification">Message Notification</string>
|
||||
<string name="logout_confirm">Logout</string>
|
||||
|
||||
Reference in New Issue
Block a user