From c54a14e61685191888fc062e858ba64329b5f98c Mon Sep 17 00:00:00 2001 From: Shinokuni Date: Sun, 18 Aug 2024 13:31:36 +0200 Subject: [PATCH] Hide Fab when synchronizing in TimelineTab --- .../com/readrops/app/timelime/TimelineScreenModel.kt | 9 ++++++--- .../com/readrops/db/entities/account/AccountConfig.kt | 7 ++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/com/readrops/app/timelime/TimelineScreenModel.kt b/app/src/main/java/com/readrops/app/timelime/TimelineScreenModel.kt index 1b8ffc02..8f8e344b 100644 --- a/app/src/main/java/com/readrops/app/timelime/TimelineScreenModel.kt +++ b/app/src/main/java/com/readrops/app/timelime/TimelineScreenModel.kt @@ -146,7 +146,8 @@ class TimelineScreenModel( emptyFlow() }, isAccountLocal = currentAccount!!.isLocal, - scrollToTop = true + scrollToTop = true, + hideReadAllFAB = !currentAccount!!.config.canMarkAllItemsAsRead ) } @@ -175,7 +176,10 @@ class TimelineScreenModel( if (!currentAccount!!.isLocal) { _timelineState.update { - it.copy(isRefreshing = true) + it.copy( + isRefreshing = true, + hideReadAllFAB = true + ) } } @@ -216,7 +220,6 @@ class TimelineScreenModel( _timelineState.update { it.copy( isRefreshing = true, - hideReadAllFAB = true, currentFeed = workInfo.progress.getString(SyncWorker.FEED_NAME_KEY) ?: "", feedCount = workInfo.progress.getInt(SyncWorker.FEED_COUNT_KEY, 0), diff --git a/db/src/main/java/com/readrops/db/entities/account/AccountConfig.kt b/db/src/main/java/com/readrops/db/entities/account/AccountConfig.kt index 32b13f87..0910d6c1 100644 --- a/db/src/main/java/com/readrops/db/entities/account/AccountConfig.kt +++ b/db/src/main/java/com/readrops/db/entities/account/AccountConfig.kt @@ -9,7 +9,8 @@ data class AccountConfig( val canUpdateFolder: Boolean = true, val canUpdateFeed: Boolean = true, val canDeleteFeed: Boolean = true, - val canDeleteFolder: Boolean = true + val canDeleteFolder: Boolean = true, + val canMarkAllItemsAsRead: Boolean = true ) { companion object { @@ -18,7 +19,6 @@ data class AccountConfig( canCreateFolder = true, addNoFolder = true, useSeparateState = false, - ) val NEXTCLOUD_NEWS = AccountConfig( @@ -44,7 +44,8 @@ data class AccountConfig( canUpdateFolder = false, canUpdateFeed = false, canDeleteFeed = false, - canDeleteFolder = false + canDeleteFolder = false, + canMarkAllItemsAsRead = false ) } } \ No newline at end of file