summaryrefslogtreecommitdiff
path: root/app/src/main/java/org/terst/feedreader/ui/MainActivity.kt
diff options
context:
space:
mode:
authorPeter Stone <thepeterstone@gmail.com>2026-07-22 18:56:47 +0000
committerPeter Stone <thepeterstone@gmail.com>2026-07-22 18:56:47 +0000
commitbedf8a47a8b0601f4e3c253e4d2a7325c6ccbfc6 (patch)
treeddfaebfc7d7b2307f7d8658bbfa74cefce27b377 /app/src/main/java/org/terst/feedreader/ui/MainActivity.kt
parente804e7a77a6cac048d5f6edeac0a339ca89e4d40 (diff)
Fix accidental page-swipe while scrolling; bring linked-article reader to parity
- ReaderScreen: HorizontalPager's full-surface drag detection was treating ordinary vertical scrolling inside the embedded WebView (a native View, which doesn't arbitrate with Compose's gesture system the way a pure-Compose scrollable child would) as an attempted horizontal page-turn on anything less than a perfectly vertical swipe -- i.e. most real thumb scrolling. Tried gating it to edge-zone-only drags first, but that collides with Android's own edge-swipe-back gesture on gesture-nav devices (reproduced live: an edge swipe triggered system back, not the pager). Landed on disabling the Pager's built-in gesture and driving it from a custom detector that works anywhere on screen but only commits to a page turn once a drag is clearly horizontal-dominant (>2x the vertical movement) -- ordinary scrolling, even sloppy/diagonal, is left completely unconsumed for the WebView. Verified live: a deliberately diagonal mid-screen scroll now stays on the same article; a decisive horizontal swipe still changes pages. - LinkReaderScreen: was missing the bookmark/Stash/reader-toggle/menu actions entirely -- reported after tapping a link left "all my icons... gone." Brought to parity with the main article reader: save locally and save to Stash now lazily create a standalone ArticleEntity (feedId=null, id = hash of the URL, same scheme ShareReceiverActivity uses) on first use; reader-mode toggle falls back to the live page (JS on) instead of always forcing extraction; same login/find-another-source menu. Verified live: all 5 icons present once extraction finishes, bookmarking a linked article correctly creates a standalone DB row.
Diffstat (limited to 'app/src/main/java/org/terst/feedreader/ui/MainActivity.kt')
-rw-r--r--app/src/main/java/org/terst/feedreader/ui/MainActivity.kt3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/src/main/java/org/terst/feedreader/ui/MainActivity.kt b/app/src/main/java/org/terst/feedreader/ui/MainActivity.kt
index bd09393..43e1680 100644
--- a/app/src/main/java/org/terst/feedreader/ui/MainActivity.kt
+++ b/app/src/main/java/org/terst/feedreader/ui/MainActivity.kt
@@ -103,7 +103,8 @@ fun FeedReaderApp() {
LinkReaderScreen(
url = url,
onBack = { navController.popBackStack() },
- onOpenLink = { nextUrl -> navController.navigate("linkReader/${encodeNavArg(nextUrl)}") }
+ onOpenLink = { nextUrl -> navController.navigate("linkReader/${encodeNavArg(nextUrl)}") },
+ onOpenBrowser = { browserUrl -> navController.navigate("browser/${encodeNavArg(browserUrl)}") }
)
}
composable(