Skip to content

Commit bdd5d5e

Browse files
committed
v0.2.3 - finish PermissionDiff UI to make build green
- Add PermissionDiffBlock composable in AppCard.kt; the call site existed but the function definition was missing, breaking release builds. - Cover the new CardStatus.PermissionReview branch in CatalogSearch.searchBoost (was a non-exhaustive when).
1 parent ecac8c5 commit bdd5d5e

2 files changed

Lines changed: 37 additions & 0 deletions

File tree

app/src/main/kotlin/com/sysadmin/lasstore/ui/catalog/AppCard.kt

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,42 @@ fun AppCard(
302302
}
303303
}
304304

305+
@Composable
306+
private fun PermissionDiffBlock(permissions: List<String>) {
307+
Column(
308+
modifier = Modifier
309+
.fillMaxWidth()
310+
.background(Catppuccin.Surface1, RoundedCornerShape(8.dp))
311+
.padding(10.dp),
312+
verticalArrangement = Arrangement.spacedBy(4.dp),
313+
) {
314+
Row(
315+
verticalAlignment = Alignment.CenterVertically,
316+
horizontalArrangement = Arrangement.spacedBy(6.dp),
317+
) {
318+
Icon(
319+
Icons.Default.Warning,
320+
contentDescription = null,
321+
tint = Catppuccin.Peach,
322+
modifier = Modifier.size(16.dp),
323+
)
324+
Text(
325+
text = "New dangerous permissions",
326+
style = MaterialTheme.typography.labelLarge,
327+
color = Catppuccin.Peach,
328+
fontWeight = FontWeight.SemiBold,
329+
)
330+
}
331+
permissions.forEach { perm ->
332+
Text(
333+
text = "" + perm.removePrefix("android.permission."),
334+
style = MaterialTheme.typography.bodySmall,
335+
color = Catppuccin.Subtext,
336+
)
337+
}
338+
}
339+
}
340+
305341
@Composable
306342
private fun DeveloperVerificationNoticeBlock(title: String, body: String) {
307343
Row(

app/src/main/kotlin/com/sysadmin/lasstore/ui/catalog/CatalogSearch.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ private fun CardStatus.searchBoost(): Int = when (this) {
7676
CardStatus.UpdateAvailable -> 8
7777
CardStatus.Installed -> 5
7878
CardStatus.NotInstalled -> 2
79+
CardStatus.PermissionReview -> 6
7980
CardStatus.Working,
8081
CardStatus.Error,
8182
CardStatus.SignatureMismatch -> 0

0 commit comments

Comments
 (0)