All notable changes to this project will be documented in this file.
Warning: Features marked as alpha may change or be removed in a future release without notice. Use with caution.
- 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
.
- 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.
- When restoring a
Locator
, The PDF navigator now falls back onlocations.position
if thepage=
fragment identifier is missing.
- Scrolling to an EPUB ID (e.g. from the table of contents) when the target spans several screens.
R2EpubActivity
andR2AudiobookActivity
require a newbaseUrl
Intent
extra. You need to set it to the base URL returned byServer.addPublication()
from the Streamer.
- #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.
- 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 (
- 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.
- EPUBs declaring multiple languages were laid out from right to left if the first language had an RTL reading
progression. Now if no reading progression is set, the
effectiveReadingProgression
will be LTR. - #152 Panning through a zoomed-in fixed layout EPUB (contributed by @johanpoirier).
- #146 Various reflowable EPUB columns shift issues.
- Restoring the last EPUB location after configuration changes (e.g. screen rotation).
- Edge taps to turn pages when the app runs in a multi-windows environment.
- Support for the new
Publication
model using the Content Protection for DRM rights and the Fetcher for resource access. - (alpha) 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.
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
.
- Prevent switching to the next resource by mistake when scrolling through an EPUB resource in scroll mode.
- The position is now reported in the locators for EPUB, CBZ and PDF.
- (alpha) 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.
- 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.
Navigator.currentLocation
andNavigatorDelegate.locationDidChange()
are deprecated in favor of a unifiedNavigator.currentLocator
, which is observable thanks toLiveData
.
- 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).