Position persistence during orientation change (#64)

* Fixed PDF reading position restoration during orientation change

* Refactored navigation logic in `EpubReaderScreen` and `PaginatedReader` to improve position restoration and UI consistency.

- Renamed `isNavigatingToBookmark` to `isNavigatingToPosition` and updated the overlay UI to reflect general position navigation.
- Added an orientation change listener to restore the reading position in `VERTICAL_SCROLL` mode using the last known locator.
- Improved highlight navigation in `VERTICAL_SCROLL` and `PAGINATED` modes, including chunk injection logic for highlights and fallback pagination logic.
- Implemented an anchor locator mechanism in `PaginatedReader` to preserve the reading position during layout constraint changes (e.g., orientation or resizing).
This commit is contained in:
Aryan 2026-03-13 22:43:17 +05:30 committed by GitHub
parent 843a77d0ef
commit 74e2cec415
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 235 additions and 119 deletions

View file

@ -69,7 +69,9 @@ class MainActivity : ComponentActivity() {
}
}
handleIntent(intent)
if (savedInstanceState == null) {
handleIntent(intent)
}
lifecycleScope.launch {
platformFeaturesRepository.checkForUpdates(this@MainActivity, updateLauncher)