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(
val isHideOtherInfo: Boolean = false,
val showKpmInfo: Boolean = true
val showKpmInfo: Boolean = false
)
private lateinit var themeChangeObserver: ThemeChangeContentObserver

View File

@@ -86,7 +86,7 @@ class HomeViewModel : ViewModel() {
private set
var isHideLinkCard by mutableStateOf(false)
private set
var showKpmInfo by mutableStateOf(true)
var showKpmInfo by mutableStateOf(false)
private set
fun loadUserSettings(context: Context) {
@@ -97,7 +97,7 @@ class HomeViewModel : ViewModel() {
isHideOtherInfo = prefs.getBoolean("is_hide_other_info", false)
isHideSusfsStatus = prefs.getBoolean("is_hide_susfs_status", 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 ->
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
val isCurrentDestOnBackStack by navController.isRouteOnBackStackAsState(destination.direction)
NavigationBarItem(

View File

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

View File

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

View File

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