From fe3b409b43efe7b73361e5cb1ecb9b48a59cb886 Mon Sep 17 00:00:00 2001 From: Kevinlinpr Date: Sun, 13 Oct 2024 04:07:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=AA=E4=BA=BA=E4=B8=BB?= =?UTF-8?q?=E9=A1=B5=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/index/tabs/message/MessageList.kt | 2 +- .../ui/index/tabs/profile/ProfileWrap.kt | 2 +- .../index/tabs/profile/composable/UserItem.kt | 19 +++++++++++++------ .../riderpro/ui/profile/AccountProfileV2.kt | 9 ++++++++- 4 files changed, 23 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/com/aiosman/riderpro/ui/index/tabs/message/MessageList.kt b/app/src/main/java/com/aiosman/riderpro/ui/index/tabs/message/MessageList.kt index 40ed75c..5ab124c 100644 --- a/app/src/main/java/com/aiosman/riderpro/ui/index/tabs/message/MessageList.kt +++ b/app/src/main/java/com/aiosman/riderpro/ui/index/tabs/message/MessageList.kt @@ -86,7 +86,7 @@ fun NotificationsScreen() { ) { NotificationIndicator( MessageListViewModel.likeNoticeCount, - R.drawable.rider_pro_like, + R.drawable.rider_pro_moment_like, stringResource(R.string.like_upper) ) { if (MessageListViewModel.likeNoticeCount > 0) { diff --git a/app/src/main/java/com/aiosman/riderpro/ui/index/tabs/profile/ProfileWrap.kt b/app/src/main/java/com/aiosman/riderpro/ui/index/tabs/profile/ProfileWrap.kt index 13b74e1..99eb86c 100644 --- a/app/src/main/java/com/aiosman/riderpro/ui/index/tabs/profile/ProfileWrap.kt +++ b/app/src/main/java/com/aiosman/riderpro/ui/index/tabs/profile/ProfileWrap.kt @@ -22,6 +22,6 @@ fun ProfileWrap( MyProfileViewModel.logout(context) }, profile = MyProfileViewModel.profile, - sharedFlow = MyProfileViewModel.sharedFlow + sharedFlow = MyProfileViewModel.sharedFlow, ) } \ No newline at end of file diff --git a/app/src/main/java/com/aiosman/riderpro/ui/index/tabs/profile/composable/UserItem.kt b/app/src/main/java/com/aiosman/riderpro/ui/index/tabs/profile/composable/UserItem.kt index 67173ee..2d8f191 100644 --- a/app/src/main/java/com/aiosman/riderpro/ui/index/tabs/profile/composable/UserItem.kt +++ b/app/src/main/java/com/aiosman/riderpro/ui/index/tabs/profile/composable/UserItem.kt @@ -120,12 +120,19 @@ fun UserItem(accountProfileEntity: AccountProfileEntity) { ) Spacer(modifier = Modifier.height(4.dp)) // 个人简介 - Text( - text = accountProfileEntity.bio, - fontSize = 14.sp, - color = Color.Gray - ) - + if (accountProfileEntity.bio.isNotEmpty()){ + Text( + text = accountProfileEntity.bio, + fontSize = 14.sp, + color = Color.Gray + ) + }else{ + Text( + text = "No bio here.", + fontSize = 14.sp, + color = Color.Gray + ) + } } } \ No newline at end of file diff --git a/app/src/main/java/com/aiosman/riderpro/ui/profile/AccountProfileV2.kt b/app/src/main/java/com/aiosman/riderpro/ui/profile/AccountProfileV2.kt index f9ac8a5..50dce79 100644 --- a/app/src/main/java/com/aiosman/riderpro/ui/profile/AccountProfileV2.kt +++ b/app/src/main/java/com/aiosman/riderpro/ui/profile/AccountProfileV2.kt @@ -1,10 +1,12 @@ package com.aiosman.riderpro.ui.profile +import android.util.Log import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect import androidx.lifecycle.viewmodel.compose.viewModel import com.aiosman.riderpro.LocalNavController import com.aiosman.riderpro.exp.viewModelFactory +import com.aiosman.riderpro.ui.index.tabs.profile.MyProfileViewModel import com.aiosman.riderpro.ui.index.tabs.profile.ProfileV3 import com.aiosman.riderpro.ui.navigateToChat @@ -16,11 +18,16 @@ fun AccountProfileV2(id: String){ val navController = LocalNavController.current LaunchedEffect(Unit) { model.loadProfile(id) + MyProfileViewModel.loadProfile() + } + var isSelf = false + if (id == MyProfileViewModel.profile?.id.toString()) { + isSelf = true } ProfileV3( sharedFlow = model.momentsFlow, profile = model.profile, - isSelf = false, + isSelf = isSelf, onChatClick = { model.profile?.let { navController.navigateToChat(it.id.toString())