Skip to content

Commit 2785ddf

Browse files
Add 'Show Private Spaces' preference to SettingsFragment
- Introduced a new toggle for displaying private spaces in the settings. - Updated strings.xml to include the corresponding label for the new preference.
1 parent 9b9edd7 commit 2785ddf

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

app/src/main/java/com/github/codeworkscreativehub/mlauncher/ui/SettingsFragment.kt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ class SettingsFragment : BaseFragment() {
218218
var toggledShowBattery by remember { mutableStateOf(prefs.showBattery) }
219219
var toggledShowBatteryIcon by remember { mutableStateOf(prefs.showBatteryIcon) }
220220
var toggledShowWeather by remember { mutableStateOf(prefs.showWeather) }
221+
var toggledShowPrivateSpaces by remember { mutableStateOf(prefs.showPrivateSpaces) }
221222
var toggledGPSLocation by remember { mutableStateOf(prefs.gpsLocation) }
222223
var selectedTempUnits by remember { mutableStateOf(prefs.tempUnit) }
223224
var selectedWeatherLocation by remember { mutableStateOf(prefs.loadLocationName()) }
@@ -1086,6 +1087,18 @@ class SettingsFragment : BaseFragment() {
10861087
}
10871088
)
10881089

1090+
if (PrivateSpaceManager(requireContext()).isPrivateSpaceSetUp()) {
1091+
SettingsSwitch(
1092+
text = getLocalizedString(R.string.show_private_spaces),
1093+
fontSize = titleFontSize,
1094+
defaultState = toggledShowPrivateSpaces,
1095+
onCheckedChange = {
1096+
toggledShowPrivateSpaces = !prefs.showPrivateSpaces
1097+
prefs.showPrivateSpaces = toggledShowPrivateSpaces
1098+
}
1099+
)
1100+
}
1101+
10891102
Spacer(modifier = Modifier.height(12.dp))
10901103

10911104
// Weather

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@
107107
<string name="show_daily_word">Show Daily Word</string>
108108
<string name="show_battery">Show Battery</string>
109109
<string name="show_battery_icon">Show Battery Icon</string>
110+
<string name="show_private_spaces">Show Private Spaces Icon</string>
110111

111112
<string name="weather">Weather</string>
112113
<string name="show_weather">Show Weather</string>

0 commit comments

Comments
 (0)