Skip to content

Commit 8dd77b4

Browse files
committed
feat: Add tooltips to ActionPillButtons in APK and patch selection dialogs
1 parent 2b34281 commit 8dd77b4

2 files changed

Lines changed: 19 additions & 6 deletions

File tree

app/src/main/java/app/morphe/manager/ui/screen/settings/system/ApkManagementDialog.kt

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -523,34 +523,42 @@ private fun ApkItemCard(
523523
verticalArrangement = Arrangement.spacedBy(8.dp)
524524
) {
525525
if (onShare != null) {
526+
val shareLabel = stringResource(R.string.share)
526527
ActionPillButton(
527528
onClick = onShare,
528529
icon = Icons.Outlined.Share,
529-
contentDescription = stringResource(R.string.share)
530+
contentDescription = shareLabel,
531+
tooltip = shareLabel
530532
)
531533
}
532534

533535
if (onExport != null) {
536+
val exportLabel = stringResource(R.string.export)
534537
ActionPillButton(
535538
onClick = onExport,
536539
icon = Icons.Outlined.Upload,
537-
contentDescription = stringResource(R.string.export)
540+
contentDescription = exportLabel,
541+
tooltip = exportLabel
538542
)
539543
}
540544

541545
if (onInstall != null) {
542546
val isMountType = data.installType == InstallType.MOUNT
547+
val installLabel = stringResource(if (isMountType) R.string.mount else R.string.install)
543548
ActionPillButton(
544549
onClick = onInstall,
545550
icon = if (isMountType) Icons.Outlined.Link else Icons.Outlined.InstallMobile,
546-
contentDescription = stringResource(if (isMountType) R.string.mount else R.string.install)
551+
contentDescription = installLabel,
552+
tooltip = installLabel
547553
)
548554
}
549555

556+
val deleteLabel = stringResource(R.string.delete)
550557
ActionPillButton(
551558
onClick = onDelete,
552559
icon = Icons.Outlined.Delete,
553-
contentDescription = stringResource(R.string.delete),
560+
contentDescription = deleteLabel,
561+
tooltip = deleteLabel,
554562
colors = IconButtonDefaults.filledTonalIconButtonColors(
555563
containerColor = MaterialTheme.colorScheme.errorContainer,
556564
contentColor = MaterialTheme.colorScheme.onErrorContainer

app/src/main/java/app/morphe/manager/ui/screen/settings/system/PatchSelectionManagementDialog.kt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,9 @@ private fun BundleSelectionItem(
535535
modifier = Modifier.fillMaxWidth(),
536536
horizontalArrangement = Arrangement.spacedBy(8.dp, Alignment.CenterHorizontally)
537537
) {
538+
val exportLabel = stringResource(R.string.export)
539+
val resetLabel = stringResource(R.string.reset)
540+
538541
// Export button
539542
ActionPillButton(
540543
onClick = {
@@ -544,14 +547,16 @@ private fun BundleSelectionItem(
544547
exportLauncher.launch(fileName)
545548
},
546549
icon = Icons.Outlined.Upload,
547-
contentDescription = stringResource(R.string.export)
550+
contentDescription = exportLabel,
551+
tooltip = exportLabel
548552
)
549553

550554
// Reset button
551555
ActionPillButton(
552556
onClick = onReset,
553557
icon = Icons.Outlined.Delete,
554-
contentDescription = stringResource(R.string.reset),
558+
contentDescription = resetLabel,
559+
tooltip = resetLabel,
555560
colors = IconButtonDefaults.filledTonalIconButtonColors(
556561
containerColor = MaterialTheme.colorScheme.errorContainer,
557562
contentColor = MaterialTheme.colorScheme.onErrorContainer

0 commit comments

Comments
 (0)