优化DropdownMenu UI
- 修复聊天页静音的显示文案问题 - 优化DropdownMenu的UI
This commit is contained in:
@@ -227,7 +227,7 @@ fun ChatScreen(userId: String) {
|
|||||||
},
|
},
|
||||||
menuItems = listOf(
|
menuItems = listOf(
|
||||||
MenuItem(
|
MenuItem(
|
||||||
title = if (viewModel.notificationStrategy == "mute") "" else "",
|
title = if (viewModel.notificationStrategy == "mute") "取消静音" else "静音",
|
||||||
icon = if (viewModel.notificationStrategy == "mute") R.drawable.rider_pro_notice_mute else R.drawable.rider_pro_notice_active,
|
icon = if (viewModel.notificationStrategy == "mute") R.drawable.rider_pro_notice_mute else R.drawable.rider_pro_notice_active,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.aiosman.ravenow.ui.composables
|
package com.aiosman.ravenow.ui.composables
|
||||||
|
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
|
import androidx.compose.foundation.border
|
||||||
import androidx.compose.foundation.layout.Box
|
import androidx.compose.foundation.layout.Box
|
||||||
import androidx.compose.foundation.layout.Row
|
import androidx.compose.foundation.layout.Row
|
||||||
import androidx.compose.foundation.layout.Spacer
|
import androidx.compose.foundation.layout.Spacer
|
||||||
@@ -15,6 +16,8 @@ import androidx.compose.runtime.Composable
|
|||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.draw.clip
|
import androidx.compose.ui.draw.clip
|
||||||
|
import androidx.compose.ui.draw.shadow
|
||||||
|
import androidx.compose.ui.graphics.Color
|
||||||
import androidx.compose.ui.res.painterResource
|
import androidx.compose.ui.res.painterResource
|
||||||
import androidx.compose.ui.text.font.FontWeight
|
import androidx.compose.ui.text.font.FontWeight
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
@@ -36,15 +39,24 @@ fun DropdownMenu(
|
|||||||
) {
|
) {
|
||||||
val AppColors = LocalAppTheme.current
|
val AppColors = LocalAppTheme.current
|
||||||
|
|
||||||
androidx.compose.material3.DropdownMenu(
|
MaterialTheme(
|
||||||
expanded = expanded,
|
colorScheme = MaterialTheme.colorScheme.copy(
|
||||||
onDismissRequest = onDismissRequest,
|
surface = AppColors.secondaryBackground,
|
||||||
modifier = Modifier
|
onSurface = AppColors.text,
|
||||||
.let {
|
outline = AppColors.divider,
|
||||||
if (width != null) it.width(width.dp) else it
|
),
|
||||||
}
|
shapes = MaterialTheme.shapes.copy(
|
||||||
.background(color = AppColors.background),
|
extraSmall = RoundedCornerShape(12.dp),
|
||||||
|
)
|
||||||
) {
|
) {
|
||||||
|
androidx.compose.material3.DropdownMenu(
|
||||||
|
expanded = expanded,
|
||||||
|
onDismissRequest = onDismissRequest,
|
||||||
|
modifier = Modifier
|
||||||
|
.let {
|
||||||
|
if (width != null) it.width(width.dp) else it
|
||||||
|
}
|
||||||
|
) {
|
||||||
for (item in menuItems) {
|
for (item in menuItems) {
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
@@ -75,5 +87,6 @@ fun DropdownMenu(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user