mirror of
http://180.163.74.83:13000/zhangzhenghao/MPVN_Android.git
synced 2025-12-12 23:34:28 +00:00
优化布局
This commit is contained in:
parent
fb20e2e64b
commit
9cc3f08291
@ -371,15 +371,24 @@ fun RoomTab(
|
|||||||
selected: Boolean,
|
selected: Boolean,
|
||||||
onClick: () -> Unit
|
onClick: () -> Unit
|
||||||
) {
|
) {
|
||||||
val base = Modifier.clip(RoundedCornerShape(20.dp))
|
val shape = RoundedCornerShape(20.dp)
|
||||||
val mod = if (selected) {
|
|
||||||
base.background(brush = Brush.linearGradient(listOf(Color(0xFFA9F0FF), Color(0xFFB89CFF))))
|
|
||||||
} else {
|
|
||||||
base.background(color = Color(0x50121212))
|
|
||||||
}
|
|
||||||
|
|
||||||
Box(
|
Box(
|
||||||
modifier = mod
|
modifier = Modifier
|
||||||
|
.clip(shape)
|
||||||
|
.then(
|
||||||
|
if (selected) {
|
||||||
|
Modifier.background(brush = Brush.linearGradient(listOf(Color(0xFFA9F0FF), Color(0xFFB89CFF))))
|
||||||
|
} else {
|
||||||
|
Modifier
|
||||||
|
.background(Color(0xFF1E2530).copy(alpha = 0.8f))
|
||||||
|
.border(
|
||||||
|
width = 1.dp,
|
||||||
|
color = Color.White.copy(alpha = 0.15f),
|
||||||
|
shape = shape
|
||||||
|
)
|
||||||
|
}
|
||||||
|
)
|
||||||
.clickable { onClick() }
|
.clickable { onClick() }
|
||||||
.padding(horizontal = 14.dp, vertical = 10.dp)
|
.padding(horizontal = 14.dp, vertical = 10.dp)
|
||||||
) {
|
) {
|
||||||
@ -417,7 +426,12 @@ fun DeviceCard(d: Device, roomName: String = "") {
|
|||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.clip(RoundedCornerShape(16.dp))
|
.clip(RoundedCornerShape(16.dp))
|
||||||
.background(Color(0x40121212))
|
.background(Color(0xFF1E2530).copy(alpha = 0.85f))
|
||||||
|
.border(
|
||||||
|
width = 1.dp,
|
||||||
|
color = Color.White.copy(alpha = 0.15f),
|
||||||
|
shape = RoundedCornerShape(16.dp)
|
||||||
|
)
|
||||||
.padding(12.dp),
|
.padding(12.dp),
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
horizontalArrangement = Arrangement.spacedBy(12.dp)
|
horizontalArrangement = Arrangement.spacedBy(12.dp)
|
||||||
@ -1239,13 +1253,11 @@ fun UsageStatusChart(modifier: Modifier = Modifier, roomName: String = "房间")
|
|||||||
modifier = modifier
|
modifier = modifier
|
||||||
.height(260.dp)
|
.height(260.dp)
|
||||||
.clip(RoundedCornerShape(24.dp))
|
.clip(RoundedCornerShape(24.dp))
|
||||||
.background(
|
.background(Color(0xFF1E2530).copy(alpha = 0.85f))
|
||||||
Brush.verticalGradient(
|
.border(
|
||||||
colors = listOf(
|
width = 1.dp,
|
||||||
accentColor.copy(alpha = 0.15f),
|
color = Color.White.copy(alpha = 0.15f),
|
||||||
Color(0xFF1A1A2E).copy(alpha = 0.9f)
|
shape = RoundedCornerShape(24.dp)
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
.padding(16.dp)
|
.padding(16.dp)
|
||||||
) {
|
) {
|
||||||
@ -1530,16 +1542,11 @@ fun AirConditionerCard(modifier: Modifier = Modifier, roomName: String = "房间
|
|||||||
modifier = modifier
|
modifier = modifier
|
||||||
.height(260.dp)
|
.height(260.dp)
|
||||||
.clip(RoundedCornerShape(24.dp))
|
.clip(RoundedCornerShape(24.dp))
|
||||||
.background(
|
.background(Color(0xFF1E2530).copy(alpha = 0.85f))
|
||||||
Brush.verticalGradient(
|
.border(
|
||||||
colors = if (isOn) listOf(
|
width = 1.dp,
|
||||||
accentColor.copy(alpha = 0.3f),
|
color = Color.White.copy(alpha = 0.15f),
|
||||||
Color(0xFF1A1A2E).copy(alpha = 0.9f)
|
shape = RoundedCornerShape(24.dp)
|
||||||
) else listOf(
|
|
||||||
Color(0xFF2A2A3E).copy(alpha = 0.6f),
|
|
||||||
Color(0xFF1A1A2E).copy(alpha = 0.9f)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
.padding(16.dp)
|
.padding(16.dp)
|
||||||
) {
|
) {
|
||||||
@ -2009,7 +2016,13 @@ fun ModeButton(
|
|||||||
shape = shape
|
shape = shape
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
Modifier.background(Color(0x50121212))
|
Modifier
|
||||||
|
.background(Color(0xFF1E2530).copy(alpha = 0.85f))
|
||||||
|
.border(
|
||||||
|
width = 1.dp,
|
||||||
|
color = Color.White.copy(alpha = 0.15f),
|
||||||
|
shape = shape
|
||||||
|
)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.clickable(indication = null, interactionSource = interaction) {
|
.clickable(indication = null, interactionSource = interaction) {
|
||||||
@ -2131,7 +2144,18 @@ fun LightRow(modifier: Modifier = Modifier, roomName: String = "房间") {
|
|||||||
fun LightCard(name: String, percent: Float, modifier: Modifier = Modifier) {
|
fun LightCard(name: String, percent: Float, modifier: Modifier = Modifier) {
|
||||||
var brightness by remember { mutableStateOf(percent) }
|
var brightness by remember { mutableStateOf(percent) }
|
||||||
|
|
||||||
Box(modifier = modifier.height(72.dp).clip(RoundedCornerShape(16.dp)).background(Color(0x50121212)).padding(horizontal = 12.dp, vertical = 8.dp)) {
|
Box(
|
||||||
|
modifier = modifier
|
||||||
|
.height(72.dp)
|
||||||
|
.clip(RoundedCornerShape(16.dp))
|
||||||
|
.background(Color(0xFF1E2530).copy(alpha = 0.85f))
|
||||||
|
.border(
|
||||||
|
width = 1.dp,
|
||||||
|
color = Color.White.copy(alpha = 0.15f),
|
||||||
|
shape = RoundedCornerShape(16.dp)
|
||||||
|
)
|
||||||
|
.padding(horizontal = 12.dp, vertical = 8.dp)
|
||||||
|
) {
|
||||||
Row(horizontalArrangement = Arrangement.SpaceBetween, verticalAlignment = Alignment.CenterVertically, modifier = Modifier.fillMaxWidth()) {
|
Row(horizontalArrangement = Arrangement.SpaceBetween, verticalAlignment = Alignment.CenterVertically, modifier = Modifier.fillMaxWidth()) {
|
||||||
Row(horizontalArrangement = Arrangement.spacedBy(12.dp), verticalAlignment = Alignment.CenterVertically) {
|
Row(horizontalArrangement = Arrangement.spacedBy(12.dp), verticalAlignment = Alignment.CenterVertically) {
|
||||||
// 灯光图标 - 带发光效果
|
// 灯光图标 - 带发光效果
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.5 MiB After Width: | Height: | Size: 1.4 MiB |
Loading…
Reference in New Issue
Block a user