Skip to content

Commit cb51d4f

Browse files
authored
Update AppDetailsScreen.kt
1 parent ffbb973 commit cb51d4f

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

app/src/main/kotlin/com/dev/debloater/AppDetailsScreen.kt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ import androidx.compose.ui.text.style.TextAlign
1919
import androidx.compose.ui.unit.dp
2020
import androidx.compose.material.icons.Icons
2121
import androidx.compose.material.icons.filled.*
22+
import androidx.compose.ui.graphics.asImageBitmap
23+
import androidx.core.graphics.drawable.toBitmap
2224

2325
private fun SafetyLevel.badgeColorScheme(): Pair<Color, Color> =
2426
when (this) {
@@ -46,7 +48,10 @@ fun AppDetailsScreen(
4648
var isDisabling by remember { mutableStateOf(false) }
4749
var isUninstalling by remember { mutableStateOf(false) }
4850
var isRestoring by remember { mutableStateOf(false) }
49-
51+
val appIconBitmap = remember(appData.icon) {
52+
appData.icon?.toBitmap(width = 240, height = 240)?.asImageBitmap()
53+
}
54+
5055
Scaffold(
5156
topBar = {
5257
TopAppBar(
@@ -73,9 +78,9 @@ fun AppDetailsScreen(
7378
.background(MaterialTheme.colorScheme.surfaceVariant),
7479
contentAlignment = Alignment.Center
7580
) {
76-
if (appData.iconBitmap != null) {
81+
if (appIconBitmap != null) {
7782
Image(
78-
bitmap = appData.iconBitmap,
83+
bitmap = appIconBitmap,
7984
contentDescription = null,
8085
modifier = Modifier.fillMaxSize(),
8186
contentScale = ContentScale.Fit

0 commit comments

Comments
 (0)