mirror of
https://github.com/readrops/Readrops.git
synced 2025-01-05 21:43:21 +01:00
Hide FAB in TimelineTab when displaying local account refresh screen
This commit is contained in:
parent
46800586e1
commit
7be074f759
@ -162,7 +162,7 @@ class TimelineScreenModel(
|
||||
)
|
||||
}
|
||||
|
||||
_timelineState.update { it.copy(isRefreshing = true) }
|
||||
_timelineState.update { it.copy(isRefreshing = true, hideReadAllFAB = true) }
|
||||
|
||||
val results = repository?.synchronize(
|
||||
selectedFeeds = selectedFeeds,
|
||||
@ -180,6 +180,7 @@ class TimelineScreenModel(
|
||||
it.copy(
|
||||
isRefreshing = false,
|
||||
endSynchronizing = true,
|
||||
hideReadAllFAB = false,
|
||||
localSyncErrors = if (results!!.second.isNotEmpty()) results.second else null
|
||||
)
|
||||
}
|
||||
@ -359,7 +360,8 @@ data class TimelineState(
|
||||
val foldersAndFeeds: Map<Folder?, List<Feed>> = emptyMap(),
|
||||
val itemState: Flow<PagingData<ItemWithFeed>> = emptyFlow(),
|
||||
val dialog: DialogState? = null,
|
||||
val isAccountLocal: Boolean = false
|
||||
val isAccountLocal: Boolean = false,
|
||||
val hideReadAllFAB: Boolean = false
|
||||
) {
|
||||
|
||||
val showSubtitle = filters.subFilter != SubFilter.ALL
|
||||
|
@ -289,19 +289,21 @@ object TimelineTab : Tab {
|
||||
},
|
||||
snackbarHost = { SnackbarHost(snackbarHostState) },
|
||||
floatingActionButton = {
|
||||
FloatingActionButton(
|
||||
onClick = {
|
||||
if (state.filters.mainFilter == MainFilter.ALL) {
|
||||
viewModel.openDialog(DialogState.ConfirmDialog)
|
||||
} else {
|
||||
viewModel.setAllItemsRead()
|
||||
if (!state.hideReadAllFAB) {
|
||||
FloatingActionButton(
|
||||
onClick = {
|
||||
if (state.filters.mainFilter == MainFilter.ALL) {
|
||||
viewModel.openDialog(DialogState.ConfirmDialog)
|
||||
} else {
|
||||
viewModel.setAllItemsRead()
|
||||
}
|
||||
}
|
||||
) {
|
||||
Icon(
|
||||
painter = painterResource(id = R.drawable.ic_done_all),
|
||||
contentDescription = null
|
||||
)
|
||||
}
|
||||
) {
|
||||
Icon(
|
||||
painter = painterResource(id = R.drawable.ic_done_all),
|
||||
contentDescription = null
|
||||
)
|
||||
}
|
||||
},
|
||||
) { paddingValues ->
|
||||
|
Loading…
Reference in New Issue
Block a user