Hide Dark Status Bar switch when status bar is hidden (#2384)

Co-authored-by: Patryk <contact@patrykmichalik.com>
This commit is contained in:
Rik KoedootandPatryk authored and GitHub committed 2022-03-13 17:04:04 +01:00
1 parent 6c67991805
commit 8bce01a077
2 files changed
+20 -11

No files matched your search

+2 -1
View File
@@ -113,7 +113,7 @@
<string name="quickstep_description">Clear All Button, Corner Radius</string>
<string name="wallpaper_scrolling_label">Scroll Wallpaper</string>
<string name="show_sys_ui_scrim">Top Shadow</string>
<string name="show_status_bar">Status Bar</string>
<string name="show_status_bar">Show Status Bar</string>
<string name="what_to_show">What to Show</string>
<string name="missing_notification_access_label">Notification Access Needed</string>
<string name="missing_notification_access_description">Notification access needed.</string>
@@ -217,4 +217,5 @@
<string name="always_open_website_label">Always Open Website</string>
<string name="always_open_website_description">Open search provider’s website even if their app is installed.</string>
<string name="search_provider">Search Provider</string>
<string name="status_bar_label">Status Bar</string>
</resources>
@@ -118,11 +118,6 @@ fun HomeScreenPreferences() {
edit = { dt2s.set(value = it) },
label = stringResource(id = R.string.workspace_dt2s),
)
SwitchPreference2(
checked = darkStatusBar,
label = stringResource(id = R.string.dark_status_bar_label),
edit = { darkStatusBar.set(value = it) },
)
val columns by prefs.workspaceColumns.getAdapter()
val rows by prefs.workspaceRows.getAdapter()
NavigationActionPreference(
@@ -131,6 +126,24 @@ fun HomeScreenPreferences() {
subtitle = stringResource(id = R.string.x_by_y, columns, rows),
)
}
PreferenceGroup(heading = stringResource(id = R.string.status_bar_label)) {
SwitchPreference2(
checked = showStatusBar,
label = stringResource(id = R.string.show_status_bar),
edit = { showStatusBar.set(value = it) },
)
AnimatedVisibility(
visible = showStatusBar,
enter = expandVertically() + fadeIn(),
exit = shrinkVertically() + fadeOut(),
) {
SwitchPreference2(
checked = darkStatusBar,
label = stringResource(id = R.string.dark_status_bar_label),
edit = { darkStatusBar.set(value = it) },
)
}
}
PreferenceGroup(heading = stringResource(id = R.string.what_to_show)) {
val feedAvailable = OverlayCallbackImpl.minusOneAvailable(LocalContext.current)
SwitchPreference2(
@@ -145,11 +158,6 @@ fun HomeScreenPreferences() {
edit = { enableSmartspace.set(value = it) },
label = stringResource(id = R.string.smart_space_enable),
)
SwitchPreference2(
checked = showStatusBar,
label = stringResource(id = R.string.show_status_bar),
edit = { showStatusBar.set(value = it) },
)
SwitchPreference2(
checked = showTopShadow,
label = stringResource(id = R.string.show_sys_ui_scrim),