Reset the back preview when an overlay reopens (#184)
This commit is contained in:
@@ -470,6 +470,7 @@ fun CalendarHost(
|
|||||||
SearchScreen(
|
SearchScreen(
|
||||||
onBack = { showSearch = false },
|
onBack = { showSearch = false },
|
||||||
onEventClick = onEventClick,
|
onEventClick = onEventClick,
|
||||||
|
visible = showSearch,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -498,6 +499,7 @@ fun CalendarHost(
|
|||||||
importForm = form
|
importForm = form
|
||||||
detailKey = null
|
detailKey = null
|
||||||
},
|
},
|
||||||
|
visible = detailKey != null,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -515,6 +517,7 @@ fun CalendarHost(
|
|||||||
onClose = { createDateIso = null },
|
onClose = { createDateIso = null },
|
||||||
onSaved = { createDateIso = null },
|
onSaved = { createDateIso = null },
|
||||||
onManageCalendars = { showCalendars = true },
|
onManageCalendars = { showCalendars = true },
|
||||||
|
visible = createDateIso != null,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -535,6 +538,7 @@ fun CalendarHost(
|
|||||||
detailKey = null
|
detailKey = null
|
||||||
},
|
},
|
||||||
onManageCalendars = { showCalendars = true },
|
onManageCalendars = { showCalendars = true },
|
||||||
|
visible = editKey != null,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -549,6 +553,7 @@ fun CalendarHost(
|
|||||||
onBack = { showSettings = false },
|
onBack = { showSettings = false },
|
||||||
onManageCalendars = { showCalendars = true },
|
onManageCalendars = { showCalendars = true },
|
||||||
onOpenBackup = { showBackup = true },
|
onOpenBackup = { showBackup = true },
|
||||||
|
visible = showSettings,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -605,6 +610,7 @@ fun CalendarHost(
|
|||||||
CalendarsScreen(
|
CalendarsScreen(
|
||||||
onBack = { showCalendars = false },
|
onBack = { showCalendars = false },
|
||||||
onOpenBackup = { showBackup = true },
|
onOpenBackup = { showBackup = true },
|
||||||
|
visible = showCalendars,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -639,6 +645,7 @@ fun CalendarHost(
|
|||||||
showBackup = false
|
showBackup = false
|
||||||
showCalendars = false
|
showCalendars = false
|
||||||
},
|
},
|
||||||
|
visible = showBackup,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -82,6 +82,7 @@ private val RESTORE_MIME_TYPES = arrayOf(
|
|||||||
fun BackupScreen(
|
fun BackupScreen(
|
||||||
onBack: () -> Unit,
|
onBack: () -> Unit,
|
||||||
onImport: (Uri) -> Unit,
|
onImport: (Uri) -> Unit,
|
||||||
|
visible: Boolean = true,
|
||||||
viewModel: CalendarsViewModel = hiltViewModel(),
|
viewModel: CalendarsViewModel = hiltViewModel(),
|
||||||
) {
|
) {
|
||||||
val state by viewModel.backupState.collectAsStateWithLifecycle()
|
val state by viewModel.backupState.collectAsStateWithLifecycle()
|
||||||
@@ -137,6 +138,7 @@ fun BackupScreen(
|
|||||||
scrollable = state is BackupUiState.Ready,
|
scrollable = state is BackupUiState.Ready,
|
||||||
snackbarHost = { SnackbarHost(snackbarHostState) },
|
snackbarHost = { SnackbarHost(snackbarHostState) },
|
||||||
predictiveBack = true,
|
predictiveBack = true,
|
||||||
|
visible = visible,
|
||||||
) {
|
) {
|
||||||
when (val s = state) {
|
when (val s = state) {
|
||||||
BackupUiState.Loading -> BackupLoading()
|
BackupUiState.Loading -> BackupLoading()
|
||||||
|
|||||||
@@ -133,6 +133,7 @@ private const val NEW_CALENDAR_ID = Long.MIN_VALUE
|
|||||||
fun CalendarsScreen(
|
fun CalendarsScreen(
|
||||||
onBack: () -> Unit,
|
onBack: () -> Unit,
|
||||||
onOpenBackup: () -> Unit,
|
onOpenBackup: () -> Unit,
|
||||||
|
visible: Boolean = true,
|
||||||
viewModel: CalendarsViewModel = hiltViewModel(),
|
viewModel: CalendarsViewModel = hiltViewModel(),
|
||||||
) {
|
) {
|
||||||
val calendars by viewModel.calendars.collectAsStateWithLifecycle()
|
val calendars by viewModel.calendars.collectAsStateWithLifecycle()
|
||||||
@@ -177,6 +178,7 @@ fun CalendarsScreen(
|
|||||||
onConsumeError = viewModel::consumeError,
|
onConsumeError = viewModel::consumeError,
|
||||||
onOpenBackup = onOpenBackup,
|
onOpenBackup = onOpenBackup,
|
||||||
onBack = onBack,
|
onBack = onBack,
|
||||||
|
visible = visible,
|
||||||
onAdd = { editorSession++; editorId = NEW_CALENDAR_ID },
|
onAdd = { editorSession++; editorId = NEW_CALENDAR_ID },
|
||||||
onEdit = { calendar -> editorSession++; editorId = calendar.id },
|
onEdit = { calendar -> editorSession++; editorId = calendar.id },
|
||||||
onSetVisible = viewModel::setCalendarVisible,
|
onSetVisible = viewModel::setCalendarVisible,
|
||||||
@@ -193,6 +195,7 @@ private fun CalendarsList(
|
|||||||
onConsumeError: () -> Unit,
|
onConsumeError: () -> Unit,
|
||||||
onOpenBackup: () -> Unit,
|
onOpenBackup: () -> Unit,
|
||||||
onBack: () -> Unit,
|
onBack: () -> Unit,
|
||||||
|
visible: Boolean,
|
||||||
onAdd: () -> Unit,
|
onAdd: () -> Unit,
|
||||||
onEdit: (CalendarSource) -> Unit,
|
onEdit: (CalendarSource) -> Unit,
|
||||||
onSetVisible: (Long, Boolean) -> Unit,
|
onSetVisible: (Long, Boolean) -> Unit,
|
||||||
@@ -218,6 +221,7 @@ private fun CalendarsList(
|
|||||||
onBack = onBack,
|
onBack = onBack,
|
||||||
snackbarHost = { SnackbarHost(snackbarHostState) },
|
snackbarHost = { SnackbarHost(snackbarHostState) },
|
||||||
predictiveBack = true,
|
predictiveBack = true,
|
||||||
|
visible = visible,
|
||||||
) {
|
) {
|
||||||
// What the per-calendar / per-account switches below actually do.
|
// What the per-calendar / per-account switches below actually do.
|
||||||
HintText(stringResource(R.string.calendars_visibility_hint))
|
HintText(stringResource(R.string.calendars_visibility_hint))
|
||||||
|
|||||||
@@ -140,6 +140,7 @@ fun EventDetailScreen(
|
|||||||
onBack: () -> Unit,
|
onBack: () -> Unit,
|
||||||
onEdit: () -> Unit,
|
onEdit: () -> Unit,
|
||||||
onDuplicate: (EventForm) -> Unit,
|
onDuplicate: (EventForm) -> Unit,
|
||||||
|
visible: Boolean = true,
|
||||||
viewModel: EventDetailViewModel = hiltViewModel(),
|
viewModel: EventDetailViewModel = hiltViewModel(),
|
||||||
) {
|
) {
|
||||||
LaunchedEffect(eventId, beginMillis, endMillis) {
|
LaunchedEffect(eventId, beginMillis, endMillis) {
|
||||||
@@ -227,7 +228,7 @@ fun EventDetailScreen(
|
|||||||
}
|
}
|
||||||
|
|
||||||
Scaffold(
|
Scaffold(
|
||||||
modifier = Modifier.predictiveBack(onBack = onBack),
|
modifier = Modifier.predictiveBack(onBack = onBack, visible = visible),
|
||||||
snackbarHost = { SnackbarHost(snackbarHostState) },
|
snackbarHost = { SnackbarHost(snackbarHostState) },
|
||||||
topBar = {
|
topBar = {
|
||||||
TopAppBar(
|
TopAppBar(
|
||||||
|
|||||||
@@ -203,6 +203,7 @@ fun EventEditScreen(
|
|||||||
initialForm: EventForm? = null,
|
initialForm: EventForm? = null,
|
||||||
initialFormSource: ImportSource = ImportSource.File,
|
initialFormSource: ImportSource = ImportSource.File,
|
||||||
onManageCalendars: (() -> Unit)? = null,
|
onManageCalendars: (() -> Unit)? = null,
|
||||||
|
visible: Boolean = true,
|
||||||
viewModel: EventEditViewModel = hiltViewModel(),
|
viewModel: EventEditViewModel = hiltViewModel(),
|
||||||
) {
|
) {
|
||||||
LaunchedEffect(initialDateIso, editKey, initialForm) {
|
LaunchedEffect(initialDateIso, editKey, initialForm) {
|
||||||
@@ -285,7 +286,7 @@ fun EventEditScreen(
|
|||||||
}
|
}
|
||||||
|
|
||||||
Scaffold(
|
Scaffold(
|
||||||
modifier = Modifier.predictiveBack(onBack = close),
|
modifier = Modifier.predictiveBack(onBack = close, visible = visible),
|
||||||
snackbarHost = { SnackbarHost(snackbarHostState) },
|
snackbarHost = { SnackbarHost(snackbarHostState) },
|
||||||
topBar = {
|
topBar = {
|
||||||
TopAppBar(
|
TopAppBar(
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ fun ImportScreen(
|
|||||||
onOpenSingle: (EventForm) -> Unit,
|
onOpenSingle: (EventForm) -> Unit,
|
||||||
forceMany: Boolean = false,
|
forceMany: Boolean = false,
|
||||||
onManageCalendars: (() -> Unit)? = null,
|
onManageCalendars: (() -> Unit)? = null,
|
||||||
|
visible: Boolean = true,
|
||||||
viewModel: ImportViewModel = hiltViewModel(),
|
viewModel: ImportViewModel = hiltViewModel(),
|
||||||
) {
|
) {
|
||||||
// hiltViewModel() resolves to the Activity's store and is retained across
|
// hiltViewModel() resolves to the Activity's store and is retained across
|
||||||
@@ -103,7 +104,7 @@ fun ImportScreen(
|
|||||||
|
|
||||||
Scaffold(
|
Scaffold(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.predictiveBack(onBack = onClose)
|
.predictiveBack(onBack = onClose, visible = visible)
|
||||||
.fillMaxSize(),
|
.fillMaxSize(),
|
||||||
topBar = {
|
topBar = {
|
||||||
TopAppBar(
|
TopAppBar(
|
||||||
|
|||||||
@@ -23,13 +23,14 @@ import de.jeanlucmakiola.floret.components.positionOf
|
|||||||
* what the *recipient of the binary* is told. Each row opens the project's source.
|
* what the *recipient of the binary* is told. Each row opens the project's source.
|
||||||
*/
|
*/
|
||||||
@Composable
|
@Composable
|
||||||
internal fun LicencesScreen(onBack: () -> Unit) {
|
internal fun LicencesScreen(onBack: () -> Unit, visible: Boolean = true) {
|
||||||
val uriHandler = LocalUriHandler.current
|
val uriHandler = LocalUriHandler.current
|
||||||
|
|
||||||
CollapsingScaffold(
|
CollapsingScaffold(
|
||||||
title = stringResource(R.string.licences_title),
|
title = stringResource(R.string.licences_title),
|
||||||
onBack = onBack,
|
onBack = onBack,
|
||||||
predictiveBack = true,
|
predictiveBack = true,
|
||||||
|
visible = visible,
|
||||||
) {
|
) {
|
||||||
Text(
|
Text(
|
||||||
stringResource(R.string.licences_intro),
|
stringResource(R.string.licences_intro),
|
||||||
|
|||||||
@@ -126,6 +126,7 @@ fun SearchScreen(
|
|||||||
onBack: () -> Unit,
|
onBack: () -> Unit,
|
||||||
onEventClick: (EventInstance) -> Unit,
|
onEventClick: (EventInstance) -> Unit,
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
|
visible: Boolean = true,
|
||||||
viewModel: SearchViewModel = hiltViewModel(),
|
viewModel: SearchViewModel = hiltViewModel(),
|
||||||
) {
|
) {
|
||||||
val query by viewModel.query.collectAsStateWithLifecycle()
|
val query by viewModel.query.collectAsStateWithLifecycle()
|
||||||
@@ -184,7 +185,7 @@ fun SearchScreen(
|
|||||||
BackHandler(enabled = inSelection) { viewModel.clearSelection() }
|
BackHandler(enabled = inSelection) { viewModel.clearSelection() }
|
||||||
|
|
||||||
Scaffold(
|
Scaffold(
|
||||||
modifier = modifier.predictiveBack(onBack = onBack, enabled = !inSelection),
|
modifier = modifier.predictiveBack(onBack = onBack, enabled = !inSelection, visible = visible),
|
||||||
containerColor = MaterialTheme.colorScheme.surface,
|
containerColor = MaterialTheme.colorScheme.surface,
|
||||||
topBar = {
|
topBar = {
|
||||||
SearchTopBar(
|
SearchTopBar(
|
||||||
|
|||||||
@@ -76,6 +76,7 @@ internal fun AppearanceScreen(
|
|||||||
state: SettingsUiState,
|
state: SettingsUiState,
|
||||||
viewModel: SettingsViewModel,
|
viewModel: SettingsViewModel,
|
||||||
onBack: () -> Unit,
|
onBack: () -> Unit,
|
||||||
|
visible: Boolean = true,
|
||||||
) {
|
) {
|
||||||
var showTheme by remember { mutableStateOf(false) }
|
var showTheme by remember { mutableStateOf(false) }
|
||||||
var showBrandFont by remember { mutableStateOf(false) }
|
var showBrandFont by remember { mutableStateOf(false) }
|
||||||
@@ -96,6 +97,7 @@ internal fun AppearanceScreen(
|
|||||||
title = stringResource(R.string.settings_section_appearance),
|
title = stringResource(R.string.settings_section_appearance),
|
||||||
onBack = onBack,
|
onBack = onBack,
|
||||||
predictiveBack = true,
|
predictiveBack = true,
|
||||||
|
visible = visible,
|
||||||
) {
|
) {
|
||||||
// Theme & colour
|
// Theme & colour
|
||||||
GroupedRow(
|
GroupedRow(
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ internal fun EventFormScreen(
|
|||||||
state: SettingsUiState,
|
state: SettingsUiState,
|
||||||
viewModel: SettingsViewModel,
|
viewModel: SettingsViewModel,
|
||||||
onBack: () -> Unit,
|
onBack: () -> Unit,
|
||||||
|
visible: Boolean = true,
|
||||||
) {
|
) {
|
||||||
var showDefaultDuration by remember { mutableStateOf(false) }
|
var showDefaultDuration by remember { mutableStateOf(false) }
|
||||||
// The calendar whose duration-override picker is open, if any.
|
// The calendar whose duration-override picker is open, if any.
|
||||||
@@ -53,6 +54,7 @@ internal fun EventFormScreen(
|
|||||||
title = stringResource(R.string.settings_section_event_form),
|
title = stringResource(R.string.settings_section_event_form),
|
||||||
onBack = onBack,
|
onBack = onBack,
|
||||||
predictiveBack = true,
|
predictiveBack = true,
|
||||||
|
visible = visible,
|
||||||
) {
|
) {
|
||||||
SettingsHint(stringResource(R.string.settings_form_fields_hint))
|
SettingsHint(stringResource(R.string.settings_form_fields_hint))
|
||||||
Spacer(Modifier.height(8.dp))
|
Spacer(Modifier.height(8.dp))
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ internal fun NotificationsScreen(
|
|||||||
viewModel: SettingsViewModel,
|
viewModel: SettingsViewModel,
|
||||||
onBack: () -> Unit,
|
onBack: () -> Unit,
|
||||||
onOpenSpecialDates: () -> Unit,
|
onOpenSpecialDates: () -> Unit,
|
||||||
|
visible: Boolean = true,
|
||||||
) {
|
) {
|
||||||
val context = LocalContext.current
|
val context = LocalContext.current
|
||||||
val launcher = rememberLauncherForActivityResult(
|
val launcher = rememberLauncherForActivityResult(
|
||||||
@@ -92,6 +93,7 @@ internal fun NotificationsScreen(
|
|||||||
title = stringResource(R.string.settings_section_notifications),
|
title = stringResource(R.string.settings_section_notifications),
|
||||||
onBack = onBack,
|
onBack = onBack,
|
||||||
predictiveBack = true,
|
predictiveBack = true,
|
||||||
|
visible = visible,
|
||||||
) {
|
) {
|
||||||
GroupedRow(
|
GroupedRow(
|
||||||
title = stringResource(R.string.settings_reminders),
|
title = stringResource(R.string.settings_reminders),
|
||||||
|
|||||||
@@ -84,6 +84,7 @@ fun SettingsScreen(
|
|||||||
onManageCalendars: () -> Unit,
|
onManageCalendars: () -> Unit,
|
||||||
onOpenBackup: () -> Unit,
|
onOpenBackup: () -> Unit,
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
|
visible: Boolean = true,
|
||||||
viewModel: SettingsViewModel = hiltViewModel(),
|
viewModel: SettingsViewModel = hiltViewModel(),
|
||||||
) {
|
) {
|
||||||
val state by viewModel.state.collectAsStateWithLifecycle()
|
val state by viewModel.state.collectAsStateWithLifecycle()
|
||||||
@@ -102,6 +103,7 @@ fun SettingsScreen(
|
|||||||
onOpenSection = { section = it },
|
onOpenSection = { section = it },
|
||||||
onManageCalendars = onManageCalendars,
|
onManageCalendars = onManageCalendars,
|
||||||
onOpenBackup = onOpenBackup,
|
onOpenBackup = onOpenBackup,
|
||||||
|
visible = visible,
|
||||||
)
|
)
|
||||||
|
|
||||||
AnimatedVisibility(
|
AnimatedVisibility(
|
||||||
@@ -109,21 +111,21 @@ fun SettingsScreen(
|
|||||||
enter = slideInHorizontally(slideSpec) { it } + fadeIn(),
|
enter = slideInHorizontally(slideSpec) { it } + fadeIn(),
|
||||||
exit = overlayExit,
|
exit = overlayExit,
|
||||||
) {
|
) {
|
||||||
AppearanceScreen(state = state, viewModel = viewModel, onBack = { section = null })
|
AppearanceScreen(state = state, viewModel = viewModel, onBack = { section = null }, visible = section == SettingsSection.Appearance)
|
||||||
}
|
}
|
||||||
AnimatedVisibility(
|
AnimatedVisibility(
|
||||||
visible = section == SettingsSection.Views,
|
visible = section == SettingsSection.Views,
|
||||||
enter = slideInHorizontally(slideSpec) { it } + fadeIn(),
|
enter = slideInHorizontally(slideSpec) { it } + fadeIn(),
|
||||||
exit = overlayExit,
|
exit = overlayExit,
|
||||||
) {
|
) {
|
||||||
ViewsScreen(state = state, viewModel = viewModel, onBack = { section = null })
|
ViewsScreen(state = state, viewModel = viewModel, onBack = { section = null }, visible = section == SettingsSection.Views)
|
||||||
}
|
}
|
||||||
AnimatedVisibility(
|
AnimatedVisibility(
|
||||||
visible = section == SettingsSection.EventForm,
|
visible = section == SettingsSection.EventForm,
|
||||||
enter = slideInHorizontally(slideSpec) { it } + fadeIn(),
|
enter = slideInHorizontally(slideSpec) { it } + fadeIn(),
|
||||||
exit = overlayExit,
|
exit = overlayExit,
|
||||||
) {
|
) {
|
||||||
EventFormScreen(state = state, viewModel = viewModel, onBack = { section = null })
|
EventFormScreen(state = state, viewModel = viewModel, onBack = { section = null }, visible = section == SettingsSection.EventForm)
|
||||||
}
|
}
|
||||||
AnimatedVisibility(
|
AnimatedVisibility(
|
||||||
visible = section == SettingsSection.Notifications,
|
visible = section == SettingsSection.Notifications,
|
||||||
@@ -135,6 +137,7 @@ fun SettingsScreen(
|
|||||||
viewModel = viewModel,
|
viewModel = viewModel,
|
||||||
onBack = { section = null },
|
onBack = { section = null },
|
||||||
onOpenSpecialDates = { section = SettingsSection.SpecialDates },
|
onOpenSpecialDates = { section = SettingsSection.SpecialDates },
|
||||||
|
visible = section == SettingsSection.Notifications,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
AnimatedVisibility(
|
AnimatedVisibility(
|
||||||
@@ -142,21 +145,21 @@ fun SettingsScreen(
|
|||||||
enter = slideInHorizontally(slideSpec) { it } + fadeIn(),
|
enter = slideInHorizontally(slideSpec) { it } + fadeIn(),
|
||||||
exit = overlayExit,
|
exit = overlayExit,
|
||||||
) {
|
) {
|
||||||
SpecialDatesScreen(viewModel = viewModel, onBack = { section = null })
|
SpecialDatesScreen(viewModel = viewModel, onBack = { section = null }, visible = section == SettingsSection.SpecialDates)
|
||||||
}
|
}
|
||||||
AnimatedVisibility(
|
AnimatedVisibility(
|
||||||
visible = section == SettingsSection.Widgets,
|
visible = section == SettingsSection.Widgets,
|
||||||
enter = slideInHorizontally(slideSpec) { it } + fadeIn(),
|
enter = slideInHorizontally(slideSpec) { it } + fadeIn(),
|
||||||
exit = overlayExit,
|
exit = overlayExit,
|
||||||
) {
|
) {
|
||||||
WidgetsScreen(state = state, viewModel = viewModel, onBack = { section = null })
|
WidgetsScreen(state = state, viewModel = viewModel, onBack = { section = null }, visible = section == SettingsSection.Widgets)
|
||||||
}
|
}
|
||||||
AnimatedVisibility(
|
AnimatedVisibility(
|
||||||
visible = section == SettingsSection.Licences,
|
visible = section == SettingsSection.Licences,
|
||||||
enter = slideInHorizontally(slideSpec) { it } + fadeIn(),
|
enter = slideInHorizontally(slideSpec) { it } + fadeIn(),
|
||||||
exit = overlayExit,
|
exit = overlayExit,
|
||||||
) {
|
) {
|
||||||
LicencesScreen(onBack = { section = null })
|
LicencesScreen(onBack = { section = null }, visible = section == SettingsSection.Licences)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -171,8 +174,14 @@ private fun SettingsHub(
|
|||||||
onOpenSection: (SettingsSection) -> Unit,
|
onOpenSection: (SettingsSection) -> Unit,
|
||||||
onManageCalendars: () -> Unit,
|
onManageCalendars: () -> Unit,
|
||||||
onOpenBackup: () -> Unit,
|
onOpenBackup: () -> Unit,
|
||||||
|
visible: Boolean,
|
||||||
) {
|
) {
|
||||||
CollapsingScaffold(title = stringResource(R.string.settings_title), onBack = onBack, predictiveBack = true) {
|
CollapsingScaffold(
|
||||||
|
title = stringResource(R.string.settings_title),
|
||||||
|
onBack = onBack,
|
||||||
|
predictiveBack = true,
|
||||||
|
visible = visible,
|
||||||
|
) {
|
||||||
// Card and support row are one grouped block, so the call to action
|
// Card and support row are one grouped block, so the call to action
|
||||||
// continues the container instead of sitting inside it as a button.
|
// continues the container instead of sitting inside it as a button.
|
||||||
Box(Modifier.padding(horizontal = GroupedListInset)) { AboutCard() }
|
Box(Modifier.padding(horizontal = GroupedListInset)) { AboutCard() }
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ import de.jeanlucmakiola.floret.reminders.ReminderOverride
|
|||||||
internal fun SpecialDatesScreen(
|
internal fun SpecialDatesScreen(
|
||||||
viewModel: SettingsViewModel,
|
viewModel: SettingsViewModel,
|
||||||
onBack: () -> Unit,
|
onBack: () -> Unit,
|
||||||
|
visible: Boolean = true,
|
||||||
) {
|
) {
|
||||||
val state by viewModel.specialDatesState.collectAsStateWithLifecycle()
|
val state by viewModel.specialDatesState.collectAsStateWithLifecycle()
|
||||||
val settings by viewModel.state.collectAsStateWithLifecycle()
|
val settings by viewModel.state.collectAsStateWithLifecycle()
|
||||||
@@ -76,6 +77,7 @@ internal fun SpecialDatesScreen(
|
|||||||
title = stringResource(R.string.settings_section_special_dates),
|
title = stringResource(R.string.settings_section_special_dates),
|
||||||
onBack = onBack,
|
onBack = onBack,
|
||||||
predictiveBack = true,
|
predictiveBack = true,
|
||||||
|
visible = visible,
|
||||||
) {
|
) {
|
||||||
// Paused banner: the permission was revoked after enabling.
|
// Paused banner: the permission was revoked after enabling.
|
||||||
if (state.enabled && state.stalledPermission) {
|
if (state.enabled && state.stalledPermission) {
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ internal fun ViewsScreen(
|
|||||||
state: SettingsUiState,
|
state: SettingsUiState,
|
||||||
viewModel: SettingsViewModel,
|
viewModel: SettingsViewModel,
|
||||||
onBack: () -> Unit,
|
onBack: () -> Unit,
|
||||||
|
visible: Boolean = true,
|
||||||
) {
|
) {
|
||||||
var showMonthStyle by remember { mutableStateOf(false) }
|
var showMonthStyle by remember { mutableStateOf(false) }
|
||||||
var showDefaultView by remember { mutableStateOf(false) }
|
var showDefaultView by remember { mutableStateOf(false) }
|
||||||
@@ -79,6 +80,7 @@ internal fun ViewsScreen(
|
|||||||
title = stringResource(R.string.settings_section_views),
|
title = stringResource(R.string.settings_section_views),
|
||||||
onBack = onBack,
|
onBack = onBack,
|
||||||
predictiveBack = true,
|
predictiveBack = true,
|
||||||
|
visible = visible,
|
||||||
) {
|
) {
|
||||||
val config = state.quickSwitchConfig
|
val config = state.quickSwitchConfig
|
||||||
|
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ internal fun WidgetsScreen(
|
|||||||
state: SettingsUiState,
|
state: SettingsUiState,
|
||||||
viewModel: SettingsViewModel,
|
viewModel: SettingsViewModel,
|
||||||
onBack: () -> Unit,
|
onBack: () -> Unit,
|
||||||
|
visible: Boolean = true,
|
||||||
) {
|
) {
|
||||||
var showAgendaWidgetRange by remember { mutableStateOf(false) }
|
var showAgendaWidgetRange by remember { mutableStateOf(false) }
|
||||||
var showWidgetSize by remember { mutableStateOf(false) }
|
var showWidgetSize by remember { mutableStateOf(false) }
|
||||||
@@ -50,6 +51,7 @@ internal fun WidgetsScreen(
|
|||||||
title = stringResource(R.string.settings_section_widgets),
|
title = stringResource(R.string.settings_section_widgets),
|
||||||
onBack = onBack,
|
onBack = onBack,
|
||||||
predictiveBack = true,
|
predictiveBack = true,
|
||||||
|
visible = visible,
|
||||||
) {
|
) {
|
||||||
SettingsHint(stringResource(R.string.settings_widgets_hint))
|
SettingsHint(stringResource(R.string.settings_widgets_hint))
|
||||||
Spacer(Modifier.height(8.dp))
|
Spacer(Modifier.height(8.dp))
|
||||||
|
|||||||
+1
-1
Submodule floret-kit updated: 1ab46897c3...1d6b1ed2a9
Reference in New Issue
Block a user