This repository has been archived by the owner on Jul 29, 2022. It is now read-only.
Releases: readium/r2-navigator-kotlin
Releases · readium/r2-navigator-kotlin
2.1.0
Take a look at the migration guide
Added
- The EPUB navigator is now able to navigate to a
Locator
using itstext
context. This is useful for search results or highlights missing precise locations. - Get or clear the current user selection of the navigators implementing
SelectableNavigator
. - (alpha) Support for the Decorator API to draw user interface elements over a publication's content.
- This can be used to render highlights over a text selection, for example.
- For now, only the EPUB navigator implements
DecorableNavigator
, for reflowable publications. You can implement custom decoration styles withHtmlDecorationTemplate
.
- Customize the EPUB selection context menu by providing a custom
ActionMode.Callback
implementation withEpubNavigatorFragment.Configuration.selectionActionModeCallback
.- This is an alternative to overriding
Activity.onActionModeStarted()
which does not seem to work anymore with Android 12.
- This is an alternative to overriding
- (alpha) A new audiobook navigator based on Android's
MediaSession
.- It supports out-of-the-box media style notifications and background playback.
- ExoPlayer is used by default for the actual playback, but you can use a custom player by implementing
MediaPlayer
.
Changed
- Upgraded to Kotlin 1.5.31 and Gradle 7.1.1
- The order of precedence of
Locator
locations in the reflowable EPUB navigator is:text
, HTML ID, thenprogression
. The navigator will now fallback on less precise locations in case of failure.
Fixed
- When restoring a
Locator
, The PDF navigator now falls back onlocations.position
if thepage=
fragment identifier is missing.
2.0.0
Take a look at the migration guide
Fixed
- Scrolling to an EPUB ID (e.g. from the table of contents) when the target spans several screens.
2.0.0-beta.2
Take a look at the migration guide
Changed
R2EpubActivity
andR2AudiobookActivity
require a newbaseUrl
Intent
extra. You need to set it to the base URL returned byServer.addPublication()
from the Streamer.
Fixed
- #217 Interactive HTML elements are not bypassed anymore when handling touch gestures.
- Scripts using
preventDefault()
are now taken into account and do not trigger a tap event anymore.
- Scripts using
- #150 External links are opened in a Chrome Custom Tab instead of the navigator's web view.
- #52 Memory leak in EPUB web views. This fixes ongoing media playback when closing an EPUB.
2.0.0-beta.1
Take a look at the migration guide
Added
- Support for display cutouts (screen notches).
- IMPORTANT: You need to remove any
setPadding()
statement from your app inUserSettings.kt
, if you copied it from the test app. - If you embed a navigator fragment (e.g.
EpubNavigatorFragment
) yourself, you need to opt-in by specifying thelayoutInDisplayCutoutMode
of the hostActivity
. R2EpubActivity
andR2CbzActivity
automatically applyLAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES
to their window'slayoutInDisplayCutoutMode
.PdfNavigatorFragment
is not yet compatible with display cutouts, because of limitations from the underlying PDF viewer.
- IMPORTANT: You need to remove any
- Customize EPUB vertical padding by overriding the
r2.navigator.epub.vertical_padding
dimension.- Follow Android's convention for alternative resources to specify different paddings for landscape (
values-land
) or large screens.
- Follow Android's convention for alternative resources to specify different paddings for landscape (
Changed
- Upgraded to Kotlin 1.4.10.
- All
utils.js
functions were moved under areadium.
namespace. You will need to update your code if you were calling them manually.
2.0.0-alpha.2
Take a look at the migration guide
Added
- Support for the new
Publication
model using the Content Protection for DRM rights and the Fetcher for resource access. - (Experimental) New
Fragment
implementations as an alternative to the legacyActivity
ones (contributed by @johanpoirier).- The fragments are chromeless, to let you customize the reading UX.
- To create the fragments use the matching factory such as
EpubNavigatorFragment.createFactory()
, as showcased inR2EpubActivity
. - At the moment, highlights and TTS are not yet supported in the new EPUB navigator
Fragment
. - This is now the recommended way to integrate Readium in your applications.
Changed
currentLocator
is now aStateFlow
instead ofLiveData
, to better support chromeless navigators such as an audiobook navigator.- If you were observing
currentLocator
in a UI context, you can continue to do so withcurrentLocator.asLiveData()
.
- If you were observing
- Improvements to the PDF navigator:
- The navigator doesn't require PDF publications to be served from an HTTP server anymore. A side effect is that the navigator is now able to open larger PDF files.
PdfNavigatorFragment.Listener::onResourceLoadFailed()
can be used to report fatal errors to the user, such as when trying to open a PDF document that is too large for the available memory.- A dedicated
PdfNavigatorFragment.createFactory()
was added, which deprecates the use ofNavigatorFragmentFactory
.
Fixed
- Prevent switching to the next resource by mistake when scrolling through an EPUB resource in scroll mode.
2.0.0-alpha.1
Added
- The position is now reported in the locators for EPUB, CBZ and PDF.
- (Experimental) PDF navigator.
- Supports both single PDF and LCP protected PDF.
- As a proof of concept, it is implemented using
Fragment
instead ofActivity
.R2PdfActivity
showcases how to use thePdfNavigatorFragment
with the newNavigatorFragmentFactory
. - The navigator is based on AndroidPdfViewer, which may increase the size of your apps. Please open an issue if this is a problem for you, as we are considering different solutions to fix this in a future release.
Changed
- Upgraded to Readium CSS 1.0.0-beta.1.
- Two new fonts are available: AccessibleDfa and IA Writer Duospace.
- The file structure now follows strictly the one from ReadiumCSS's
dist/
, for easy upgrades and custom builds replacement.
Deprecated
Navigator.currentLocation
andNavigatorDelegate.locationDidChange()
are deprecated in favor of a unifiedNavigator.currentLocator
, which is observable thanks toLiveData
.
Fixed
- Important: Publications parsed from large manifests could crash the application when starting a reading activity. To fix this,
Publication
must not be put in anIntent
extra anymore. Instead, use the newIntent
extensions provided by Readium. This solution is a crutch until we move away fromActivity
in the Navigator and let reading apps handle the lifecycle ofPublication
themselves. - Crash when opening a publication with a space in its filename.
- Jumping to an EPUB location from the search.
- The
AndroidManifest.xml
is not forcing anymoreallowBackup
andsupportsRtl
, to let reading apps manage these features themselves (contributed by @twaddington).
1.1.6: Merge pull request #111 from readium/fixes/seach-locators
fixes current locator issue after search
1.1.5: Merge pull request #110 from readium/develop
1.1.4: Merge pull request #108 from readium/fixes/debug
wrap timber logs to only show in debug builds and source formatting
1.1.3
r2 dependency updates