manager: Modify the Show KPM function to hidden and update the related settings.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -325,8 +325,8 @@
|
||||
<string name="icon_switched">已切换图标</string>
|
||||
<string name="root_require_for_install">需要 root 权限</string>
|
||||
<!-- KPM display settings -->
|
||||
<string name="show_kpm_info">显示 KPM 功能</string>
|
||||
<string name="show_kpm_info_summary">在主页和底栏显示 KPM 相关功能和信息 (需要重新打开应用)</string>
|
||||
<string name="show_kpm_info">隐藏 KPM 功能</string>
|
||||
<string name="show_kpm_info_summary">在主页和底栏隐藏 KPM 相关功能和信息</string>
|
||||
<!-- Webui X settings -->
|
||||
<string name="use_webuix">选择使用的 WebUI 引擎</string>
|
||||
<string name="engine_auto_select">自动选择</string>
|
||||
|
||||
@@ -327,8 +327,8 @@
|
||||
<string name="icon_switched">Icon switched</string>
|
||||
<string name="root_require_for_install">Requires root privileges</string>
|
||||
<!-- KPM display settings -->
|
||||
<string name="show_kpm_info">Display 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">Hides KPM Function</string>
|
||||
<string name="show_kpm_info_summary">Hides KPM information and Function in home and bottom bar</string>
|
||||
<!-- Webui X settings -->
|
||||
<string name="use_webuix">Select the WebUI engine to use</string>
|
||||
<string name="engine_auto_select">Automatic Selection</string>
|
||||
|
||||
Reference in New Issue
Block a user