auth to server-V53
This commit is contained in:
parent
0e8ecb74b6
commit
160247d05f
2 changed files with 15 additions and 3 deletions
|
|
@ -29,7 +29,7 @@ data class UserProfileUpdateRequest(
|
|||
val status: String? = null
|
||||
)
|
||||
|
||||
val UserProfile.fullAvatarUrl: Any?
|
||||
val UserProfile.fullAvatarUrl: Any
|
||||
get() = if (avatar_url.isNullOrBlank()) {
|
||||
R.drawable.avatar_v1 // 如果沒網址,直接回傳預設圖片資源
|
||||
} else if (avatar_url.startsWith("http")) {
|
||||
|
|
@ -37,3 +37,12 @@ val UserProfile.fullAvatarUrl: Any?
|
|||
} else {
|
||||
"http://192.168.0.217$avatar_url" // 否則補上 Base URL
|
||||
}
|
||||
|
||||
val UserProfile.fullBannerUrl: Any
|
||||
get() = if (banner_url.isNullOrBlank()) {
|
||||
R.drawable.thumbnail_v1 // 如果沒網址,直接回傳預設圖片資源
|
||||
} else if (banner_url.startsWith("http")) {
|
||||
banner_url // 已經是完整網址就直接用
|
||||
} else {
|
||||
"http://192.168.0.217$banner_url" // 否則補上 Base URL
|
||||
}
|
||||
|
|
@ -165,11 +165,14 @@ fun Loaded_setting_profile_page(
|
|||
){
|
||||
// 1. 封面圖 (背景)
|
||||
AsyncImage(
|
||||
model = profile.banner_url,
|
||||
model = profile.fullAvatarUrl,
|
||||
contentDescription = "Avatar of ${profile.display_name}",
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.height(180.dp)
|
||||
.clickable {
|
||||
bannerLauncher.launch(PickVisualMediaRequest(ActivityResultContracts.PickVisualMedia.ImageOnly))
|
||||
}
|
||||
,
|
||||
contentScale = ContentScale.Crop,
|
||||
error = painterResource(R.drawable.thumbnail_v1)
|
||||
|
|
@ -347,7 +350,7 @@ fun Loaded_setting_profile_page(
|
|||
if (activeEditTarget != null) {
|
||||
AlertDialog(
|
||||
onDismissRequest = { activeEditTarget = null },
|
||||
containerColor = MaterialTheme.colorScheme.primary,
|
||||
containerColor = Color.White,
|
||||
title = { Text(activeEditTarget?.title ?: "") },
|
||||
text = {
|
||||
TextField(
|
||||
|
|
|
|||
Loading…
Reference in a new issue