feat:优化消息提醒右上角的数字展示

This commit is contained in:
amos
2025-12-19 17:50:01 +08:00
parent 1bbcff6746
commit e37be09cc9
2 changed files with 14 additions and 10 deletions

View File

@@ -13,11 +13,11 @@ android {
applicationId = "com.memory.app"
minSdk = 26
targetSdk = 35
versionCode = 16
versionName = "1.3.2"
versionCode = 17
versionName = "1.3.3"
buildConfigField("String", "API_BASE_URL", "\"https://x.amos.us.kg/api/\"")
buildConfigField("int", "VERSION_CODE", "16")
buildConfigField("int", "VERSION_CODE", "17")
}
signingConfigs {

View File

@@ -101,20 +101,24 @@ fun ProfileScreen(
)
}
if (unreadCount > 0) {
val badgeText = if (unreadCount > 99) "99+" else unreadCount.toString()
Box(
modifier = Modifier
.align(Alignment.TopEnd)
.offset(x = 2.dp, y = (-2).dp)
.size(16.dp)
.clip(CircleShape)
.background(ErrorRed),
.offset(x = 6.dp, y = (-6).dp)
.height(20.dp)
.defaultMinSize(minWidth = 20.dp)
.clip(RoundedCornerShape(10.dp))
.background(ErrorRed)
.padding(horizontal = 6.dp),
contentAlignment = Alignment.Center
) {
Text(
text = if (unreadCount > 99) "99+" else unreadCount.toString(),
text = badgeText,
color = Color.White,
fontSize = 9.sp,
fontWeight = FontWeight.Bold
fontSize = 11.sp,
fontWeight = FontWeight.Bold,
lineHeight = 11.sp
)
}
}