更新用户资料Banner图片显示逻辑

This commit is contained in:
2024-08-28 17:08:02 +08:00
parent ce87f79398
commit 0837c4ffa0
2 changed files with 12 additions and 4 deletions

View File

@@ -55,7 +55,12 @@ data class AccountProfile(
bio = bio,
country = "Worldwide",
isFollowing = isFollowing,
banner = "${ApiClient.BASE_SERVER}$banner"
banner = banner.let {
if (!it.isNullOrEmpty()) {
return@let "${ApiClient.BASE_SERVER}$it"
}
null
}
)
}
}

View File

@@ -103,13 +103,16 @@ fun ProfilePage() {
contentScale = ContentScale.Crop
)
} else {
Box(
Image(
painter = painterResource(id = R.drawable.rider_pro_moment_demo_2),
modifier = Modifier
.fillMaxWidth()
.height(400.dp)
.background(Color.Gray)
.height(400.dp),
contentDescription = "",
contentScale = ContentScale.Crop
)
}
Box(
modifier = Modifier
.align(Alignment.TopEnd)