perf: style

This commit is contained in:
lisonge 2024-03-08 12:12:04 +08:00
parent 8efeaebd03
commit a4761dacdd
5 changed files with 30 additions and 34 deletions

View File

@ -16,6 +16,7 @@ import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.filled.ArrowBack
import androidx.compose.material.icons.filled.Edit
import androidx.compose.material3.FloatingActionButton
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.LocalContentColor
@ -134,6 +135,11 @@ fun AppConfigPage(appId: String) {
}
}
}
item {
if (globalGroups.isNotEmpty() && appGroups.isNotEmpty()) {
HorizontalDivider()
}
}
items(appGroups) { g ->
AppGroupCard(g.group, g.enable, onClick = {
navController.navigate(

View File

@ -242,19 +242,14 @@ fun GlobalRuleExcludePage(subsItemId: Long, groupKey: Int) {
verticalAlignment = Alignment.CenterVertically,
) {
if (appInfo.icon != null) {
Box(
Image(
painter = rememberDrawablePainter(appInfo.icon),
contentDescription = null,
modifier = Modifier
.fillMaxHeight()
.aspectRatio(1f)
) {
Image(
painter = rememberDrawablePainter(appInfo.icon),
contentDescription = null,
modifier = Modifier
.matchParentSize()
.padding(4.dp)
)
}
.height(1.dp)
.padding(4.dp)
)
} else {
Icon(
imageVector = Icons.Default.Android,

View File

@ -68,19 +68,14 @@ fun SubsAppCard(
verticalAlignment = Alignment.CenterVertically,
) {
if (appInfo?.icon != null) {
Box(
Image(
painter = rememberDrawablePainter(appInfo.icon),
contentDescription = null,
modifier = Modifier
.fillMaxHeight()
.aspectRatio(1f)
) {
Image(
painter = rememberDrawablePainter(appInfo.icon),
contentDescription = null,
modifier = Modifier
.matchParentSize()
.padding(4.dp)
)
}
.height(1.dp)
.padding(4.dp)
)
} else {
Icon(
imageVector = Icons.Default.Android,

View File

@ -238,19 +238,14 @@ fun useAppListPage(): ScaffoldExt {
verticalAlignment = Alignment.CenterVertically,
) {
if (appInfo.icon != null) {
Box(
Image(
painter = rememberDrawablePainter(appInfo.icon),
contentDescription = null,
modifier = Modifier
.fillMaxHeight()
.aspectRatio(1f)
) {
Image(
painter = rememberDrawablePainter(appInfo.icon),
contentDescription = null,
modifier = Modifier
.matchParentSize()
.padding(4.dp)
)
}
.height(1.dp)
.padding(4.dp)
)
} else {
Icon(
imageVector = Icons.Default.Android,

View File

@ -29,6 +29,7 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.core.app.NotificationManagerCompat
@ -240,7 +241,11 @@ fun useControlPage(): ScaffoldExt {
Text(text = subsStatus, fontSize = 18.sp)
if (latestRecordDesc != null) {
Text(
text = "最近点击: $latestRecordDesc", fontSize = 14.sp
text = "最近点击: $latestRecordDesc",
fontSize = 14.sp,
maxLines = 1,
softWrap = false,
overflow = TextOverflow.Ellipsis
)
}
}