This repository has been archived by the owner on Jul 29, 2022. It is now read-only.
Releases: readium/r2-shared-kotlin
Releases · readium/r2-shared-kotlin
2.1.0
Take a look at the migration guide
Added
- (alpha) A new Publication
SearchService
to search through the resources' content, with a default implementationStringSearchService
. ContentProtection.Scheme
can be used to identify protection technologies using unique URI identifiers.Link
objects from archive-based publication assets (e.g. an EPUB/ZIP) have additional properties for entry metadata."properties" { "archive": { "entryLength": 8273, "isEntryCompressed": true } }
Changed
- Upgraded to Kotlin 1.5.31 and Gradle 7.1.1
Fixed
- Crash with
HttpRequest.setPostForm()
on Android 6. - HREF normalization when a resource path contains special characters.
2.0.0
Take a look at the migration guide
Added
HttpFetcher
is a new publication fetcher able to serve remote resources through HTTP.- The actual HTTP requests are performed with an instance of
HttpClient
.
- The actual HTTP requests are performed with an instance of
HttpClient
is a new protocol exposing a high level API to perform HTTP requests.DefaultHttpClient
is an implementation ofHttpClient
using standardHttpURLConnection
APIs. You can useDefaultHttpClient.Callback
to customize how requests are created and even recover from errors, e.g. to implement Authentication for OPDS.- You can provide your own implementation of
HttpClient
to Readium APIs if you prefer to use a third-party networking library.
2.0.0-beta.2
Take a look at the migration guide
Added
Publication.Service.Context
now holds a reference to the parentPublication
. This can be used to access other services from a givenPublication.Service
implementation.- The default
LocatorService
implementation can be used to get aLocator
from a global progression in the publication.publication.locateProgression(0.5)
Fixed
2.0.0-beta.1
Take a look at the migration guide
Added
PublicationAsset
is a new interface which can be used to open a publication from various medium, such as a file, a remote URL or a custom source.File
was replaced byFileAsset
, which implementsPublicationAsset
.
Changed
- Upgraded to Kotlin 1.4.10.
Format
got merged intoMediaType
, to simplify the media type APIs.- You can use
MediaType.of()
to sniff the type of a file or bytes.- All the
MediaType.of()
functions are now suspending to prevent deadlocks withrunBlocking
.
- All the
MediaType
has now optionalname
andfileExtension
properties.- Some publication formats can be represented by several media type aliases. Using
mediaType.canonicalMediaType()
will give you the canonical media type to use, for example when persisting the file type in a database. All Readium APIs are already returning canonical media types, so it only matters if you create aMediaType
yourself from its string representation.
- You can use
ContentLayout
is deprecated, usepublication.metadata.effectiveReadingProgression
to determine the reading progression of a publication instead.
2.0.0-alpha.2
Take a look at the migration guide
Added
- The Publication Services API allows to extend a
Publication
with custom implementations of known services. This version ships with a few predefined services:PositionsService
provides a list of discrete locations in the publication, no matter what the original format is.CoverService
provides an easy access to a bitmap version of the publication cover.
- The Composite Fetcher API can be used to extend the way publication resources are accessed.
- Support for exploded directories for any archive-based publication format.
- Content Protection handles DRM and other format-specific protections in a more systematic way.
- LCP now ships an
LcpContentProtection
implementation to be plugged into theStreamer
. - You can add custom
ContentProtection
implementations to support other DRMs by providing an instance to theStreamer
.
- LCP now ships an
Changed
- The
Publication
andContainer
types were merged together to offer a single interface to a publication's resources.- Use
publication.get()
to read the content of a resource, such as the cover. It will automatically be decrypted if aContentProtection
was attached to thePublication
.
- Use
Fixed
OutOfMemoryError
occuring while opening large publications are now caught to prevent crashes. They are reported asResource.Exception.OutOfMemory
.- Readium can now open PDF documents of any size without crashing. However, LCP protected PDFs are still limited by the available memory.
2.0.0-alpha.1
Added
- Support for Positions List, which provides a list of discrete locations in a publication and can be used to implement an approximation of page numbers.
- Get the visible position from the current
Locator
withlocations.position
. - The total number of positions can be retrieved with
publication.positions().size
. It is a suspending function because computing positions the first time can be expensive.
- Get the visible position from the current
- The new Format API simplifies the detection of file formats, including known publication formats such as EPUB and PDF.
- A format can be "sniffed" from files, raw bytes or even HTTP responses.
- Reading apps are welcome to extend the API with custom formats.
- Using
Link.mediaType?.matches()
is now recommended to safely check the type of a resource. - More details about the Kotlin implementation can be found in the pull request.
- In
Publication
shared models:- Support for the Presentation Hints extension.
- Support for OPDS holds, copies and availability in
Link
, for library-specific features. - Readium Web Publication Manifest extensibility is now supported for
Publication
,Metadata
, link'sProperties
and locator'sLocations
, which means that you are now able to access custom JSON properties in a manifest by creating Kotlin extensions on the shared models.
Changed
- The
Publication
shared models underwent an important refactoring and some of these changes are breaking. Please refer to the migration guide to update your codebase.- All the models are now immutable data classes, to improve code safety. This should not impact reading apps unless you created
Publication
or other models yourself. - A few types and enums were renamed to follow the Google Android Style coding convention better. Just follow deprecation warnings to update your codebase.
- All the models are now immutable data classes, to improve code safety. This should not impact reading apps unless you created
Deprecated
R2SyntheticPageList
was replaced by the aforementioned Positions List and can be safely removed from your codebase.
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. - The local HTTP server was broken when provided with publication filenames containing invalid characters.
- XML namespace prefixes are now properly supported when an author chooses unusual ones (contributed by @qnga).
- 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 #84 from readium/develop
updated gradle wrapper
1.1.5: Merge pull request #82 from readium/fixes/debug
source formatting
1.1.4: Revert "use random uuid if no identifier can be found"
This reverts commit 4885423a11ad0c84179361230f9d8b8a7a4aa24a.
1.1.3: Merge pull request #73 from readium/feature/DiViNa
Feature: DiViNa