Skip to content

Commit 286dbb2

Browse files
authored
Merge pull request #442 from readium/v3
2 parents 56e88ca + b13bc52 commit 286dbb2

File tree

920 files changed

+48308
-28185
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

920 files changed

+48308
-28185
lines changed

.github/workflows/checks.yml

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ jobs:
1313
if: ${{ !github.event.pull_request.draft }}
1414
steps:
1515
- name: Checkout
16-
uses: actions/checkout@v2
17-
- name: Set up JDK 11
18-
uses: actions/setup-java@v2
16+
uses: actions/checkout@v3
17+
- name: Set up JDK 17
18+
uses: actions/setup-java@v3
1919
with:
20-
java-version: '11'
20+
java-version: '17'
2121
distribution: 'adopt'
2222
- name: Build
2323
run: ./gradlew clean build -x test -x ktlintMainSourceSetCheck
@@ -30,11 +30,11 @@ jobs:
3030
if: ${{ !github.event.pull_request.draft }}
3131
steps:
3232
- name: Checkout
33-
uses: actions/checkout@v2
34-
- name: Set up JDK 11
35-
uses: actions/setup-java@v2
33+
uses: actions/checkout@v3
34+
- name: Set up JDK 17
35+
uses: actions/setup-java@v3
3636
with:
37-
java-version: '11'
37+
java-version: '17'
3838
distribution: 'adopt'
3939
- name: Lint
4040
run: ./gradlew ktlintCheck
@@ -43,22 +43,29 @@ jobs:
4343
name: Lint JavaScript
4444
runs-on: macos-latest
4545
if: ${{ !github.event.pull_request.draft }}
46-
defaults:
47-
run:
48-
working-directory: readium/navigator
4946
env:
50-
scripts: ${{ 'src/main/assets/_scripts' }}
47+
scripts: ${{ 'readium/navigator/src/main/assets/_scripts' }}
5148
steps:
5249
- name: Checkout
53-
uses: actions/checkout@v2
50+
uses: actions/checkout@v3
51+
- name: Install pnpm
52+
uses: pnpm/action-setup@v2
53+
with:
54+
package_json_file: readium/navigator/src/main/assets/_scripts/package.json
55+
run_install: false
56+
- name: Setup cache
57+
uses: actions/setup-node@v3
58+
with:
59+
node-version: 20
60+
cache: 'pnpm'
61+
cache-dependency-path: readium/navigator/src/main/assets/_scripts/pnpm-lock.yaml
5462
- name: Install dependencies
55-
run: yarn --cwd "$scripts" install --frozen-lockfile
63+
run: pnpm --dir "$scripts" install --frozen-lockfile
5664
- name: Lint
57-
run: yarn --cwd "$scripts" run lint
65+
run: pnpm --dir "$scripts" run lint
5866
- name: Check formatting
59-
run: yarn --cwd "$scripts" run checkformat
60-
# FIXME: This suddenly stopped working even though the toolchain versions seem identical.
61-
# - name: Check if bundled scripts are up-to-date
62-
# run: |
63-
# make scripts
64-
# git diff --exit-code --name-only src/main/assets/readium/scripts/*.js
67+
run: pnpm --dir "$scripts" run checkformat
68+
- name: Check if bundled scripts are up-to-date
69+
run: |
70+
make scripts
71+
git diff --exit-code --name-only src/main/assets/readium/scripts/*.js

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
3131
- uses: actions/setup-java@v3
3232
with:
33-
java-version: 11
33+
java-version: 17
3434
distribution: 'adopt'
3535

3636
- name: Get current Readium version

.github/workflows/publish.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- name: Checkout
15-
uses: actions/checkout@v2
15+
uses: actions/checkout@v3
1616
with:
1717
ref: develop
18-
- name: Set up JDK 11
19-
uses: actions/setup-java@v2
18+
- name: Set up JDK 17
19+
uses: actions/setup-java@v3
2020
with:
2121
distribution: adopt
22-
java-version: 11
22+
java-version: 17
2323

2424
# Builds the release artifacts of the library
2525
- name: Release build

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ captures/
4848
.idea/libraries
4949
.idea/jarRepositories.xml
5050
.idea/misc.xml
51+
.idea/migrations.xml
5152
# Android Studio 3 in .gitignore file.
5253
.idea/caches
5354
.idea/modules.xml
@@ -82,4 +83,5 @@ lint/reports/
8283
docs/readium
8384
docs/index.md
8485
docs/package-list
85-
site/
86+
site/
87+
androidTestResultsUserPreferences.xml

.idea/kotlinc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CHANGELOG.md

Lines changed: 87 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,68 @@ All notable changes to this project will be documented in this file. Take a look
44

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

7-
<!-- ## [Unreleased] -->
7+
## [Unreleased]
8+
9+
: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.
10+
11+
### Added
12+
13+
#### Shared
14+
15+
* A new `Format` type was introduced to augment `MediaType` with more precise information about the format specifications of an `Asset`.
16+
* The `DownloadManager` interface handles HTTP downloads. Components like the `LcpService` rely on it for downloading publications. Readium v3 ships with two implementations:
17+
* `ForegroundDownloadManager` uses an `HttpClient` to download files while the app is running.
18+
* `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.
19+
* The default `ZipArchiveOpener` now supports streaming ZIP archives, which enables opening a packaged publication (e.g. EPUB or LCP protected audiobook):
20+
* served by a remote HTTP server,
21+
* accessed through an Android `ContentProvider`, such as the shared storage.
22+
23+
#### Navigator
24+
25+
* Support for keyboard events in the EPUB, PDF and image navigators. See `VisualNavigator.addInputListener()`.
26+
27+
#### LCP
28+
29+
* 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.
30+
* The hash of protected publications is now verified upon download.
31+
32+
### Changed
33+
34+
* :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).
35+
* 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
36+
37+
#### Shared
38+
39+
* :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).
40+
* `Link.href` and `Locator.href` are now respectively `Href` and `Url` objects. If you still need the string value, you can call `toString()`
41+
* `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.
42+
43+
#### Navigator
44+
45+
* 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.
46+
* The `onTap` and `onDrag` events of `VisualNavigator.Listener` have been deprecated. You can now use multiple implementations of `InputListener` with `VisualNavigator.addInputListener()`.
47+
48+
#### Streamer
49+
50+
* The `Streamer` object has been deprecated in favor of components with smaller responsibilities: `AssetRetriever` and `PublicationOpener`.
51+
52+
#### LCP
53+
54+
* `LcpService.acquirePublication()` is deprecated in favor of `LcpService.publicationRetriever()`, which provides greater flexibility thanks to the `DownloadManager`.
55+
* The way the host view of a `LcpDialogAuthentication` is retrieved was changed to support Android configuration changes.
56+
57+
### Deprecated
58+
59+
* Both the Fuel and Kovenant libraries have been completely removed from the toolkit. With that, several deprecated functions have also been removed.
60+
61+
#### Shared
62+
63+
* 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.
64+
65+
#### Navigator
66+
67+
* 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.
68+
869

970
## [2.4.0]
1071

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

49110
### Changed
50111

112+
* Readium resources are now prefixed with `readium_`. Take care of updating any overridden resource by following [the migration guide](docs/migration-guide.md#300).
113+
* `Link` and `Locator`'s `href` are normalized as valid URLs to improve interoperability with the Readium Web toolkits.
114+
* **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.
115+
116+
#### Shared
117+
118+
* `Publication.localizedTitle` is nullable, as we cannot guarantee that all publication sources offer a title.
119+
* The `MediaType` sniffing helpers are deprecated in favor of `MediaTypeRetriever` (for media type and file extension hints and raw content) and `AssetRetriever` (for URLs).
120+
51121
#### Navigator
52122

53123
* `EpubNavigatorFragment.firstVisibleElementLocator()` now returns the first *block* element that is visible on the screen, even if it starts on previous pages.
54124
* This is used to make sure the user will not miss any context when restoring a TTS session in the middle of a resource.
125+
* The `VisualNavigator`'s drag and tap listener events are moved to a new `addInputListener()` API.
126+
* 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.
127+
128+
### Deprecated
129+
130+
#### Shared
131+
132+
* `DefaultHttClient.additionalHeaders` is deprecated. Set all the headers when creating a new `HttpRequest`, or modify outgoing requests in `DefaultHttpClient.Callback.onStartRequest()`.
133+
134+
#### Navigator
135+
136+
* All the navigator `Activity` are deprecated in favor of the `Fragment` variants.
137+
138+
#### Streamer
139+
140+
* The `Fetcher` interface was deprecated in favor of the `Container` one in `readium-shared`.
55141

56142
### Fixed
57143

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

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

66-
67152
## [2.3.0]
68153

69154
### Added

Makefile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ format:
1717

1818
.PHONY: scripts
1919
scripts:
20-
yarn --cwd "$(SCRIPTS_PATH)" install --frozen-lockfile
21-
yarn --cwd "$(SCRIPTS_PATH)" run format
22-
yarn --cwd "$(SCRIPTS_PATH)" run lint
23-
yarn --cwd "$(SCRIPTS_PATH)" run bundle
20+
@which corepack >/dev/null 2>&1 || (echo "ERROR: corepack is required, please install it first\nhttps://pnpm.io/installation#using-corepack"; exit 1)
21+
22+
cd $(SCRIPTS_PATH); \
23+
corepack install; \
24+
pnpm install --frozen-lockfile; \
25+
pnpm run format; \
26+
pnpm run lint; \
27+
pnpm run bundle

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,12 @@ A [Test App](test-app) demonstrates how to integrate the Readium Kotlin toolkit
1919

2020
## Minimum Requirements
2121

22-
| Readium | Android min SDK | Android compile SDK | Kotlin compiler | Gradle |
23-
|---------|-----------------|---------------------|-----------------|--------|
24-
| latest | 21 | 33 | 1.7.10 | 6.9.3 |
22+
| Readium | Android min SDK | Android compile SDK | Kotlin compiler (✻) | Gradle (✻) |
23+
|---------|-----------------|---------------------|---------------------|------------|
24+
| 3.0.0 | 21 | 34 | 1.9.22 | 8.2.0 |
25+
| 2.3.0 | 21 | 33 | 1.7.10 | 6.9.3 |
26+
27+
✻ Only required if you integrate Readium as a submodule instead of using Maven Central.
2528

2629
## Setting Up Readium
2730

build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ plugins {
1212
id("io.github.gradle-nexus.publish-plugin") apply true
1313
id("org.jetbrains.dokka") apply true
1414
id("org.jetbrains.kotlin.android") apply false
15+
id("com.google.devtools.ksp") apply false
1516
id("org.jlleitschuh.gradle.ktlint") apply true
1617
}
1718

docs/guides/index.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# User guides
2+
3+
* [Opening a publication](open-publication.md)
4+
* [Extracting the content of a publication](content.md)
5+
* [Supporting PDF documents](pdf.md)
6+
* [Configuring the Navigator](navigator-preferences.md)
7+
* [Font families in the EPUB navigator](epub-fonts.md)
8+
* [Media Navigator](media-navigator.md)
9+
* [Text-to-speech](tts.md)

0 commit comments

Comments
 (0)