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) {
94
94
}
95
95
)
96
96
}, onClick = {
97
- viewModel.showSystemApps = !viewModel.showSystemApps
97
+ viewModel.updateShowSystemApps( !viewModel.showSystemApps)
98
98
showDropdown = false
99
99
})
100
100
}
Original file line number Diff line number Diff line change 1
1
package me.weishu.kernelsu.ui.viewmodel
2
2
3
3
import android.content.ComponentName
4
+ import android.content.Context
4
5
import android.content.Intent
5
6
import android.content.ServiceConnection
6
7
import android.content.pm.ApplicationInfo
@@ -28,6 +29,7 @@ import java.text.Collator
28
29
import java.util.*
29
30
import kotlin.coroutines.resume
30
31
import kotlin.coroutines.suspendCoroutine
32
+ import androidx.core.content.edit
31
33
32
34
class SuperUserViewModel : ViewModel() {
33
35
@@ -63,11 +65,19 @@ class SuperUserViewModel : ViewModel() {
63
65
}
64
66
}
65
67
68
+ private val prefs = ksuApp.getSharedPreferences("settings", Context.MODE_PRIVATE)!!
69
+
66
70
var search by mutableStateOf("")
67
- var showSystemApps by mutableStateOf(false)
71
+ var showSystemApps by mutableStateOf(prefs.getBoolean("show_system_apps", false))
72
+ private set
68
73
var isRefreshing by mutableStateOf(false)
69
74
private set
70
75
76
+ fun updateShowSystemApps(newValue: Boolean) {
77
+ showSystemApps = newValue
78
+ prefs.edit { putBoolean("show_system_apps", newValue) }
79
+ }
80
+
71
81
private val sortedList by derivedStateOf {
72
82
val comparator = compareBy<AppInfo> {
73
83
when {
You can’t perform that action at this time.
0 commit comments