Skip to content

Commit

Permalink
fix: app icon size (gkd-kit#546)
Browse files Browse the repository at this point in the history
  • Loading branch information
lisonge committed Mar 9, 2024
1 parent 798df09 commit 5c55f87
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 18 deletions.
17 changes: 11 additions & 6 deletions app/src/main/kotlin/li/songe/gkd/ui/GlobalRuleExcludePage.kt
Original file line number Diff line number Diff line change
Expand Up @@ -242,14 +242,19 @@ fun GlobalRuleExcludePage(subsItemId: Long, groupKey: Int) {
verticalAlignment = Alignment.CenterVertically,
) {
if (appInfo.icon != null) {
Image(
painter = rememberDrawablePainter(appInfo.icon),
contentDescription = null,
Box(
modifier = Modifier
.fillMaxHeight()
.height(1.dp)
.padding(4.dp)
)
.aspectRatio(1f)
) {
Image(
painter = rememberDrawablePainter(appInfo.icon),
contentDescription = null,
modifier = Modifier
.matchParentSize()
.padding(4.dp)
)
}
} else {
Icon(
imageVector = Icons.Default.Android,
Expand Down
17 changes: 11 additions & 6 deletions app/src/main/kotlin/li/songe/gkd/ui/component/SubsAppCard.kt
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,19 @@ fun SubsAppCard(
verticalAlignment = Alignment.CenterVertically,
) {
if (appInfo?.icon != null) {
Image(
painter = rememberDrawablePainter(appInfo.icon),
contentDescription = null,
Box(
modifier = Modifier
.fillMaxHeight()
.height(1.dp)
.padding(4.dp)
)
.aspectRatio(1f)
) {
Image(
painter = rememberDrawablePainter(appInfo.icon),
contentDescription = null,
modifier = Modifier
.matchParentSize()
.padding(4.dp)
)
}
} else {
Icon(
imageVector = Icons.Default.Android,
Expand Down
17 changes: 11 additions & 6 deletions app/src/main/kotlin/li/songe/gkd/ui/home/AppListPage.kt
Original file line number Diff line number Diff line change
Expand Up @@ -238,14 +238,19 @@ fun useAppListPage(): ScaffoldExt {
verticalAlignment = Alignment.CenterVertically,
) {
if (appInfo.icon != null) {
Image(
painter = rememberDrawablePainter(appInfo.icon),
contentDescription = null,
Box(
modifier = Modifier
.fillMaxHeight()
.height(1.dp)
.padding(4.dp)
)
.aspectRatio(1f)
) {
Image(
painter = rememberDrawablePainter(appInfo.icon),
contentDescription = null,
modifier = Modifier
.matchParentSize()
.padding(4.dp)
)
}
} else {
Icon(
imageVector = Icons.Default.Android,
Expand Down

0 comments on commit 5c55f87

Please sign in to comment.