个人信息页和用户信息页UI调整

This commit is contained in:
2025-10-13 18:49:47 +08:00
parent 7f2c103ada
commit f0a9704e2d
6 changed files with 109 additions and 60 deletions

View File

@@ -318,41 +318,40 @@ fun ProfileV3(
} }
) { ) {
// banner // banner
Box( val banner = profile?.banner
modifier = Modifier if (banner != null) {
.fillMaxWidth()
.height(bannerHeight.dp)
.background(AppColors.profileBackground)
) {
Box( Box(
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.height(bannerHeight.dp - 24.dp) .height(bannerHeight.dp)
.let { .background(AppColors.profileBackground)
if (isSelf&&isMain) {
it.noRippleClickable {
Intent(Intent.ACTION_PICK).apply {
type = "image/*"
pickBannerImageLauncher.launch(
this
)
}
}
} else {
it
}
}
.shadow(
elevation = 6.dp,
shape = RoundedCornerShape(
bottomStart = 32.dp,
bottomEnd = 32.dp
),
)
) { ) {
val banner = profile?.banner Box(
modifier = Modifier
if (banner != null) { .fillMaxWidth()
.height(bannerHeight.dp - 24.dp)
.let {
if (isSelf&&isMain) {
it.noRippleClickable {
Intent(Intent.ACTION_PICK).apply {
type = "image/*"
pickBannerImageLauncher.launch(
this
)
}
}
} else {
it
}
}
.shadow(
elevation = 6.dp,
shape = RoundedCornerShape(
bottomStart = 32.dp,
bottomEnd = 32.dp
),
)
) {
CustomAsyncImage( CustomAsyncImage(
LocalContext.current, LocalContext.current,
banner, banner,
@@ -361,18 +360,12 @@ fun ProfileV3(
contentDescription = "", contentDescription = "",
contentScale = ContentScale.Crop contentScale = ContentScale.Crop
) )
} else {
Image(
painter = painterResource(id = R.drawable.rave_now_profile_backgrount_demo_1),
modifier = Modifier
.fillMaxSize(),
contentDescription = "",
contentScale = ContentScale.Crop
)
} }
} }
}else {
Spacer(modifier = Modifier.height(100.dp))
} }
Box( Box(
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
@@ -478,6 +471,8 @@ fun ProfileV3(
} }
//顶部导航栏
Box(modifier = Modifier.fillMaxWidth()) { Box(modifier = Modifier.fillMaxWidth()) {
Column( Column(
modifier = Modifier modifier = Modifier

View File

@@ -50,8 +50,8 @@ fun OtherProfileAction(
// 定义渐变色 // 定义渐变色
val followGradient = Brush.horizontalGradient( val followGradient = Brush.horizontalGradient(
colors = listOf( colors = listOf(
Color(0xFFE53E3E), // 红色 Color(0xFF7c45ed),
Color(0xFF9F7AEA) // 紫色 Color(0x777c68ef)
) )
) )
@@ -100,7 +100,7 @@ fun OtherProfileAction(
Text( Text(
text = if (profile.isFollowing) "已关注" else stringResource(R.string.follow_upper), text = if (profile.isFollowing) "已关注" else stringResource(R.string.follow_upper),
fontSize = 14.sp, fontSize = 14.sp,
fontWeight = FontWeight.W600, fontWeight = FontWeight.W900,
color = if (profile.isFollowing) { color = if (profile.isFollowing) {
// 已关注状态 - 灰色文字 // 已关注状态 - 灰色文字
AppColors.text.copy(alpha = 0.6f) AppColors.text.copy(alpha = 0.6f)
@@ -133,11 +133,37 @@ fun OtherProfileAction(
Text( Text(
text = stringResource(R.string.chat_upper), text = stringResource(R.string.chat_upper),
fontSize = 14.sp, fontSize = 14.sp,
fontWeight = FontWeight.W600, fontWeight = FontWeight.W900,
color = AppColors.text, // 使用主题文字颜色 color = AppColors.text, // 使用主题文字颜色
) )
} }
} }
// 分享按钮 - 灰色背景样式
Row(
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.Center,
modifier = Modifier
.weight(1f)
.clip(RoundedCornerShape(8.dp))
.background(AppColors.nonActive)
.padding(horizontal = 16.dp, vertical = 12.dp)
.noRippleClickable {
// 检查游客模式,如果是游客则跳转登录
if (GuestLoginCheckOut.needLogin(GuestLoginCheckOutScene.CHAT_WITH_AGENT)) {
navController.navigate(NavigationRoute.Login.route)
} else {
// TODO: 添加分享逻辑
}
}
) {
Text(
text = stringResource(R.string.share),
fontSize = 14.sp,
fontWeight = FontWeight.W900,
color = AppColors.text, // 使用主题文字颜色
)
}
} }
} }

View File

@@ -29,11 +29,13 @@ import com.aiosman.ravenow.ui.modifiers.noRippleClickable
@Composable @Composable
fun SelfProfileAction( fun SelfProfileAction(
onEditProfile: () -> Unit, onEditProfile: () -> Unit,
onPremiumClick: (() -> Unit)? = null onPremiumClick: (() -> Unit),
onShare: (() -> Unit)? = null
) { ) {
val AppColors = LocalAppTheme.current val AppColors = LocalAppTheme.current
val editProfileDebouncer = rememberDebouncer() val editProfileDebouncer = rememberDebouncer()
val premiumClickDebouncer = rememberDebouncer() val premiumClickDebouncer = rememberDebouncer()
val shareDebouncer = rememberDebouncer()
Row( Row(
verticalAlignment = Alignment.CenterVertically, verticalAlignment = Alignment.CenterVertically,
@@ -46,7 +48,7 @@ fun SelfProfileAction(
horizontalArrangement = Arrangement.Center, horizontalArrangement = Arrangement.Center,
modifier = Modifier modifier = Modifier
.weight(1f) .weight(1f)
.clip(RoundedCornerShape(8.dp)) .clip(RoundedCornerShape(18.dp))
.background(AppColors.nonActive) .background(AppColors.nonActive)
.padding(horizontal = 16.dp, vertical = 12.dp) .padding(horizontal = 16.dp, vertical = 12.dp)
.noRippleClickable { .noRippleClickable {
@@ -63,34 +65,57 @@ fun SelfProfileAction(
) )
} }
// Rave Premium 按钮(右侧) // 分享按钮
Row( Row(
verticalAlignment = Alignment.CenterVertically, verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.Center, horizontalArrangement = Arrangement.Center,
modifier = Modifier modifier = Modifier
.weight(1f) .weight(1f)
.clip(RoundedCornerShape(8.dp)) .clip(RoundedCornerShape(18.dp))
.background(AppColors.premiumBackground) .background(AppColors.nonActive)
.padding(horizontal = 16.dp, vertical = 12.dp) .padding(horizontal = 16.dp, vertical = 12.dp)
.noRippleClickable { .noRippleClickable {
premiumClickDebouncer { shareDebouncer {
onPremiumClick?.invoke() // TODO: 添加分享逻辑
} }
} }
) { ) {
Image(
painter = painterResource(id = R.drawable.ic_member),
contentDescription = "",
modifier = Modifier.size(18.dp),
colorFilter = ColorFilter.tint(AppColors.premiumText)
)
Spacer(modifier = Modifier.width(8.dp))
Text( Text(
text = "Rave Premium", text = stringResource(R.string.share),
fontSize = 14.sp, fontSize = 14.sp,
fontWeight = FontWeight.W600, fontWeight = FontWeight.W600,
color = AppColors.premiumText, color = AppColors.text,
) )
} }
// // Rave Premium 按钮(右侧)
// Row(
// verticalAlignment = Alignment.CenterVertically,
// horizontalArrangement = Arrangement.Center,
// modifier = Modifier
// .weight(1f)
// .clip(RoundedCornerShape(8.dp))
// .background(AppColors.premiumBackground)
// .padding(horizontal = 16.dp, vertical = 12.dp)
// .noRippleClickable {
// premiumClickDebouncer {
// onPremiumClick?.invoke()
// }
// }
// ) {
// Image(
// painter = painterResource(id = R.drawable.ic_member),
// contentDescription = "",
// modifier = Modifier.size(18.dp),
// colorFilter = ColorFilter.tint(AppColors.premiumText)
// )
// Spacer(modifier = Modifier.width(8.dp))
// Text(
// text = "Rave Premium",
// fontSize = 14.sp,
// fontWeight = FontWeight.W600,
// color = AppColors.premiumText,
// )
// }
} }
} }

View File

@@ -50,6 +50,7 @@
<string name="empty_my_post_title">まだ投稿がありません</string> <string name="empty_my_post_title">まだ投稿がありません</string>
<string name="empty_my_post_content">今すぐモーメントを投稿</string> <string name="empty_my_post_content">今すぐモーメントを投稿</string>
<string name="edit_profile">プロフィールを編集</string> <string name="edit_profile">プロフィールを編集</string>
<string name="share">シェア</string>
<string name="logout">ログアウト</string> <string name="logout">ログアウト</string>
<string name="change_password">パスワードを変更</string> <string name="change_password">パスワードを変更</string>
<string name="current_password_tip1">現在のパスワードを入力してください</string> <string name="current_password_tip1">現在のパスワードを入力してください</string>

View File

@@ -49,6 +49,7 @@
<string name="empty_my_post_title">还没有发布任何动态</string> <string name="empty_my_post_title">还没有发布任何动态</string>
<string name="empty_my_post_content">发布一个动态吧</string> <string name="empty_my_post_content">发布一个动态吧</string>
<string name="edit_profile">编辑个人资料</string> <string name="edit_profile">编辑个人资料</string>
<string name="share">分享</string>
<string name="logout">登出</string> <string name="logout">登出</string>
<string name="change_password">修改密码</string> <string name="change_password">修改密码</string>
<string name="current_password_tip1">请输入当前密码</string> <string name="current_password_tip1">请输入当前密码</string>

View File

@@ -49,6 +49,7 @@
<string name="empty_my_post_title">You haven\'t left any tracks yet</string> <string name="empty_my_post_title">You haven\'t left any tracks yet</string>
<string name="empty_my_post_content">Post a moment now</string> <string name="empty_my_post_content">Post a moment now</string>
<string name="edit_profile">Edit profile</string> <string name="edit_profile">Edit profile</string>
<string name="share">share</string>
<string name="logout">Logout</string> <string name="logout">Logout</string>
<string name="change_password">Change password</string> <string name="change_password">Change password</string>
<string name="current_password_tip1">Please enter your current password</string> <string name="current_password_tip1">Please enter your current password</string>