Skip to content

Commit edc499d

Browse files
feat: prevent all toggles from turning off
1 parent c6fd026 commit edc499d

7 files changed

Lines changed: 167 additions & 21 deletions

File tree

.idea/codeStyles/Project.xml

Lines changed: 123 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/codeStyles/codeStyleConfig.xml

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/markdown.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ android {
7171
targetSdk = 36
7272

7373
//versioning
74-
versionCode = 29
75-
versionName = "1.2.9"
74+
versionCode = 30
75+
versionName = "1.3.0"
7676
vectorDrawables {
7777
useSupportLibrary = true
7878
}

app/src/main/java/com/rk/taskmanager/screens/Processes.kt

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -66,50 +66,60 @@ fun Processes(
6666

6767
if (showFilter.value) {
6868
XedDialog(onDismissRequest = { showFilter.value = false }) {
69+
70+
val showUserApps by viewModel.showUserApps.collectAsState()
71+
val showSystemApps by viewModel.showSystemApps.collectAsState()
72+
val showLinuxProcess by viewModel.showLinuxProcess.collectAsState()
73+
6974
DividerColumn {
7075

76+
// USER APPS
7177
SettingsToggle(
7278
label = stringResource(strings.show_user_app),
73-
description = null,
7479
showSwitch = true,
75-
default = viewModel.showUserApps.collectAsState().value,
76-
sideEffect = {
80+
default = showUserApps,
81+
isEnabled = !(showUserApps && !showSystemApps && !showLinuxProcess),
82+
sideEffect = { newValue ->
83+
if (!newValue && !showSystemApps && !showLinuxProcess) return@SettingsToggle
7784
scope.launch {
78-
Settings.showUserApps = it
79-
viewModel.setShowUserApps(it)
85+
Settings.showUserApps = newValue
86+
viewModel.setShowUserApps(newValue)
8087
}
81-
8288
}
8389
)
8490

91+
// SYSTEM APPS
8592
SettingsToggle(
8693
label = stringResource(strings.show_system_app),
87-
description = null,
8894
showSwitch = true,
89-
default = viewModel.showSystemApps.collectAsState().value,
90-
sideEffect = {
95+
default = showSystemApps,
96+
isEnabled = !(showSystemApps && !showUserApps && !showLinuxProcess),
97+
sideEffect = { newValue ->
98+
if (!newValue && !showUserApps && !showLinuxProcess) return@SettingsToggle
9199
scope.launch {
92-
Settings.showSystemApps = it
93-
viewModel.setShowSystemApps(it)
100+
Settings.showSystemApps = newValue
101+
viewModel.setShowSystemApps(newValue)
94102
}
95-
96103
}
97104
)
98105

106+
// LINUX PROCESS
99107
SettingsToggle(
100108
label = stringResource(strings.show_linux_process),
101-
description = null,
102109
showSwitch = true,
103-
default = viewModel.showLinuxProcess.collectAsState().value,
104-
sideEffect = {
110+
default = showLinuxProcess,
111+
isEnabled = !(showLinuxProcess && !showUserApps && !showSystemApps),
112+
sideEffect = { newValue ->
113+
if (!newValue && !showUserApps && !showSystemApps) return@SettingsToggle
105114
scope.launch {
106-
Settings.showLinuxProcess = it
107-
viewModel.setShowLinuxProcess(it)
115+
Settings.showLinuxProcess = newValue
116+
viewModel.setShowLinuxProcess(newValue)
108117
}
109118
}
110119
)
111120
}
112121
}
122+
113123
}
114124

115125
Box(

app/src/main/res/values-tr/strings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
<string name="procs">İşlemler</string>
4848
<string name="copied">Panoya kopyalandı</string>
4949
<string name="settings">Ayarlar</string>
50-
<string name="intro">TaskManager'in düzgün çalışması için yükseltilmiş izinler gerekir. Lütfen kullanmak istediğiniz çalışma modunu seçin.</string>
50+
<string name="intro">TaskManager\'in düzgün çalışması için yükseltilmiş izinler gerekir. Lütfen kullanmak istediğiniz çalışma modunu seçin.</string>
5151
<string name="noob">Bu uygulamanın sistem görevlerini yönetmek için özel izne ihtiyacı var.\nCihazınızda şu anda bu erişim hakkı yok.\nDevam etmek için lütfen:\n\n• Shizuku uygulamasını yükleyip başlatın veya\n• Rootlu bir cihaz kullanın.</string>
5252
<string name="theme">Tema</string>
5353
<string name="dynamic_theme">Dinamik Tema</string>

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
1010
# When configured, Gradle will run in incubating parallel mode.
1111
# This option should only be used with decoupled projects. For more details, visit
1212
# https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects
13-
# org.gradle.parallel=true
13+
org.gradle.parallel=true
1414
# AndroidX package structure to make it clearer which packages are bundled with the
1515
# Android operating system, and which are packaged with your app's APK
1616
# https://developer.android.com/topic/libraries/support-library/androidx-rn

0 commit comments

Comments
 (0)