File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
manager/app/src/main/java/me/weishu/kernelsu/ui Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ fun SuperUserScreen(navigator: DestinationsNavigator) {
9494 }
9595 )
9696 }, onClick = {
97- viewModel.showSystemApps = ! viewModel.showSystemApps
97+ viewModel.updateShowSystemApps( ! viewModel.showSystemApps)
9898 showDropdown = false
9999 })
100100 }
Original file line number Diff line number Diff line change 11package me.weishu.kernelsu.ui.viewmodel
22
33import android.content.ComponentName
4+ import android.content.Context
45import android.content.Intent
56import android.content.ServiceConnection
67import android.content.pm.ApplicationInfo
@@ -28,6 +29,7 @@ import java.text.Collator
2829import java.util.*
2930import kotlin.coroutines.resume
3031import kotlin.coroutines.suspendCoroutine
32+ import androidx.core.content.edit
3133
3234class SuperUserViewModel : ViewModel () {
3335
@@ -63,11 +65,19 @@ class SuperUserViewModel : ViewModel() {
6365 }
6466 }
6567
68+ private val prefs = ksuApp.getSharedPreferences(" settings" , Context .MODE_PRIVATE )!!
69+
6670 var search by mutableStateOf(" " )
67- var showSystemApps by mutableStateOf(false )
71+ var showSystemApps by mutableStateOf(prefs.getBoolean(" show_system_apps" , false ))
72+ private set
6873 var isRefreshing by mutableStateOf(false )
6974 private set
7075
76+ fun updateShowSystemApps (newValue : Boolean ) {
77+ showSystemApps = newValue
78+ prefs.edit { putBoolean(" show_system_apps" , newValue) }
79+ }
80+
7181 private val sortedList by derivedStateOf {
7282 val comparator = compareBy<AppInfo > {
7383 when {
You can’t perform that action at this time.
0 commit comments