mirror of
https://github.com/readrops/Readrops.git
synced 2025-01-22 06:58:11 +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(
|
val results = repository?.synchronize(
|
||||||
selectedFeeds = selectedFeeds,
|
selectedFeeds = selectedFeeds,
|
||||||
@ -180,6 +180,7 @@ class TimelineScreenModel(
|
|||||||
it.copy(
|
it.copy(
|
||||||
isRefreshing = false,
|
isRefreshing = false,
|
||||||
endSynchronizing = true,
|
endSynchronizing = true,
|
||||||
|
hideReadAllFAB = false,
|
||||||
localSyncErrors = if (results!!.second.isNotEmpty()) results.second else null
|
localSyncErrors = if (results!!.second.isNotEmpty()) results.second else null
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -359,7 +360,8 @@ data class TimelineState(
|
|||||||
val foldersAndFeeds: Map<Folder?, List<Feed>> = emptyMap(),
|
val foldersAndFeeds: Map<Folder?, List<Feed>> = emptyMap(),
|
||||||
val itemState: Flow<PagingData<ItemWithFeed>> = emptyFlow(),
|
val itemState: Flow<PagingData<ItemWithFeed>> = emptyFlow(),
|
||||||
val dialog: DialogState? = null,
|
val dialog: DialogState? = null,
|
||||||
val isAccountLocal: Boolean = false
|
val isAccountLocal: Boolean = false,
|
||||||
|
val hideReadAllFAB: Boolean = false
|
||||||
) {
|
) {
|
||||||
|
|
||||||
val showSubtitle = filters.subFilter != SubFilter.ALL
|
val showSubtitle = filters.subFilter != SubFilter.ALL
|
||||||
|
@ -289,19 +289,21 @@ object TimelineTab : Tab {
|
|||||||
},
|
},
|
||||||
snackbarHost = { SnackbarHost(snackbarHostState) },
|
snackbarHost = { SnackbarHost(snackbarHostState) },
|
||||||
floatingActionButton = {
|
floatingActionButton = {
|
||||||
FloatingActionButton(
|
if (!state.hideReadAllFAB) {
|
||||||
onClick = {
|
FloatingActionButton(
|
||||||
if (state.filters.mainFilter == MainFilter.ALL) {
|
onClick = {
|
||||||
viewModel.openDialog(DialogState.ConfirmDialog)
|
if (state.filters.mainFilter == MainFilter.ALL) {
|
||||||
} else {
|
viewModel.openDialog(DialogState.ConfirmDialog)
|
||||||
viewModel.setAllItemsRead()
|
} 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 ->
|
) { paddingValues ->
|
||||||
|
Loading…
Reference in New Issue
Block a user