mirror of
https://github.com/kvorschk/Magisk.git
synced 2026-12-04 19:10:47 -05:00
app-ng: move uninstall button to top app bar
Remove the oversized uninstall button from the home screen content and place an uninstall action icon in the top app bar next to the reboot button. Assisted-by: Gemini 3.7 Flash
This commit is contained in:
@@ -244,6 +244,14 @@ fun HomeScreen(
|
||||
title = { Text(stringResource(CoreR.string.section_home)) },
|
||||
scrollBehavior = scrollBehavior,
|
||||
actions = {
|
||||
if (Info.env.isActive) {
|
||||
IconButton(onClick = { viewModel.onDeletePressed() }) {
|
||||
Icon(
|
||||
imageVector = Icons.Default.Delete,
|
||||
contentDescription = stringResource(CoreR.string.uninstall_magisk_title),
|
||||
)
|
||||
}
|
||||
}
|
||||
if (Info.isRooted) {
|
||||
RebootButton()
|
||||
}
|
||||
@@ -286,11 +294,6 @@ fun HomeScreen(
|
||||
onHideRestorePressed = viewModel::onHideRestorePressed,
|
||||
)
|
||||
|
||||
UninstallButton(
|
||||
onClick = { viewModel.onDeletePressed() },
|
||||
enabled = Info.env.isActive
|
||||
)
|
||||
|
||||
Text(
|
||||
text = stringResource(CoreR.string.home_support_title),
|
||||
style = MaterialTheme.typography.titleMedium,
|
||||
@@ -502,35 +505,6 @@ private fun CoreCard(
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun UninstallButton(
|
||||
onClick: () -> Unit,
|
||||
enabled: Boolean,
|
||||
modifier: Modifier = Modifier
|
||||
) {
|
||||
Button(
|
||||
onClick = onClick,
|
||||
enabled = enabled,
|
||||
colors = ButtonDefaults.buttonColors(
|
||||
containerColor = MaterialTheme.colorScheme.errorContainer,
|
||||
contentColor = MaterialTheme.colorScheme.onErrorContainer
|
||||
),
|
||||
shape = RoundedCornerShape(20.dp),
|
||||
contentPadding = PaddingValues(vertical = 12.dp),
|
||||
modifier = modifier.fillMaxWidth()
|
||||
) {
|
||||
Icon(
|
||||
imageVector = Icons.Default.Delete,
|
||||
contentDescription = null,
|
||||
modifier = Modifier.size(18.dp)
|
||||
)
|
||||
Spacer(Modifier.width(8.dp))
|
||||
Text(
|
||||
text = stringResource(CoreR.string.uninstall_magisk_title),
|
||||
style = MaterialTheme.typography.labelLarge,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun AppCard(
|
||||
|
||||
Reference in New Issue
Block a user