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: add module background banners"
module devs can add banners for their modules through module.prop config Example: banner=https://something.com/banner.png
This commit is contained in:
@@ -96,7 +96,7 @@ fun CustomizationScreen(navigator: DestinationsNavigator) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
SwitchItem(
|
SwitchItem(
|
||||||
icon = Icons.Filled.ColorLens,
|
icon = Icons.Filled.Dashboard,
|
||||||
title = stringResource(id = R.string.settings_legacyui),
|
title = stringResource(id = R.string.settings_legacyui),
|
||||||
summary = stringResource(id = R.string.settings_legacyui_summary),
|
summary = stringResource(id = R.string.settings_legacyui_summary),
|
||||||
checked = useLagacyUI
|
checked = useLagacyUI
|
||||||
@@ -105,6 +105,22 @@ fun CustomizationScreen(navigator: DestinationsNavigator) {
|
|||||||
useLagacyUI = it
|
useLagacyUI = it
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var useBanner by rememberSaveable {
|
||||||
|
mutableStateOf(
|
||||||
|
prefs.getBoolean("use_banner", true)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
SwitchItem(
|
||||||
|
enabled = !useLagacyUI,
|
||||||
|
icon = Icons.Filled.ViewCarousel,
|
||||||
|
title = stringResource(id = R.string.settings_banner),
|
||||||
|
summary = stringResource(id = R.string.settings_banner_summary),
|
||||||
|
checked = useBanner
|
||||||
|
) {
|
||||||
|
prefs.edit().putBoolean("use_banner", it).apply()
|
||||||
|
useBanner = it
|
||||||
|
}
|
||||||
|
|
||||||
var enableAmoled by rememberSaveable {
|
var enableAmoled by rememberSaveable {
|
||||||
mutableStateOf(
|
mutableStateOf(
|
||||||
prefs.getBoolean("enable_amoled", false)
|
prefs.getBoolean("enable_amoled", false)
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -46,7 +46,8 @@ class ModuleViewModel : ViewModel() {
|
|||||||
val hasWebUi: Boolean,
|
val hasWebUi: Boolean,
|
||||||
val hasActionScript: Boolean,
|
val hasActionScript: Boolean,
|
||||||
val dirId: String,
|
val dirId: String,
|
||||||
val size: Long
|
val size: Long,
|
||||||
|
val banner: String
|
||||||
)
|
)
|
||||||
|
|
||||||
data class ModuleUpdateInfo(
|
data class ModuleUpdateInfo(
|
||||||
@@ -142,7 +143,8 @@ class ModuleViewModel : ViewModel() {
|
|||||||
obj.optBoolean("web"),
|
obj.optBoolean("web"),
|
||||||
obj.optBoolean("action"),
|
obj.optBoolean("action"),
|
||||||
dirId,
|
dirId,
|
||||||
size
|
size,
|
||||||
|
obj.optString("banner")
|
||||||
)
|
)
|
||||||
}.toList()
|
}.toList()
|
||||||
isNeedRefresh = false
|
isNeedRefresh = false
|
||||||
|
|||||||
@@ -213,6 +213,8 @@
|
|||||||
<string name="settings_language">Language</string>
|
<string name="settings_language">Language</string>
|
||||||
<string name="settings_legacyui">Use Legacy UI</string>
|
<string name="settings_legacyui">Use Legacy UI</string>
|
||||||
<string name="settings_legacyui_summary">Switch to the previous user interface style.</string>
|
<string name="settings_legacyui_summary">Switch to the previous user interface style.</string>
|
||||||
|
<string name="settings_banner">Enable banners</string>
|
||||||
|
<string name="settings_banner_summary">Show background banners for modules.</string>
|
||||||
<string name="use_webuix">Use WebUI X</string>
|
<string name="use_webuix">Use WebUI X</string>
|
||||||
<string name="use_webuix_summary">Use WebUI X instead of WebUI, which supports more APIs.</string>
|
<string name="use_webuix_summary">Use WebUI X instead of WebUI, which supports more APIs.</string>
|
||||||
<string name="use_webuix_eruda">Inject Eruda into WebUI X</string>
|
<string name="use_webuix_eruda">Inject Eruda into WebUI X</string>
|
||||||
|
|||||||
Reference in New Issue
Block a user