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:
rifsxd
2025-06-03 00:29:02 +06:00
parent 3f7e731df6
commit f91afe6c46
4 changed files with 538 additions and 468 deletions

View File

@@ -96,7 +96,7 @@ fun CustomizationScreen(navigator: DestinationsNavigator) {
)
}
SwitchItem(
icon = Icons.Filled.ColorLens,
icon = Icons.Filled.Dashboard,
title = stringResource(id = R.string.settings_legacyui),
summary = stringResource(id = R.string.settings_legacyui_summary),
checked = useLagacyUI
@@ -105,6 +105,22 @@ fun CustomizationScreen(navigator: DestinationsNavigator) {
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 {
mutableStateOf(
prefs.getBoolean("enable_amoled", false)

View File

@@ -46,7 +46,8 @@ class ModuleViewModel : ViewModel() {
val hasWebUi: Boolean,
val hasActionScript: Boolean,
val dirId: String,
val size: Long
val size: Long,
val banner: String
)
data class ModuleUpdateInfo(
@@ -142,7 +143,8 @@ class ModuleViewModel : ViewModel() {
obj.optBoolean("web"),
obj.optBoolean("action"),
dirId,
size
size,
obj.optString("banner")
)
}.toList()
isNeedRefresh = false

View File

@@ -213,6 +213,8 @@
<string name="settings_language">Language</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_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_summary">Use WebUI X instead of WebUI, which supports more APIs.</string>
<string name="use_webuix_eruda">Inject Eruda into WebUI X</string>