Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,12 @@ fun ArticleList(
refreshingAll: Boolean,
enableMarkReadOnScroll: Boolean = false,
dimReadArticles: Boolean = true,
showIcons: Boolean = true,
) {
val articleOptions = rememberArticleOptions().copy(
val options = rememberArticleOptions()
val articleOptions = options.copy(
dim = dimReadArticles,
showIcon = options.showIcon && showIcons,
)
val currentTime = rememberCurrentTime()
val localDensity = LocalDensity.current
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ import com.capyreader.app.ui.articles.media.ArticleMediaView
import com.capyreader.app.ui.collectChangesWithCurrent
import com.capyreader.app.ui.collectChangesWithDefault
import com.capyreader.app.ui.components.ArticleSearch
import com.capyreader.app.ui.components.LocalSnackbarHost
import com.capyreader.app.ui.components.SearchState
import com.capyreader.app.ui.provideLinkOpener
import com.capyreader.app.ui.rememberLazyListState
import com.capyreader.app.ui.rememberLocalConnectivity
import com.capyreader.app.ui.components.LocalSnackbarHost
import com.jocmp.capy.Article
import com.jocmp.capy.ArticleFilter
import com.jocmp.capy.Feed
Expand Down Expand Up @@ -603,6 +603,7 @@ fun ArticleScreen(
enableMarkReadOnScroll = enableMarkReadOnScroll,
refreshingAll = viewModel.refreshingAll,
dimReadArticles = filter !is ArticleFilter.Starred,
showIcons = !filter.isReadLaterFeed(readLaterFeed),
onMarkAllRead = { range ->
onMarkAllRead(range)
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,9 @@ class ArticleScreenViewModel(
val readLaterFeed: Flow<Feed?> = combine(
account.feeds,
_counts,
filter,
) { feeds, latestCounts, filter ->
) { feeds, latestCounts ->
feeds.find { it.isReadLater }
?.let { copyFeedCounts(it, latestCounts) }
?.takeIf { it.count > 0 || filter.status != ArticleStatus.UNREAD }
}

private val nextFilterListener: Flow<NextFilter?> =
Expand Down
4 changes: 4 additions & 0 deletions capy/src/main/java/com/jocmp/capy/ArticleFilter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ sealed class ArticleFilter(open val status: ArticleStatus) {
return this is Starred
}

fun isReadLaterFeed(feed: Feed?): Boolean {
return feed != null && isFeedSelected(feed)
}

fun withStatus(status: ArticleStatus): ArticleFilter {
return when (this) {
is Articles -> copy(articleStatus = status)
Expand Down
Loading