diff options
Diffstat (limited to 'app/src/main/java/org/terst/feedreader/ui')
| -rw-r--r-- | app/src/main/java/org/terst/feedreader/ui/BrowserScreen.kt | 18 | ||||
| -rw-r--r-- | app/src/main/java/org/terst/feedreader/ui/ReaderScreen.kt | 21 |
2 files changed, 16 insertions, 23 deletions
diff --git a/app/src/main/java/org/terst/feedreader/ui/BrowserScreen.kt b/app/src/main/java/org/terst/feedreader/ui/BrowserScreen.kt index 6202016..6eb5b71 100644 --- a/app/src/main/java/org/terst/feedreader/ui/BrowserScreen.kt +++ b/app/src/main/java/org/terst/feedreader/ui/BrowserScreen.kt @@ -50,21 +50,21 @@ fun BrowserScreen(startUrl: String, onBack: () -> Unit) { var title by remember(startUrl) { mutableStateOf<String?>(null) } var webViewRef by remember(startUrl) { mutableStateOf<WebView?>(null) } - BackHandler { - val wv = webViewRef - if (wv != null && wv.canGoBack()) wv.goBack() else onBack() - } + // Deliberately NOT "goBack() if the WebView has history, else exit" -- that means + // however many pages deep a search/login session went (search results -> article -> + // another link -> ...), leaving requires tapping back that many times first. Reported + // live as not making sense for this kind of multi-page browsing. Back always just + // closes the screen now, both the system gesture and the in-app arrow; there's no + // separate in-page-back affordance, matching how every other screen in this app behaves. + BackHandler(onBack = onBack) Scaffold( topBar = { TopAppBar( title = { Text(title ?: "Browser", maxLines = 1, overflow = TextOverflow.Ellipsis) }, navigationIcon = { - IconButton(onClick = { - val wv = webViewRef - if (wv != null && wv.canGoBack()) wv.goBack() else onBack() - }) { - Icon(Icons.Default.ArrowBack, contentDescription = "Back") + IconButton(onClick = onBack) { + Icon(Icons.Default.ArrowBack, contentDescription = "Close browser") } }, actions = { 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 806926c..82cb792 100644 --- a/app/src/main/java/org/terst/feedreader/ui/ReaderScreen.kt +++ b/app/src/main/java/org/terst/feedreader/ui/ReaderScreen.kt @@ -105,20 +105,13 @@ fun ReaderScreen( val scope = rememberCoroutineScope() val swipeThresholdPx = with(LocalDensity.current) { 80.dp.toPx() } - // HorizontalPager's own full-surface drag detection was grabbing 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. - // detectHorizontalDragGestures has its own orientation-aware touch-slop detection, so - // it already declines to engage for vertical-dominant movement -- confirmed live: a - // diagonal mid-screen scroll stays vertical, doesn't page-turn. (A generic, - // non-oriented detectDragGestures was tried for a stricter dx/dy ratio check and broke - // scrolling entirely: its slop detector claims the first bit of movement in ANY - // direction isotropically, before it knows which way the gesture is really going -- - // reported live as "the article view doesn't scroll at all anymore.") Also: page-turn - // commit is based on total drag distance, not where the gesture started, since an - // edge-anchored version collided with Android's own edge-swipe-back gesture (confirmed - // live: an edge swipe triggered system back, not the pager). + // Tried moving swipe detection to a passive native OnTouchListener on the WebView + // (always returns false, never consumes) to get Compose's gesture arbitration + // completely out of the touch path, on the theory that it was the source of reported + // scroll jerkiness. Reverted: swipe-to-next-article stopped working at all with that + // approach (confirmed live), which is a worse regression than unproven jerkiness. + // Back to the known-working Compose detector -- orientation-aware touch-slop + // detection, so it doesn't grab vertical-dominant drags, confirmed live repeatedly. Box( modifier = Modifier .fillMaxSize() |
