Skip to content

3.0.0-alpha.1 #442

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 67 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
abf6b97
Refactor media API and add a new audio navigator (#345)
qnga Apr 11, 2023
522e884
Fix the hyphens setting (#347)
qnga Apr 14, 2023
c1c8df3
Add support for full remote publications (#337)
qnga Apr 20, 2023
85238fa
Fail with `HttpFetcher` when the server does not support byte ranges …
qnga Apr 20, 2023
64e5c04
Update documentation copyright year
mickael-menu May 19, 2023
1919591
Extract the `Media3Adapter` (#354)
mickael-menu Jun 7, 2023
1a2738c
HTML content iterator improvements (#356)
mickael-menu Jun 9, 2023
5f3c071
Fix regression parsing RWPM (#357)
mickael-menu Jun 14, 2023
f17ba63
Fix regression in `LcpDecryptor` (#362)
qnga Jul 5, 2023
686c42e
Merge branch 'develop' into v3
mickael-menu Jul 5, 2023
c55d286
Add user guides for TTS and Media Navigators (#358)
mickael-menu Jul 5, 2023
c868166
Support for keyboard events (#351)
riveram Jul 8, 2023
57bc32b
Various changes on media3-based navigators (#363)
qnga Jul 8, 2023
2d80205
Remove Fuel and Kovenant dependencies (#364)
stevenzeck Jul 14, 2023
6a489f7
Abstract the toolkit over publication source (#353)
qnga Jul 17, 2023
f911a2c
Various changes for v3 (#365)
qnga Jul 21, 2023
00039b9
Various changes for `v3` (#367)
mickael-menu Jul 26, 2023
0ce0163
Increase deprecation level on some methods (#369)
qnga Jul 26, 2023
ac9ff2b
Simplify media type handling in LCP acquisitions (#370)
qnga Jul 26, 2023
0cb5961
Updating dependencies, SDKs, Kotlin and Gradle (#368)
stevenzeck Jul 26, 2023
318971c
Various fixes and cleanup (#371)
stevenzeck Jul 28, 2023
a9e8b0d
More cleanup (#372)
stevenzeck Aug 2, 2023
1570e80
Replace the `Fetcher` by `Container` and refactor media type sniffing…
mickael-menu Aug 22, 2023
372120c
Move `Try` back into `util` package (#378)
mickael-menu Aug 22, 2023
8d06db3
Fix uses of MenuProvider (#379)
qnga Aug 22, 2023
f5cd4b9
Simplify RWPM parsing for packaged publications (#380)
mickael-menu Aug 23, 2023
4df93f7
Highlight images during text-to-speech (#382)
mickael-menu Aug 28, 2023
ef8d221
Bugfixes for TTS (#390)
mickael-menu Sep 15, 2023
f85d408
Add a download manager (#381)
qnga Sep 15, 2023
4f4fec1
Bugfixes for TTS (#391)
mickael-menu Sep 15, 2023
e09da40
Write licenses into ZIP through shared storage (#389)
qnga Sep 18, 2023
482ab0c
Refactor HREF normalization and models (#387)
mickael-menu Sep 21, 2023
4d7874a
Helper to migrate legacy HREFs (#399)
mickael-menu Oct 2, 2023
9580cdd
Fix various crashes (#401)
mickael-menu Oct 2, 2023
e66cf65
Prevent out of memory errors when sniffing a media type (#400)
mickael-menu Oct 2, 2023
4850dd3
Fix crash with `ChannelZipContainer` before API 26 (#403)
mickael-menu Oct 2, 2023
e4f1cc4
Fix configuration change crash with `PdfNavigatorFragment` (#398)
mickael-menu Oct 3, 2023
791bad2
Fix LcpDialogAuthentication + expose Publication.manifest (#392)
qnga Oct 3, 2023
8ce3359
Reorganize modules and packages (#404)
qnga Oct 3, 2023
2787bb5
Merge develop (#406)
qnga Oct 4, 2023
845a44c
Various media fixes + reorganisation (#407)
qnga Oct 4, 2023
8f66880
Fix race condition in the OPDS 2 parser (#410)
mickael-menu Oct 9, 2023
0a6848e
Support HTTP headers with multiple values (#411)
qnga Oct 12, 2023
7b0fb79
Switch to pnpm (#409)
qnga Oct 12, 2023
d8c3cd2
Relax rules when parsing a RWPM (#412)
mickael-menu Oct 12, 2023
31ee129
Attempt at fixing media3 bugs (#413)
qnga Oct 13, 2023
cdfe876
Various bugfixes (#405)
mickael-menu Oct 13, 2023
28b073e
Revisit navigator interfaces (#408)
qnga Oct 13, 2023
501081a
Make Lcp license API asynchronous (#414)
qnga Oct 24, 2023
3ce38c6
Fix crash in `CoroutineQueue` (#421)
mickael-menu Nov 20, 2023
6941ee9
Additional copy preventions for protected publications (#424)
mickael-menu Nov 28, 2023
c9a09ac
Refactor errors (#422)
qnga Dec 11, 2023
bfadfa8
Various changes including introducing Format (#427)
qnga Dec 21, 2023
b247622
Revamp format (#428)
qnga Jan 8, 2024
94463c7
Merge branch 'develop' into v3
mickael-menu Jan 8, 2024
2f04d5e
Simplify the `PublicationOpener` by adding a `DefaultPublicationParse…
mickael-menu Jan 9, 2024
1ba1223
Small changes for v3 and guide to open a publication (#432)
qnga Jan 9, 2024
09e338b
Merge `AssetOpener` and `AssetSniffer` public APIs into `AssetRetriev…
qnga Jan 10, 2024
97b9ec0
Check hash of LCP acquisitions (#439)
qnga Jan 12, 2024
3965b06
EPUB 2 meta tags should be superseded by EPUB 3 ones (#437)
qnga Jan 12, 2024
4bd2893
Fix import through intent (#438)
qnga Jan 12, 2024
5b718ad
Update the documentation for Readium 3.0.0-alpha.1 (#441)
mickael-menu Jan 15, 2024
54383a5
Update dependencies (#443)
mickael-menu Jan 15, 2024
cb9d2c0
Update dependencies (#445)
stevenzeck Jan 16, 2024
eb2f4e3
Minor media3 navigator fixes (#447)
qnga Jan 16, 2024
b0967f7
Display error details in the Test App (#444)
mickael-menu Jan 16, 2024
b13bc52
Minor fixes (#449)
mickael-menu Jan 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
49 changes: 28 additions & 21 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ jobs:
if: ${{ !github.event.pull_request.draft }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '11'
java-version: '17'
distribution: 'adopt'
- name: Build
run: ./gradlew clean build -x test -x ktlintMainSourceSetCheck
Expand All @@ -30,11 +30,11 @@ jobs:
if: ${{ !github.event.pull_request.draft }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '11'
java-version: '17'
distribution: 'adopt'
- name: Lint
run: ./gradlew ktlintCheck
Expand All @@ -43,22 +43,29 @@ jobs:
name: Lint JavaScript
runs-on: macos-latest
if: ${{ !github.event.pull_request.draft }}
defaults:
run:
working-directory: readium/navigator
env:
scripts: ${{ 'src/main/assets/_scripts' }}
scripts: ${{ 'readium/navigator/src/main/assets/_scripts' }}
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
package_json_file: readium/navigator/src/main/assets/_scripts/package.json
run_install: false
- name: Setup cache
uses: actions/setup-node@v3
with:
node-version: 20
cache: 'pnpm'
cache-dependency-path: readium/navigator/src/main/assets/_scripts/pnpm-lock.yaml
- name: Install dependencies
run: yarn --cwd "$scripts" install --frozen-lockfile
run: pnpm --dir "$scripts" install --frozen-lockfile
- name: Lint
run: yarn --cwd "$scripts" run lint
run: pnpm --dir "$scripts" run lint
- name: Check formatting
run: yarn --cwd "$scripts" run checkformat
# FIXME: This suddenly stopped working even though the toolchain versions seem identical.
# - name: Check if bundled scripts are up-to-date
# run: |
# make scripts
# git diff --exit-code --name-only src/main/assets/readium/scripts/*.js
run: pnpm --dir "$scripts" run checkformat
- name: Check if bundled scripts are up-to-date
run: |
make scripts
git diff --exit-code --name-only src/main/assets/readium/scripts/*.js
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:

- uses: actions/setup-java@v3
with:
java-version: 11
java-version: 17
distribution: 'adopt'

- name: Get current Readium version
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: develop
- name: Set up JDK 11
uses: actions/setup-java@v2
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: adopt
java-version: 11
java-version: 17

# Builds the release artifacts of the library
- name: Release build
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ captures/
.idea/libraries
.idea/jarRepositories.xml
.idea/misc.xml
.idea/migrations.xml
# Android Studio 3 in .gitignore file.
.idea/caches
.idea/modules.xml
Expand Down Expand Up @@ -82,4 +83,5 @@ lint/reports/
docs/readium
docs/index.md
docs/package-list
site/
site/
androidTestResultsUserPreferences.xml
2 changes: 1 addition & 1 deletion .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

89 changes: 87 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,68 @@ All notable changes to this project will be documented in this file. Take a look

**Warning:** Features marked as *experimental* may change or be removed in a future release without notice. Use with caution.

<!-- ## [Unreleased] -->
## [Unreleased]

:warning: Please consult [the migration guide](docs/migration-guide.md#300-alpha1) to assist you in handling the breaking changes in this latest major release.

### Added

#### Shared

* A new `Format` type was introduced to augment `MediaType` with more precise information about the format specifications of an `Asset`.
* The `DownloadManager` interface handles HTTP downloads. Components like the `LcpService` rely on it for downloading publications. Readium v3 ships with two implementations:
* `ForegroundDownloadManager` uses an `HttpClient` to download files while the app is running.
* `AndroidDownloadManager` is built upon [Android's `DownloadManager`](https://developer.android.com/reference/android/app/DownloadManager) to manage HTTP downloads, even when the application is closed. It allows for resuming downloads after losing connection.
* The default `ZipArchiveOpener` now supports streaming ZIP archives, which enables opening a packaged publication (e.g. EPUB or LCP protected audiobook):
* served by a remote HTTP server,
* accessed through an Android `ContentProvider`, such as the shared storage.

#### Navigator

* Support for keyboard events in the EPUB, PDF and image navigators. See `VisualNavigator.addInputListener()`.

#### LCP

* You can now stream an LCP protected publication using its LCP License Document. This is useful for example to read a large audiobook without downloading it on the device first.
* The hash of protected publications is now verified upon download.

### Changed

* :warning: To avoid conflicts when merging your app resources, all resources declared in the Readium toolkit now have the prefix `readium_`. This means that you must rename any layouts or strings you have overridden. Some resources were removed from the toolkit. Please consult [the migration guide](docs/migration-guide.md#300-alpha1).
* Most APIs now return an `Error` instance instead of an `Exception` in case of failure, as these objects are not thrown by the toolkit but returned as values

#### Shared

* :warning: To improve the interoperability with other Readium toolkits (in particular the Readium Web Toolkits, which only work in a streaming context) **Readium v3 now generates and expects valid URLs** for `Locator` and `Link`'s `href`. **You must migrate the HREFs or Locators stored in your database**, please consult [the migration guide](docs/migration-guide.md#300-alpha1).
* `Link.href` and `Locator.href` are now respectively `Href` and `Url` objects. If you still need the string value, you can call `toString()`
* `MediaType` no longer has static helpers for sniffing it from a file or URL. Instead, you can use an `AssetRetriever` to retrieve the format of a file.

#### Navigator

* Version 3 includes a new component called `DirectionalNavigationAdapter` that replaces `EdgeTapNavigation`. This helper enables users to navigate between pages using arrow and space keys on their keyboard or by tapping the edge of the screen.
* The `onTap` and `onDrag` events of `VisualNavigator.Listener` have been deprecated. You can now use multiple implementations of `InputListener` with `VisualNavigator.addInputListener()`.

#### Streamer

* The `Streamer` object has been deprecated in favor of components with smaller responsibilities: `AssetRetriever` and `PublicationOpener`.

#### LCP

* `LcpService.acquirePublication()` is deprecated in favor of `LcpService.publicationRetriever()`, which provides greater flexibility thanks to the `DownloadManager`.
* The way the host view of a `LcpDialogAuthentication` is retrieved was changed to support Android configuration changes.

### Deprecated

* Both the Fuel and Kovenant libraries have been completely removed from the toolkit. With that, several deprecated functions have also been removed.

#### Shared

* The `putPublication` and `getPublication` helpers in `Intent` are deprecated. Now, it is the application's responsibility to pass `Publication` objects between activities and reopen them when necessary.

#### Navigator

* EPUB external links are no longer handled by the navigator. You need to open the link in your own Web View or Chrome Custom Tab.


## [2.4.0]

Expand Down Expand Up @@ -48,10 +109,35 @@ All notable changes to this project will be documented in this file. Take a look

### Changed

* Readium resources are now prefixed with `readium_`. Take care of updating any overridden resource by following [the migration guide](docs/migration-guide.md#300).
* `Link` and `Locator`'s `href` are normalized as valid URLs to improve interoperability with the Readium Web toolkits.
* **You MUST migrate your database if you were persisting HREFs and Locators**. Take a look at [the migration guide](docs/migration-guide.md) for guidance.

#### Shared

* `Publication.localizedTitle` is nullable, as we cannot guarantee that all publication sources offer a title.
* The `MediaType` sniffing helpers are deprecated in favor of `MediaTypeRetriever` (for media type and file extension hints and raw content) and `AssetRetriever` (for URLs).

#### Navigator

* `EpubNavigatorFragment.firstVisibleElementLocator()` now returns the first *block* element that is visible on the screen, even if it starts on previous pages.
* This is used to make sure the user will not miss any context when restoring a TTS session in the middle of a resource.
* The `VisualNavigator`'s drag and tap listener events are moved to a new `addInputListener()` API.
* The new `DirectionalNavigationAdapter` component replaces `EdgeTapNavigation`, helping you turn pages with the arrow and space keyboard keys, or taps on the edge of the screen.

### Deprecated

#### Shared

* `DefaultHttClient.additionalHeaders` is deprecated. Set all the headers when creating a new `HttpRequest`, or modify outgoing requests in `DefaultHttpClient.Callback.onStartRequest()`.

#### Navigator

* All the navigator `Activity` are deprecated in favor of the `Fragment` variants.

#### Streamer

* The `Fetcher` interface was deprecated in favor of the `Container` one in `readium-shared`.

### Fixed

Expand All @@ -63,7 +149,6 @@ All notable changes to this project will be documented in this file. Take a look

* Fixed issue with the TTS starting from the beginning of the chapter instead of the current position.


## [2.3.0]

### Added
Expand Down
12 changes: 8 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ format:

.PHONY: scripts
scripts:
yarn --cwd "$(SCRIPTS_PATH)" install --frozen-lockfile
yarn --cwd "$(SCRIPTS_PATH)" run format
yarn --cwd "$(SCRIPTS_PATH)" run lint
yarn --cwd "$(SCRIPTS_PATH)" run bundle
@which corepack >/dev/null 2>&1 || (echo "ERROR: corepack is required, please install it first\nhttps://pnpm.io/installation#using-corepack"; exit 1)

cd $(SCRIPTS_PATH); \
corepack install; \
pnpm install --frozen-lockfile; \
pnpm run format; \
pnpm run lint; \
pnpm run bundle
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@ A [Test App](test-app) demonstrates how to integrate the Readium Kotlin toolkit

## Minimum Requirements

| Readium | Android min SDK | Android compile SDK | Kotlin compiler | Gradle |
|---------|-----------------|---------------------|-----------------|--------|
| latest | 21 | 33 | 1.7.10 | 6.9.3 |
| Readium | Android min SDK | Android compile SDK | Kotlin compiler (✻) | Gradle (✻) |
|---------|-----------------|---------------------|---------------------|------------|
| 3.0.0 | 21 | 34 | 1.9.22 | 8.2.0 |
| 2.3.0 | 21 | 33 | 1.7.10 | 6.9.3 |

✻ Only required if you integrate Readium as a submodule instead of using Maven Central.

## Setting Up Readium

Expand Down
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ plugins {
id("io.github.gradle-nexus.publish-plugin") apply true
id("org.jetbrains.dokka") apply true
id("org.jetbrains.kotlin.android") apply false
id("com.google.devtools.ksp") apply false
id("org.jlleitschuh.gradle.ktlint") apply true
}

Expand Down
9 changes: 9 additions & 0 deletions docs/guides/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# User guides

* [Opening a publication](open-publication.md)
* [Extracting the content of a publication](content.md)
* [Supporting PDF documents](pdf.md)
* [Configuring the Navigator](navigator-preferences.md)
* [Font families in the EPUB navigator](epub-fonts.md)
* [Media Navigator](media-navigator.md)
* [Text-to-speech](tts.md)
Loading