diff options
| author | Peter Stone <thepeterstone@gmail.com> | 2026-07-24 08:12:11 +0000 |
|---|---|---|
| committer | Peter Stone <thepeterstone@gmail.com> | 2026-07-24 08:12:11 +0000 |
| commit | 439ad1a4f8b6a492bbd54f239462dc38b874cd4c (patch) | |
| tree | 354c3f07552dcae46581e51f32ffb0ea17281c4f /app/src/main/java/org/terst/feedreader/ui | |
| parent | 72f76cc41ae406e00a4dd9d448e2b552f9a6baaa (diff) | |
Add a "keep unread" skip button between Previous and Next
Advances to the next article the same as Next, but without the implicit
mark-read that normally comes with moving on -- for "I looked, but I'm
not done with this one yet." Verified live: skipping past an article
leaves it unread while the queue still advances; regular Next still
marks read as before.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EZ7ikw2ukGJFTHE3bJS7zL
Diffstat (limited to 'app/src/main/java/org/terst/feedreader/ui')
| -rw-r--r-- | app/src/main/java/org/terst/feedreader/ui/ReaderScreen.kt | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/app/src/main/java/org/terst/feedreader/ui/ReaderScreen.kt b/app/src/main/java/org/terst/feedreader/ui/ReaderScreen.kt index d6111e2..b7f6018 100644 --- a/app/src/main/java/org/terst/feedreader/ui/ReaderScreen.kt +++ b/app/src/main/java/org/terst/feedreader/ui/ReaderScreen.kt @@ -27,6 +27,7 @@ import androidx.compose.material.icons.filled.MoreVert import androidx.compose.material.icons.filled.NavigateBefore import androidx.compose.material.icons.filled.NavigateNext import androidx.compose.material.icons.filled.OpenInBrowser +import androidx.compose.material.icons.filled.SkipNext import androidx.compose.material.icons.outlined.Article import androidx.compose.material3.AlertDialog import androidx.compose.material3.BottomAppBar @@ -141,6 +142,13 @@ fun ReaderScreen( pagerState.animateScrollToPage((pagerState.currentPage + 1).coerceAtMost(safeIds.size - 1)) } } + // "I looked, but I'm not done with this one" -- advances the same as Next, just without + // the implicit setRead(true) that moving on normally carries. + fun goToNextArticleKeepUnread() { + scope.launch { + pagerState.animateScrollToPage((pagerState.currentPage + 1).coerceAtMost(safeIds.size - 1)) + } + } HorizontalPager(state = pagerState, userScrollEnabled = false, modifier = Modifier.fillMaxSize()) { page -> ReaderContent( @@ -151,7 +159,8 @@ fun ReaderScreen( hasPrevious = hasPrevious, hasNext = hasNext, onPrevious = ::goToPreviousArticle, - onNext = ::goToNextArticle + onNext = ::goToNextArticle, + onNextKeepUnread = ::goToNextArticleKeepUnread ) } } @@ -166,7 +175,8 @@ private fun ReaderContent( hasPrevious: Boolean, hasNext: Boolean, onPrevious: () -> Unit, - onNext: () -> Unit + onNext: () -> Unit, + onNextKeepUnread: () -> Unit ) { val context = LocalContext.current val db = remember { AppDatabase.get(context) } @@ -241,6 +251,8 @@ private fun ReaderContent( snackbarHostState.showSnackbar("Reader mode enabled for $feedLabel") } else { isReaderMode = false + readerContent = null + db.articleDao().setExtractedContent(articleId, null) snackbarHostState.showSnackbar("Reader mode disabled for $feedLabel") } } @@ -402,6 +414,11 @@ private fun ReaderContent( Icon(Icons.Default.NavigateBefore, contentDescription = null) Text("Previous") } + // Advances like Next, but skips the implicit "mark read" that moving on + // normally carries -- for "I looked, but I'm not done with this one yet." + IconButton(onClick = onNextKeepUnread, enabled = hasNext) { + Icon(Icons.Default.SkipNext, contentDescription = "Next, keep unread") + } TextButton( onClick = onNext, enabled = hasNext, |
