manager: Modify the Show KPM function to hidden and update the related settings.

This commit is contained in:
ShirkNeko
2025-06-03 15:26:03 +08:00
parent ec0b26a174
commit 675bb20f52
8 changed files with 13 additions and 13 deletions

View File

@@ -39,7 +39,7 @@ class MainActivity : ComponentActivity() {
data class SettingsState( data class SettingsState(
val isHideOtherInfo: Boolean = false, val isHideOtherInfo: Boolean = false,
val showKpmInfo: Boolean = true val showKpmInfo: Boolean = false
) )
private lateinit var themeChangeObserver: ThemeChangeContentObserver private lateinit var themeChangeObserver: ThemeChangeContentObserver

View File

@@ -86,7 +86,7 @@ class HomeViewModel : ViewModel() {
private set private set
var isHideLinkCard by mutableStateOf(false) var isHideLinkCard by mutableStateOf(false)
private set private set
var showKpmInfo by mutableStateOf(true) var showKpmInfo by mutableStateOf(false)
private set private set
fun loadUserSettings(context: Context) { fun loadUserSettings(context: Context) {
@@ -97,7 +97,7 @@ class HomeViewModel : ViewModel() {
isHideOtherInfo = prefs.getBoolean("is_hide_other_info", false) isHideOtherInfo = prefs.getBoolean("is_hide_other_info", false)
isHideSusfsStatus = prefs.getBoolean("is_hide_susfs_status", false) isHideSusfsStatus = prefs.getBoolean("is_hide_susfs_status", false)
isHideLinkCard = prefs.getBoolean("is_hide_link_card", false) isHideLinkCard = prefs.getBoolean("is_hide_link_card", false)
showKpmInfo = prefs.getBoolean("show_kpm_info", true) showKpmInfo = prefs.getBoolean("show_kpm_info", false)
} }
} }

View File

@@ -59,7 +59,7 @@ fun BottomBar(navController: NavHostController) {
) { ) {
BottomBarDestination.entries.forEach { destination -> BottomBarDestination.entries.forEach { destination ->
if (destination == BottomBarDestination.Kpm) { if (destination == BottomBarDestination.Kpm) {
if (kpmVersion.isNotEmpty() && !kpmVersion.startsWith("Error") && showKpmInfo && Natives.version >= Natives.MINIMAL_SUPPORTED_KPM) { if (kpmVersion.isNotEmpty() && !kpmVersion.startsWith("Error") && !showKpmInfo && Natives.version >= Natives.MINIMAL_SUPPORTED_KPM) {
if (!isFullFeatured && destination.rootRequired) return@forEach if (!isFullFeatured && destination.rootRequired) return@forEach
val isCurrentDestOnBackStack by navController.isRouteOnBackStackAsState(destination.direction) val isCurrentDestOnBackStack by navController.isRouteOnBackStackAsState(destination.direction)
NavigationBarItem( NavigationBarItem(

View File

@@ -31,7 +31,7 @@ object DataRefreshUtils {
val prefs = activity.getSharedPreferences("settings", Context.MODE_PRIVATE) val prefs = activity.getSharedPreferences("settings", Context.MODE_PRIVATE)
settingsStateFlow.value = MainActivity.SettingsState( settingsStateFlow.value = MainActivity.SettingsState(
isHideOtherInfo = prefs.getBoolean("is_hide_other_info", false), isHideOtherInfo = prefs.getBoolean("is_hide_other_info", false),
showKpmInfo = prefs.getBoolean("show_kpm_info", true) showKpmInfo = prefs.getBoolean("show_kpm_info", false)
) )
delay(1000) delay(1000)
} }

View File

@@ -27,7 +27,7 @@ object ThemeUtils {
settingsStateFlow.value = MainActivity.SettingsState( settingsStateFlow.value = MainActivity.SettingsState(
isHideOtherInfo = prefs.getBoolean("is_hide_other_info", false), isHideOtherInfo = prefs.getBoolean("is_hide_other_info", false),
showKpmInfo = prefs.getBoolean("show_kpm_info", true) showKpmInfo = prefs.getBoolean("show_kpm_info", false)
) )
if (isFirstRun) { if (isFirstRun) {

View File

@@ -221,7 +221,7 @@ fun MoreSettingsScreen(
// 显示KPM开关状态 // 显示KPM开关状态
var isShowKpmInfo by remember { var isShowKpmInfo by remember {
mutableStateOf(prefs.getBoolean("show_kpm_info", true)) mutableStateOf(prefs.getBoolean("show_kpm_info", false))
} }
// 隐藏SuSFS状态开关状态 // 隐藏SuSFS状态开关状态
@@ -1063,9 +1063,9 @@ fun MoreSettingsScreen(
) )
if (Natives.version >= Natives.MINIMAL_SUPPORTED_KPM) { if (Natives.version >= Natives.MINIMAL_SUPPORTED_KPM) {
// 显示KPM开关 // 隐藏KPM开关
SwitchSettingItem( SwitchSettingItem(
icon = Icons.Filled.Visibility, icon = Icons.Filled.VisibilityOff,
title = stringResource(R.string.show_kpm_info), title = stringResource(R.string.show_kpm_info),
summary = stringResource(R.string.show_kpm_info_summary), summary = stringResource(R.string.show_kpm_info_summary),
checked = isShowKpmInfo, checked = isShowKpmInfo,

View File

@@ -325,8 +325,8 @@
<string name="icon_switched">已切换图标</string> <string name="icon_switched">已切换图标</string>
<string name="root_require_for_install">需要 root 权限</string> <string name="root_require_for_install">需要 root 权限</string>
<!-- KPM display settings --> <!-- KPM display settings -->
<string name="show_kpm_info">显示 KPM 功能</string> <string name="show_kpm_info">隐藏 KPM 功能</string>
<string name="show_kpm_info_summary">在主页和底栏显示 KPM 相关功能和信息 (需要重新打开应用)</string> <string name="show_kpm_info_summary">在主页和底栏隐藏 KPM 相关功能和信息</string>
<!-- Webui X settings --> <!-- Webui X settings -->
<string name="use_webuix">选择使用的 WebUI 引擎</string> <string name="use_webuix">选择使用的 WebUI 引擎</string>
<string name="engine_auto_select">自动选择</string> <string name="engine_auto_select">自动选择</string>

View File

@@ -327,8 +327,8 @@
<string name="icon_switched">Icon switched</string> <string name="icon_switched">Icon switched</string>
<string name="root_require_for_install">Requires root privileges</string> <string name="root_require_for_install">Requires root privileges</string>
<!-- KPM display settings --> <!-- KPM display settings -->
<string name="show_kpm_info">Display KPM Function</string> <string name="show_kpm_info">Hides KPM Function</string>
<string name="show_kpm_info_summary">Display KPM information and Function in home and bottom bar (Need to reopen the app)</string> <string name="show_kpm_info_summary">Hides KPM information and Function in home and bottom bar</string>
<!-- Webui X settings --> <!-- Webui X settings -->
<string name="use_webuix">Select the WebUI engine to use</string> <string name="use_webuix">Select the WebUI engine to use</string>
<string name="engine_auto_select">Automatic Selection</string> <string name="engine_auto_select">Automatic Selection</string>