You've already forked KernelSU-Next
mirror of
https://github.com/KernelSU-Next/KernelSU-Next.git
synced 2025-08-27 23:46:34 +00:00
manager: improved module update status label
This commit is contained in:
@@ -603,6 +603,7 @@ private fun ModuleList(
|
|||||||
updatedModule.first,
|
updatedModule.first,
|
||||||
"${module.name}-${updatedModule.second}.zip"
|
"${module.name}-${updatedModule.second}.zip"
|
||||||
)
|
)
|
||||||
|
viewModel.markNeedRefresh()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onClick = {
|
onClick = {
|
||||||
@@ -688,14 +689,14 @@ fun ModuleItem(
|
|||||||
)
|
)
|
||||||
if (module.remove) {
|
if (module.remove) {
|
||||||
LabelItem(
|
LabelItem(
|
||||||
text = stringResource(R.string.uninstall),
|
text = stringResource(R.string.uninstalled),
|
||||||
style = com.dergoogler.mmrl.ui.component.LabelItemDefaults.style.copy(
|
style = com.dergoogler.mmrl.ui.component.LabelItemDefaults.style.copy(
|
||||||
containerColor = MaterialTheme.colorScheme.errorContainer,
|
containerColor = MaterialTheme.colorScheme.errorContainer,
|
||||||
contentColor = MaterialTheme.colorScheme.onErrorContainer
|
contentColor = MaterialTheme.colorScheme.onErrorContainer
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
if (updateUrl.isNotEmpty() && !module.remove) {
|
if (updateUrl.isNotEmpty() && !module.remove && !module.update) {
|
||||||
LabelItem(
|
LabelItem(
|
||||||
text = stringResource(R.string.module_update),
|
text = stringResource(R.string.module_update),
|
||||||
style = com.dergoogler.mmrl.ui.component.LabelItemDefaults.style.copy(
|
style = com.dergoogler.mmrl.ui.component.LabelItemDefaults.style.copy(
|
||||||
@@ -704,6 +705,17 @@ fun ModuleItem(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
if (!module.remove) {
|
||||||
|
if (module.update) {
|
||||||
|
LabelItem(
|
||||||
|
text = stringResource(R.string.module_updated),
|
||||||
|
style = com.dergoogler.mmrl.ui.component.LabelItemDefaults.style.copy(
|
||||||
|
containerColor = MaterialTheme.colorScheme.tertiaryContainer,
|
||||||
|
contentColor = MaterialTheme.colorScheme.onTertiaryContainer
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
if (module.hasWebUi) {
|
if (module.hasWebUi) {
|
||||||
LabelItem(
|
LabelItem(
|
||||||
text = stringResource(R.string.webui),
|
text = stringResource(R.string.webui),
|
||||||
@@ -802,7 +814,9 @@ fun ModuleItem(
|
|||||||
onUpdate(module)
|
onUpdate(module)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
HorizontalDivider()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (module.hasWebUi) {
|
if (module.hasWebUi) {
|
||||||
DropdownMenuItem(
|
DropdownMenuItem(
|
||||||
text = { Text(stringResource(R.string.webui)) },
|
text = { Text(stringResource(R.string.webui)) },
|
||||||
@@ -823,11 +837,7 @@ fun ModuleItem(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (module.hasWebUi || module.hasActionScript ) {
|
||||||
(updateUrl.isNotEmpty() && !module.remove) ||
|
|
||||||
module.hasWebUi ||
|
|
||||||
module.hasActionScript
|
|
||||||
) {
|
|
||||||
HorizontalDivider()
|
HorizontalDivider()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -52,6 +52,7 @@
|
|||||||
<string name="module_install">Install</string>
|
<string name="module_install">Install</string>
|
||||||
<string name="install">Install</string>
|
<string name="install">Install</string>
|
||||||
<string name="reboot">Reboot</string>
|
<string name="reboot">Reboot</string>
|
||||||
|
<string name="uninstalled">Uninstalled</string>
|
||||||
<string name="settings">Settings</string>
|
<string name="settings">Settings</string>
|
||||||
<string name="reboot_userspace">Soft Reboot</string>
|
<string name="reboot_userspace">Soft Reboot</string>
|
||||||
<string name="reboot_recovery">Reboot to Recovery</string>
|
<string name="reboot_recovery">Reboot to Recovery</string>
|
||||||
@@ -137,6 +138,7 @@
|
|||||||
<string name="profile_selinux_domain">Domain</string>
|
<string name="profile_selinux_domain">Domain</string>
|
||||||
<string name="profile_selinux_rules">Rules</string>
|
<string name="profile_selinux_rules">Rules</string>
|
||||||
<string name="module_update">Update</string>
|
<string name="module_update">Update</string>
|
||||||
|
<string name="module_updated">Updated</string>
|
||||||
<string name="module_downloading">Downloading module: %s</string>
|
<string name="module_downloading">Downloading module: %s</string>
|
||||||
<string name="module_start_downloading">Start downloading: %s</string>
|
<string name="module_start_downloading">Start downloading: %s</string>
|
||||||
<string name="new_version_available">New version %s is available, click to upgrade.</string>
|
<string name="new_version_available">New version %s is available, click to upgrade.</string>
|
||||||
|
|||||||
Reference in New Issue
Block a user