manager: improved floating button for module & LKM flashing screen

This commit is contained in:
rifsxd
2025-04-03 19:22:08 +06:00
parent 810889a964
commit 63ebf730f9

View File

@@ -172,8 +172,8 @@ fun FlashScreen(navigator: DestinationsNavigator, flashIt: FlashIt) {
)
},
floatingActionButton = {
if (showFloatAction) {
// Reboot button (bottom left)
if (flashIt is FlashIt.FlashModules && (flashing == FlashingStatus.SUCCESS)) {
// Reboot button for modules flashing
ExtendedFloatingActionButton(
onClick = {
scope.launch {
@@ -186,6 +186,28 @@ fun FlashScreen(navigator: DestinationsNavigator, flashIt: FlashIt) {
text = { Text(text = stringResource(R.string.reboot)) }
)
}
if (flashIt is FlashIt.FlashModules && (flashing == FlashingStatus.FAILED)) {
// Close button for modules flashing
ExtendedFloatingActionButton(
text = { Text(text = stringResource(R.string.close)) },
icon = { Icon(Icons.Filled.Close, contentDescription = null) },
onClick = {
navigator.popBackStack()
}
)
}
if (flashIt is FlashIt.FlashBoot && (flashing == FlashingStatus.SUCCESS || flashing == FlashingStatus.FAILED)) {
// Close button for LKM flashing
ExtendedFloatingActionButton(
text = { Text(text = stringResource(R.string.close)) },
icon = { Icon(Icons.Filled.Close, contentDescription = null) },
onClick = {
navigator.popBackStack()
}
)
}
},
contentWindowInsets = WindowInsets.safeDrawing,
snackbarHost = { SnackbarHost(hostState = snackBarHost) }