=
9 | mutableMapOf()
10 |
11 | fun saveLocator(url: AbsoluteUrl, locator: Locator) {
12 | savedLocators[url] = locator
13 | }
14 |
15 | fun getLocator(url: AbsoluteUrl): Locator? {
16 | return savedLocators[url]
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/readium/navigators/demo/src/main/java/org/readium/navigator/demo/preferences/PreferencesManager.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2024 Readium Foundation. All rights reserved.
3 | * Use of this source code is governed by the BSD-style license
4 | * available in the top-level LICENSE file of the project.
5 | */
6 |
7 | package org.readium.navigator.demo.preferences
8 |
9 | import kotlinx.coroutines.flow.MutableStateFlow
10 | import org.readium.r2.navigator.preferences.Configurable
11 |
12 | /**
13 | * Trivial user preferences manager. You can add persistence.
14 | */
15 | class PreferencesManager>(
16 | initialPreferences: P
17 | ) {
18 | private val preferencesMutable: MutableStateFlow
=
19 | MutableStateFlow(initialPreferences)
20 |
21 | fun setPreferences(preferences: P) {
22 | preferencesMutable.value = preferences
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/readium/navigators/demo/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/readium/navigators/demo/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/readium/navigators/demo/src/main/res/mipmap-hdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/readium/kotlin-toolkit/38b1a810235409967b9c9bacea1516aabc344699/readium/navigators/demo/src/main/res/mipmap-hdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/readium/navigators/demo/src/main/res/mipmap-hdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/readium/kotlin-toolkit/38b1a810235409967b9c9bacea1516aabc344699/readium/navigators/demo/src/main/res/mipmap-hdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/readium/navigators/demo/src/main/res/mipmap-mdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/readium/kotlin-toolkit/38b1a810235409967b9c9bacea1516aabc344699/readium/navigators/demo/src/main/res/mipmap-mdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/readium/navigators/demo/src/main/res/mipmap-mdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/readium/kotlin-toolkit/38b1a810235409967b9c9bacea1516aabc344699/readium/navigators/demo/src/main/res/mipmap-mdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/readium/navigators/demo/src/main/res/mipmap-xhdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/readium/kotlin-toolkit/38b1a810235409967b9c9bacea1516aabc344699/readium/navigators/demo/src/main/res/mipmap-xhdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/readium/navigators/demo/src/main/res/mipmap-xhdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/readium/kotlin-toolkit/38b1a810235409967b9c9bacea1516aabc344699/readium/navigators/demo/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/readium/navigators/demo/src/main/res/mipmap-xxhdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/readium/kotlin-toolkit/38b1a810235409967b9c9bacea1516aabc344699/readium/navigators/demo/src/main/res/mipmap-xxhdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/readium/navigators/demo/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/readium/kotlin-toolkit/38b1a810235409967b9c9bacea1516aabc344699/readium/navigators/demo/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/readium/navigators/demo/src/main/res/mipmap-xxxhdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/readium/kotlin-toolkit/38b1a810235409967b9c9bacea1516aabc344699/readium/navigators/demo/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/readium/navigators/demo/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/readium/kotlin-toolkit/38b1a810235409967b9c9bacea1516aabc344699/readium/navigators/demo/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/readium/navigators/demo/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/readium/navigators/demo/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Readium Navigator Demo
3 |
4 |
--------------------------------------------------------------------------------
/readium/navigators/demo/src/main/res/xml/network_security_config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | developer.android.com
5 | google.github.io
6 | android-developers.googleblog.com
7 | io.google
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/readium/navigators/media/audio/build.gradle.kts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2022 Readium Foundation. All rights reserved.
3 | * Use of this source code is governed by the BSD-style license
4 | * available in the top-level LICENSE file of the project.
5 | */
6 |
7 | plugins {
8 | id("readium.library-conventions")
9 | }
10 |
11 | android {
12 | namespace = "org.readium.navigators.media.audio"
13 |
14 | buildFeatures {
15 | viewBinding = true
16 | }
17 | }
18 |
19 | dependencies {
20 | api(project(":readium:navigators:media:readium-navigator-media-common"))
21 |
22 | implementation(libs.androidx.media3.common)
23 | implementation(libs.androidx.media3.session)
24 |
25 | implementation(libs.timber)
26 | implementation(libs.kotlinx.coroutines.android)
27 | }
28 |
--------------------------------------------------------------------------------
/readium/navigators/media/audio/gradle.properties:
--------------------------------------------------------------------------------
1 | pom.artifactId=readium-navigator-media-audio
2 |
--------------------------------------------------------------------------------
/readium/navigators/media/audio/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/readium/navigators/media/build.gradle.kts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2022 Readium Foundation. All rights reserved.
3 | * Use of this source code is governed by the BSD-style license
4 | * available in the top-level LICENSE file of the project.
5 | */
6 |
7 | plugins {
8 | id("readium.library-conventions")
9 | }
10 |
11 | android {
12 | namespace = "org.readium.navigator.media"
13 | }
14 |
15 | dependencies {
16 | api(project(":readium:navigators:media:readium-navigator-media-common"))
17 | api(project(":readium:navigators:media:readium-navigator-media-audio"))
18 | api(project(":readium:navigators:media:readium-navigator-media-tts"))
19 | }
20 |
--------------------------------------------------------------------------------
/readium/navigators/media/common/build.gradle.kts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2022 Readium Foundation. All rights reserved.
3 | * Use of this source code is governed by the BSD-style license
4 | * available in the top-level LICENSE file of the project.
5 | */
6 |
7 | plugins {
8 | id("readium.library-conventions")
9 | }
10 |
11 | android {
12 | namespace = "org.readium.navigators.media.common"
13 | }
14 |
15 | dependencies {
16 | api(project(":readium:readium-shared"))
17 | api(project(":readium:readium-navigator"))
18 |
19 | implementation(libs.androidx.media3.common)
20 | implementation(libs.timber)
21 | implementation(libs.kotlinx.coroutines.android)
22 | }
23 |
--------------------------------------------------------------------------------
/readium/navigators/media/common/gradle.properties:
--------------------------------------------------------------------------------
1 | pom.artifactId=readium-navigator-media-common
2 |
--------------------------------------------------------------------------------
/readium/navigators/media/common/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/readium/navigators/media/common/src/main/java/org/readium/navigator/media/common/DefaultMediaMetadataProvider.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2022 Readium Foundation. All rights reserved.
3 | * Use of this source code is governed by the BSD-style license
4 | * available in the top-level LICENSE file of the project.
5 | */
6 |
7 | package org.readium.navigator.media.common
8 |
9 | import android.net.Uri
10 | import org.readium.r2.shared.publication.Publication
11 |
12 | /**
13 | * Builds a [MediaMetadataFactory] which will use the given title, author and cover,
14 | * and fall back on what is in the publication.
15 | */
16 | public class DefaultMediaMetadataProvider(
17 | private val title: String? = null,
18 | private val author: String? = null,
19 | private val cover: Uri? = null,
20 | ) : MediaMetadataProvider {
21 |
22 | override fun createMetadataFactory(publication: Publication): MediaMetadataFactory {
23 | return DefaultMediaMetadataFactory(publication, title, author, cover)
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/readium/navigators/media/common/src/main/java/org/readium/navigator/media/common/Media3Adapter.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2022 Readium Foundation. All rights reserved.
3 | * Use of this source code is governed by the BSD-style license
4 | * available in the top-level LICENSE file of the project.
5 | */
6 |
7 | package org.readium.navigator.media.common
8 |
9 | import androidx.media3.common.Player
10 | import org.readium.r2.shared.ExperimentalReadiumApi
11 |
12 | /**
13 | * An object able to pass as a Jetpack media3 [Player].
14 | */
15 | @ExperimentalReadiumApi
16 | public interface Media3Adapter {
17 | public fun asMedia3Player(): Player
18 | }
19 |
--------------------------------------------------------------------------------
/readium/navigators/media/common/src/main/java/org/readium/navigator/media/common/MediaMetadataFactory.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2022 Readium Foundation. All rights reserved.
3 | * Use of this source code is governed by the BSD-style license
4 | * available in the top-level LICENSE file of the project.
5 | */
6 |
7 | package org.readium.navigator.media.common
8 |
9 | import androidx.media3.common.MediaMetadata
10 |
11 | /**
12 | * Factory for the [MediaMetadata] associated with the publication and its resources.
13 | *
14 | * The metadata are used for example in the media-style Android notification.
15 | */
16 | public interface MediaMetadataFactory {
17 |
18 | /**
19 | * Creates the [MediaMetadata] for the whole publication.
20 | */
21 | public suspend fun publicationMetadata(): MediaMetadata
22 |
23 | /**
24 | * Creates the [MediaMetadata] for the reading order resource at the given [index].
25 | */
26 | public suspend fun resourceMetadata(index: Int): MediaMetadata
27 | }
28 |
--------------------------------------------------------------------------------
/readium/navigators/media/common/src/main/java/org/readium/navigator/media/common/MediaMetadataProvider.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2022 Readium Foundation. All rights reserved.
3 | * Use of this source code is governed by the BSD-style license
4 | * available in the top-level LICENSE file of the project.
5 | */
6 |
7 | package org.readium.navigator.media.common
8 |
9 | import org.readium.r2.shared.publication.Publication
10 |
11 | /**
12 | * To be implemented to use a custom [MediaMetadataFactory].
13 | */
14 | public fun interface MediaMetadataProvider {
15 |
16 | public fun createMetadataFactory(publication: Publication): MediaMetadataFactory
17 | }
18 |
--------------------------------------------------------------------------------
/readium/navigators/media/gradle.properties:
--------------------------------------------------------------------------------
1 | pom.artifactId=readium-navigator-media
2 |
--------------------------------------------------------------------------------
/readium/navigators/media/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/readium/navigators/media/tts/build.gradle.kts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2022 Readium Foundation. All rights reserved.
3 | * Use of this source code is governed by the BSD-style license
4 | * available in the top-level LICENSE file of the project.
5 | */
6 |
7 | plugins {
8 | id("readium.library-conventions")
9 | alias(libs.plugins.kotlin.serialization)
10 | }
11 |
12 | android {
13 | namespace = "org.readium.navigators.media.tts"
14 | }
15 |
16 | dependencies {
17 | api(project(":readium:navigators:media:readium-navigator-media-common"))
18 |
19 | implementation(libs.androidx.media3.common)
20 | implementation(libs.androidx.media3.session)
21 |
22 | implementation(libs.timber)
23 | implementation(libs.kotlinx.coroutines.android)
24 | implementation(libs.kotlinx.serialization.json)
25 | }
26 |
--------------------------------------------------------------------------------
/readium/navigators/media/tts/gradle.properties:
--------------------------------------------------------------------------------
1 | pom.artifactId=readium-navigator-media-tts
2 |
--------------------------------------------------------------------------------
/readium/navigators/media/tts/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/readium/navigators/media/tts/src/main/java/org/readium/navigator/media/tts/android/AndroidTtsDefaults.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2022 Readium Foundation. All rights reserved.
3 | * Use of this source code is governed by the BSD-style license
4 | * available in the top-level LICENSE file of the project.
5 | */
6 |
7 | package org.readium.navigator.media.tts.android
8 |
9 | import org.readium.r2.shared.util.Language
10 |
11 | /**
12 | * Default values for the Android TTS engine.
13 | *
14 | * These values will be used as a last resort by [AndroidTtsSettingsResolver]
15 | * when no user preference takes precedence.
16 | *
17 | * @see AndroidTtsPreferences
18 | */
19 | public data class AndroidTtsDefaults(
20 | val language: Language? = null,
21 | val pitch: Double? = null,
22 | val speed: Double? = null,
23 | ) {
24 | init {
25 | require(pitch == null || pitch > 0)
26 | require(speed == null || speed > 0)
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/readium/navigators/media/tts/src/main/java/org/readium/navigator/media/tts/android/AndroidTtsPreferencesSerializer.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2022 Readium Foundation. All rights reserved.
3 | * Use of this source code is governed by the BSD-style license
4 | * available in the top-level LICENSE file of the project.
5 | */
6 |
7 | package org.readium.navigator.media.tts.android
8 |
9 | import kotlinx.serialization.json.Json
10 | import org.readium.r2.navigator.preferences.PreferencesSerializer
11 |
12 | /**
13 | * JSON serializer of [AndroidTtsPreferences].
14 | */
15 | public class AndroidTtsPreferencesSerializer : PreferencesSerializer {
16 |
17 | override fun serialize(preferences: AndroidTtsPreferences): String =
18 | Json.encodeToString(AndroidTtsPreferences.serializer(), preferences)
19 |
20 | override fun deserialize(preferences: String): AndroidTtsPreferences =
21 | Json.decodeFromString(AndroidTtsPreferences.serializer(), preferences)
22 | }
23 |
--------------------------------------------------------------------------------
/readium/navigators/media/tts/src/main/java/org/readium/navigator/media/tts/android/AndroidTtsSettings.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2022 Readium Foundation. All rights reserved.
3 | * Use of this source code is governed by the BSD-style license
4 | * available in the top-level LICENSE file of the project.
5 | */
6 |
7 | package org.readium.navigator.media.tts.android
8 |
9 | import org.readium.navigator.media.tts.TtsEngine
10 | import org.readium.r2.shared.ExperimentalReadiumApi
11 | import org.readium.r2.shared.util.Language
12 |
13 | /**
14 | * Settings values of the Android built-in TTS engine.
15 | *
16 | * @see AndroidTtsPreferences
17 | */
18 | @OptIn(ExperimentalReadiumApi::class)
19 | public data class AndroidTtsSettings(
20 | override val language: Language,
21 | override val overrideContentLanguage: Boolean,
22 | val pitch: Double,
23 | val speed: Double,
24 | val voices: Map,
25 | ) : TtsEngine.Settings
26 |
--------------------------------------------------------------------------------
/readium/navigators/web/build.gradle.kts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2022 Readium Foundation. All rights reserved.
3 | * Use of this source code is governed by the BSD-style license
4 | * available in the top-level LICENSE file of the project.
5 | */
6 |
7 | plugins {
8 | id("readium.library-conventions")
9 | alias(libs.plugins.kotlin.serialization)
10 | alias(libs.plugins.compose.compiler)
11 | }
12 |
13 | android {
14 | namespace = "org.readium.navigators.web"
15 |
16 | buildFeatures {
17 | compose = true
18 | }
19 | }
20 |
21 | dependencies {
22 | api(project(":readium:readium-shared"))
23 | api(project(":readium:readium-navigator"))
24 | api(project(":readium:navigators:readium-navigator-common"))
25 |
26 | implementation(libs.kotlinx.serialization.json)
27 | implementation(libs.bundles.compose)
28 | implementation(libs.timber)
29 | implementation(libs.kotlinx.coroutines.android)
30 | implementation(libs.androidx.webkit)
31 | implementation(libs.jsoup)
32 | }
33 |
--------------------------------------------------------------------------------
/readium/navigators/web/gradle.properties:
--------------------------------------------------------------------------------
1 | pom.artifactId=readium-navigator-web
2 |
--------------------------------------------------------------------------------
/readium/navigators/web/scripts/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "root": true,
3 | "parser": "@typescript-eslint/parser",
4 | "plugins": [
5 | "@typescript-eslint"
6 | ],
7 | "extends": [
8 | "eslint:recommended",
9 | "plugin:@typescript-eslint/eslint-recommended",
10 | "plugin:@typescript-eslint/recommended"
11 | ],
12 | "rules": {
13 | "@typescript-eslint/no-explicit-any": "off",
14 | "@typescript-eslint/no-namespace": "off"
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/readium/navigators/web/scripts/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 |
--------------------------------------------------------------------------------
/readium/navigators/web/scripts/.prettierignore:
--------------------------------------------------------------------------------
1 | src/vendor
2 |
--------------------------------------------------------------------------------
/readium/navigators/web/scripts/.prettierrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "semi": false
3 | }
4 |
--------------------------------------------------------------------------------
/readium/navigators/web/scripts/README.md:
--------------------------------------------------------------------------------
1 | # Readium JS (Kotlin)
2 |
3 | A set of JavaScript files used by the Kotlin EPUB navigator.
4 |
5 | This folder starts with an underscore to prevent Gradle from embedding it as an asset.
6 |
--------------------------------------------------------------------------------
/readium/navigators/web/scripts/babel.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "presets": ["@babel/preset-env"]
3 | }
4 |
--------------------------------------------------------------------------------
/readium/navigators/web/scripts/public/fixed-single-index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 | |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/readium/navigators/web/scripts/src/bridge/fixed-gestures-bridge.ts:
--------------------------------------------------------------------------------
1 | import { AreaManager } from "../fixed/area-manager"
2 |
3 | export interface GesturesBridge {
4 | onTap(event: string): void
5 | onLinkActivated(href: string, outerHtml: string): void
6 | }
7 |
8 | export interface TapEvent {
9 | x: number
10 | y: number
11 | }
12 |
13 | export class BridgeGesturesAdapter implements AreaManager.Listener {
14 | readonly nativeApi: GesturesBridge
15 |
16 | constructor(gesturesApi: GesturesBridge) {
17 | this.nativeApi = gesturesApi
18 | }
19 |
20 | onTap(event: TapEvent): void {
21 | this.nativeApi.onTap(JSON.stringify(event))
22 | }
23 |
24 | onLinkActivated(href: string, outerHtml: string): void {
25 | this.nativeApi.onLinkActivated(href, outerHtml)
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/readium/navigators/web/scripts/src/bridge/fixed-initialization-bridge.ts:
--------------------------------------------------------------------------------
1 | export interface InitializationBridge {
2 | onScriptsLoaded: () => void
3 | }
4 |
--------------------------------------------------------------------------------
/readium/navigators/web/scripts/src/common/events.ts:
--------------------------------------------------------------------------------
1 | export interface TapEvent {
2 | x: number
3 | y: number
4 | }
5 |
--------------------------------------------------------------------------------
/readium/navigators/web/scripts/src/common/types.ts:
--------------------------------------------------------------------------------
1 | export interface Size {
2 | width: number
3 | height: number
4 | }
5 |
6 | export interface Margins {
7 | top: number
8 | left: number
9 | bottom: number
10 | right: number
11 | }
12 |
13 | export interface Insets {
14 | top: number
15 | left: number
16 | bottom: number
17 | right: number
18 | }
19 |
--------------------------------------------------------------------------------
/readium/navigators/web/scripts/src/fixed/area-manager.ts:
--------------------------------------------------------------------------------
1 | import { TapEvent } from "../common/events"
2 |
3 | export namespace AreaManager {
4 | export interface Listener {
5 | onTap(event: TapEvent): void
6 | onLinkActivated(href: string, outerHtml: string): void
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/readium/navigators/web/scripts/src/fixed/iframe-message.ts:
--------------------------------------------------------------------------------
1 | import { Size } from "../common/types"
2 |
3 | export interface ContentSizeMessage {
4 | kind: "contentSize"
5 | size?: Size
6 | }
7 |
8 | export interface TapMessage {
9 | kind: "tap"
10 | x: number
11 | y: number
12 | }
13 |
14 | export interface LinkActivatedMessage {
15 | kind: "linkActivated"
16 | href: string
17 | outerHtml: string
18 | }
19 |
20 | export type IframeMessage =
21 | | ContentSizeMessage
22 | | TapMessage
23 | | LinkActivatedMessage
24 |
25 | export class IframeMessageSender {
26 | private messagePort: MessagePort
27 |
28 | constructor(messagePort: MessagePort) {
29 | this.messagePort = messagePort
30 | }
31 |
32 | send(message: IframeMessage) {
33 | this.messagePort.postMessage(message)
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/readium/navigators/web/scripts/src/util/fit.ts:
--------------------------------------------------------------------------------
1 | import { Size } from "../common/types"
2 |
3 | export const enum Fit {
4 | Contain = "contain",
5 | Width = "width",
6 | Height = "height",
7 | }
8 |
9 | export function computeScale(fit: Fit, content: Size, container: Size): number {
10 | switch (fit) {
11 | case Fit.Contain:
12 | return fitContain(content, container)
13 | case Fit.Width:
14 | return fitWidth(content, container)
15 | case Fit.Height:
16 | return fitHeight(content, container)
17 | }
18 | }
19 |
20 | function fitContain(content: Size, container: Size): number {
21 | const widthRatio = container.width / content.width
22 | const heightRatio = container.height / content.height
23 | return Math.min(widthRatio, heightRatio)
24 | }
25 |
26 | function fitWidth(content: Size, container: Size): number {
27 | return container.width / content.width
28 | }
29 |
30 | function fitHeight(content: Size, container: Size): number {
31 | return container.height / content.height
32 | }
33 |
--------------------------------------------------------------------------------
/readium/navigators/web/scripts/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "outDir": "./dist/",
4 | "noImplicitAny": true,
5 | "module": "es6",
6 | "target": "es6",
7 | "jsx": "react",
8 | "allowJs": true,
9 | "moduleResolution": "node",
10 | "strict": true
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/readium/navigators/web/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/readium/navigators/web/src/main/assets/readium/navigators/web/error.xhtml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/readium/navigators/web/src/main/assets/readium/navigators/web/fixed-single-index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 | |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/readium/navigators/web/src/main/assets/readium/navigators/web/prepaginated-single-index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 | |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/readium/navigators/web/src/main/java/org/readium/navigator/web/layout/ReadingOrder.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2024 Readium Foundation. All rights reserved.
3 | * Use of this source code is governed by the BSD-style license
4 | * available in the top-level LICENSE file of the project.
5 | */
6 |
7 | package org.readium.navigator.web.layout
8 |
9 | import org.readium.r2.shared.ExperimentalReadiumApi
10 | import org.readium.r2.shared.publication.presentation.Presentation
11 | import org.readium.r2.shared.util.Url
12 |
13 | @ExperimentalReadiumApi
14 | internal data class ReadingOrder(
15 | val items: List,
16 | ) {
17 |
18 | fun indexOfHref(href: Url): Int? = items
19 | .indexOfFirst { it.href == href }
20 | .takeUnless { it == -1 }
21 | }
22 |
23 | @ExperimentalReadiumApi
24 | internal data class ReadingOrderItem(
25 | val href: Url,
26 | val page: Presentation.Page?,
27 | )
28 |
--------------------------------------------------------------------------------
/readium/navigators/web/src/main/java/org/readium/navigator/web/pager/LoggingTargetedFlingBehavior.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2024 Readium Foundation. All rights reserved.
3 | * Use of this source code is governed by the BSD-style license
4 | * available in the top-level LICENSE file of the project.
5 | */
6 |
7 | package org.readium.navigator.web.pager
8 |
9 | import androidx.compose.foundation.gestures.ScrollScope
10 | import androidx.compose.foundation.gestures.TargetedFlingBehavior
11 | import timber.log.Timber
12 |
13 | internal class LoggingTargetedFlingBehavior(
14 | private val delegate: TargetedFlingBehavior,
15 | ) : TargetedFlingBehavior {
16 |
17 | override suspend fun ScrollScope.performFling(
18 | initialVelocity: Float,
19 | onRemainingDistanceUpdated: (Float) -> Unit,
20 | ): Float {
21 | Timber.d("performFling $initialVelocity")
22 | return with(delegate) {
23 | performFling(initialVelocity, onRemainingDistanceUpdated)
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/readium/navigators/web/src/main/java/org/readium/navigator/web/preferences/FixedWebDefaults.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2024 Readium Foundation. All rights reserved.
3 | * Use of this source code is governed by the BSD-style license
4 | * available in the top-level LICENSE file of the project.
5 | */
6 |
7 | package org.readium.navigator.web.preferences
8 |
9 | import org.readium.r2.navigator.preferences.Fit
10 | import org.readium.r2.navigator.preferences.ReadingProgression
11 | import org.readium.r2.shared.ExperimentalReadiumApi
12 |
13 | @ExperimentalReadiumApi
14 | public data class FixedWebDefaults(
15 | val fit: Fit? = null,
16 | val readingProgression: ReadingProgression? = null,
17 | val spreads: Boolean? = null,
18 | )
19 |
--------------------------------------------------------------------------------
/readium/navigators/web/src/main/java/org/readium/navigator/web/preferences/FixedWebSettings.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2024 Readium Foundation. All rights reserved.
3 | * Use of this source code is governed by the BSD-style license
4 | * available in the top-level LICENSE file of the project.
5 | */
6 |
7 | package org.readium.navigator.web.preferences
8 |
9 | import org.readium.r2.navigator.preferences.Configurable
10 | import org.readium.r2.navigator.preferences.Fit
11 | import org.readium.r2.navigator.preferences.ReadingProgression
12 | import org.readium.r2.shared.ExperimentalReadiumApi
13 |
14 | @ExperimentalReadiumApi
15 | public data class FixedWebSettings(
16 | val fit: Fit,
17 | val readingProgression: ReadingProgression,
18 | val spreads: Boolean,
19 | ) : Configurable.Settings
20 |
--------------------------------------------------------------------------------
/readium/navigators/web/src/main/java/org/readium/navigator/web/util/DisplayArea.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2024 Readium Foundation. All rights reserved.
3 | * Use of this source code is governed by the BSD-style license
4 | * available in the top-level LICENSE file of the project.
5 | */
6 |
7 | package org.readium.navigator.web.util
8 |
9 | import androidx.compose.ui.unit.Dp
10 | import androidx.compose.ui.unit.DpSize
11 |
12 | internal data class DisplayArea(
13 | val viewportSize: DpSize,
14 | val safeDrawingPadding: AbsolutePaddingValues,
15 | )
16 |
17 | internal data class AbsolutePaddingValues(
18 | val top: Dp,
19 | val right: Dp,
20 | val bottom: Dp,
21 | val left: Dp,
22 | )
23 |
--------------------------------------------------------------------------------
/readium/navigators/web/src/main/java/org/readium/navigator/web/util/WebViewClient.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2024 Readium Foundation. All rights reserved.
3 | * Use of this source code is governed by the BSD-style license
4 | * available in the top-level LICENSE file of the project.
5 | */
6 |
7 | package org.readium.navigator.web.util
8 |
9 | import android.webkit.WebResourceRequest
10 | import android.webkit.WebResourceResponse
11 | import android.webkit.WebView
12 |
13 | internal class WebViewClient(
14 | private val webViewServer: WebViewServer,
15 | ) : android.webkit.WebViewClient() {
16 |
17 | override fun shouldInterceptRequest(
18 | view: WebView,
19 | request: WebResourceRequest,
20 | ): WebResourceResponse? {
21 | return webViewServer.shouldInterceptRequest(request)
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/readium/navigators/web/src/main/java/org/readium/navigator/web/webapi/InitializationApi.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2024 Readium Foundation. All rights reserved.
3 | * Use of this source code is governed by the BSD-style license
4 | * available in the top-level LICENSE file of the project.
5 | */
6 |
7 | package org.readium.navigator.web.webapi
8 |
9 | import android.webkit.JavascriptInterface
10 | import android.webkit.WebView
11 |
12 | internal class InitializationApi(
13 | private val onScriptsLoadedDelegate: () -> Unit,
14 | ) {
15 |
16 | fun registerOnWebView(webView: WebView) {
17 | webView.addJavascriptInterface(this, "initialization")
18 | }
19 |
20 | @JavascriptInterface
21 | fun onScriptsLoaded() {
22 | onScriptsLoadedDelegate.invoke()
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/readium/opds/README.md:
--------------------------------------------------------------------------------
1 | # Readium OPDS
2 |
3 | A parser for OPDS 1.x and 2.0 written in Kotlin using the [Readium Web Publication Manifest](https://github.com/readium/webpub-manifest).
4 |
5 | ## Features
6 |
7 | - [x] Abstract model
8 | - [x] OPDS 1.x support
9 | - [x] OPDS 2.0 support
10 | - [ ] Search
11 | - [x] Full entries
12 | - [x] Facets
13 | - [x] Groups
14 | - [x] Indirect acquisition
15 | - [ ] Library specific extensions
16 |
--------------------------------------------------------------------------------
/readium/opds/build.gradle.kts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018 Readium Foundation. All rights reserved.
3 | * Use of this source code is governed by the BSD-style license
4 | * available in the top-level LICENSE file of the project.
5 | */
6 |
7 | plugins {
8 | id("readium.library-conventions")
9 | }
10 |
11 | android {
12 | namespace = "org.readium.r2.opds"
13 | }
14 |
15 | dependencies {
16 | api(project(":readium:readium-shared"))
17 |
18 | implementation(libs.timber)
19 | implementation(libs.kotlinx.coroutines.android)
20 |
21 | // Tests
22 | testImplementation(libs.junit)
23 | testImplementation(libs.robolectric)
24 | }
25 |
--------------------------------------------------------------------------------
/readium/opds/gradle.properties:
--------------------------------------------------------------------------------
1 | pom.artifactId=readium-opds
2 |
--------------------------------------------------------------------------------
/readium/opds/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/readium/opds/src/test/resources/robolectric.properties:
--------------------------------------------------------------------------------
1 | sdk=30
2 |
--------------------------------------------------------------------------------
/readium/shared/gradle.properties:
--------------------------------------------------------------------------------
1 | pom.artifactId=readium-shared
2 |
--------------------------------------------------------------------------------
/readium/shared/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/readium/shared/src/main/java/org/readium/r2/shared/JSONable.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Module: r2-shared-kotlin
3 | * Developers: Aferdita Muriqi, Clément Baumann, Mickaël Menu
4 | *
5 | * Copyright (c) 2020. Readium Foundation. All rights reserved.
6 | * Use of this source code is governed by a BSD-style license which is detailed in the
7 | * LICENSE file present in the project repository where this source code is maintained.
8 | */
9 |
10 | package org.readium.r2.shared
11 |
12 | import org.json.JSONArray
13 | import org.json.JSONObject
14 |
15 | public interface JSONable {
16 |
17 | /**
18 | * Serializes the object to its JSON representation.
19 | */
20 | public fun toJSON(): JSONObject
21 | }
22 |
23 | /**
24 | * Serializes a list of [JSONable] into a [JSONArray].
25 | */
26 | public fun List.toJSON(): JSONArray =
27 | JSONArray(map(JSONable::toJSON))
28 |
--------------------------------------------------------------------------------
/readium/shared/src/main/java/org/readium/r2/shared/extensions/ContentResolver.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Module: r2-shared-kotlin
3 | * Developers: Mickaël Menu
4 | *
5 | * Copyright (c) 2020. Readium Foundation. All rights reserved.
6 | * Use of this source code is governed by a BSD-style license which is detailed in the
7 | * LICENSE file present in the project repository where this source code is maintained.
8 | */
9 |
10 | @file:OptIn(InternalReadiumApi::class)
11 |
12 | package org.readium.r2.shared.extensions
13 |
14 | import android.content.ContentResolver
15 | import android.net.Uri
16 | import org.readium.r2.shared.InternalReadiumApi
17 |
18 | internal fun ContentResolver.queryProjection(uri: Uri, projection: String): String? =
19 | tryOrLog {
20 | query(uri, arrayOf(projection), null, null, null)?.use { cursor ->
21 | if (cursor.moveToFirst()) {
22 | return cursor.getString(0)
23 | }
24 | return null
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/readium/shared/src/main/java/org/readium/r2/shared/extensions/Float.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2022 Readium Foundation. All rights reserved.
3 | * Use of this source code is governed by the BSD-style license
4 | * available in the top-level LICENSE file of the project.
5 | */
6 |
7 | package org.readium.r2.shared.extensions
8 |
9 | import kotlin.math.abs
10 | import org.readium.r2.shared.InternalReadiumApi
11 |
12 | @InternalReadiumApi
13 | public fun Float.equalsDelta(other: Float, delta: Float = 0.001f): Boolean =
14 | this == other || abs(this - other) < delta
15 |
16 | @InternalReadiumApi
17 | public fun Double.equalsDelta(other: Double, delta: Double = 0.001): Boolean =
18 | this == other || abs(this - other) < delta
19 |
--------------------------------------------------------------------------------
/readium/shared/src/main/java/org/readium/r2/shared/extensions/Iterable.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2025 Readium Foundation. All rights reserved.
3 | * Use of this source code is governed by the BSD-style license
4 | * available in the top-level LICENSE file of the project.
5 | */
6 |
7 | package org.readium.r2.shared.extensions
8 |
9 | import kotlin.collections.Iterable
10 |
11 | internal fun Iterable.contains(predicate: (T) -> Boolean): Boolean =
12 | firstOrNull(predicate) != null
13 |
14 | internal fun Iterable.containsAny(vararg elements: T): Boolean {
15 | for (element in elements) {
16 | if (contains(element)) {
17 | return true
18 | }
19 | }
20 | return false
21 | }
22 |
--------------------------------------------------------------------------------
/readium/shared/src/main/java/org/readium/r2/shared/publication/Collection.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Module: r2-shared-kotlin
3 | * Developers: Mickaël Menu
4 | *
5 | * Copyright (c) 2020. Readium Foundation. All rights reserved.
6 | * Use of this source code is governed by a BSD-style license which is detailed in the
7 | * LICENSE file present in the project repository where this source code is maintained.
8 | */
9 |
10 | package org.readium.r2.shared.publication
11 |
12 | /**
13 | * Collection type used for collection/series metadata.
14 | * For convenience, the JSON schema reuse the Contributor's definition.
15 | */
16 | public typealias Collection = Contributor
17 |
--------------------------------------------------------------------------------
/readium/shared/src/main/java/org/readium/r2/shared/publication/encryption/Properties.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Module: r2-shared-kotlin
3 | * Developers: Aferdita Muriqi, Clément Baumann, Mickaël Menu
4 | *
5 | * Copyright (c) 2018. Readium Foundation. All rights reserved.
6 | * Use of this source code is governed by a BSD-style license which is detailed in the
7 | * LICENSE file present in the project repository where this source code is maintained.
8 | */
9 |
10 | package org.readium.r2.shared.publication.encryption
11 |
12 | import org.json.JSONObject
13 | import org.readium.r2.shared.publication.Properties
14 |
15 | // Encryption extensions for link [Properties].
16 |
17 | /**
18 | * Indicates that a resource is encrypted/obfuscated and provides relevant information for
19 | * decryption.
20 | */
21 | public val Properties.encryption: Encryption?
22 | get() = (this["encrypted"] as? Map<*, *>)
23 | ?.let { Encryption.fromJSON(JSONObject(it)) }
24 |
--------------------------------------------------------------------------------
/readium/shared/src/main/java/org/readium/r2/shared/publication/epub/Presentation.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Module: r2-shared-kotlin
3 | * Developers: Mickaël Menu
4 | *
5 | * Copyright (c) 2020. Readium Foundation. All rights reserved.
6 | * Use of this source code is governed by a BSD-style license which is detailed in the
7 | * LICENSE file present in the project repository where this source code is maintained.
8 | */
9 |
10 | package org.readium.r2.shared.publication.epub
11 |
12 | import org.readium.r2.shared.publication.Link
13 | import org.readium.r2.shared.publication.presentation.Presentation
14 |
15 | /**
16 | * Get the layout of the given resource in this publication.
17 | * Falls back on REFLOWABLE.
18 | */
19 | public fun Presentation.layoutOf(link: Link): EpubLayout {
20 | return link.properties.layout
21 | ?: layout
22 | ?: EpubLayout.REFLOWABLE
23 | }
24 |
--------------------------------------------------------------------------------
/readium/shared/src/main/java/org/readium/r2/shared/publication/opds/Publication.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Module: r2-shared-kotlin
3 | * Developers: Mickaël Menu
4 | *
5 | * Copyright (c) 2020. Readium Foundation. All rights reserved.
6 | * Use of this source code is governed by a BSD-style license which is detailed in the
7 | * LICENSE file present in the project repository where this source code is maintained.
8 | */
9 |
10 | package org.readium.r2.shared.publication.opds
11 |
12 | import org.readium.r2.shared.publication.Link
13 | import org.readium.r2.shared.publication.Publication
14 |
15 | // OPDS extensions for [Publication]
16 |
17 | public val Publication.images: List get() = linksWithRole("images")
18 |
--------------------------------------------------------------------------------
/readium/shared/src/main/java/org/readium/r2/shared/publication/presentation/Metadata.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Module: r2-shared-kotlin
3 | * Developers: Mickaël Menu
4 | *
5 | * Copyright (c) 2020. Readium Foundation. All rights reserved.
6 | * Use of this source code is governed by a BSD-style license which is detailed in the
7 | * LICENSE file present in the project repository where this source code is maintained.
8 | */
9 | package org.readium.r2.shared.publication.presentation
10 |
11 | import org.json.JSONObject
12 | import org.readium.r2.shared.publication.Metadata
13 |
14 | // Presentation extensions for [Metadata]
15 |
16 | public val Metadata.presentation: Presentation
17 | get() = Presentation.fromJSON(
18 | (this["presentation"] as? Map<*, *>)
19 | ?.let { JSONObject(it) }
20 | )
21 |
--------------------------------------------------------------------------------
/readium/shared/src/main/java/org/readium/r2/shared/util/Benchmarking.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2020 Readium Foundation. All rights reserved.
3 | * Use of this source code is governed by the BSD-style license
4 | * available in the top-level LICENSE file of the project.
5 | */
6 |
7 | package org.readium.r2.shared.util
8 |
9 | import kotlin.time.measureTime
10 | import timber.log.Timber
11 |
12 | internal inline fun benchmark(title: String, enabled: Boolean = true, closure: () -> T): T {
13 | if (!enabled) {
14 | return closure()
15 | }
16 |
17 | var result: T
18 | val duration = measureTime {
19 | result = closure()
20 | }
21 | Timber.d("""Benchmark "$title" took %.4f seconds """.format(duration.inWholeSeconds))
22 | return result
23 | }
24 |
--------------------------------------------------------------------------------
/readium/shared/src/main/java/org/readium/r2/shared/util/resource/SingleResourceContainer.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2023 Readium Foundation. All rights reserved.
3 | * Use of this source code is governed by the BSD-style license
4 | * available in the top-level LICENSE file of the project.
5 | */
6 |
7 | package org.readium.r2.shared.util.resource
8 |
9 | import org.readium.r2.shared.util.Url
10 | import org.readium.r2.shared.util.data.Container
11 |
12 | /** A [Container] for a single [Resource]. */
13 | public class SingleResourceContainer(
14 | private val entryUrl: Url,
15 | private val resource: Resource,
16 | ) : Container {
17 |
18 | override val entries: Set = setOf(entryUrl)
19 |
20 | override fun get(url: Url): Resource? {
21 | if (!url.removeFragment().removeQuery().isEquivalent(entryUrl)) {
22 | return null
23 | }
24 |
25 | return resource.borrow()
26 | }
27 |
28 | override fun close() {
29 | resource.close()
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/readium/shared/src/main/java/org/readium/r2/shared/util/tokenizer/Tokenizer.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2022 Readium Foundation. All rights reserved.
3 | * Use of this source code is governed by the BSD-style license
4 | * available in the top-level LICENSE file of the project.
5 | */
6 |
7 | package org.readium.r2.shared.util.tokenizer
8 |
9 | import org.readium.r2.shared.ExperimentalReadiumApi
10 |
11 | /** A tokenizer splits a piece of data [D] into a list of [T] tokens. */
12 | @ExperimentalReadiumApi
13 | public fun interface Tokenizer {
14 | public fun tokenize(data: D): List
15 | }
16 |
--------------------------------------------------------------------------------
/readium/shared/src/main/java/org/readium/r2/shared/util/units/Hertz.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2023 Readium Foundation. All rights reserved.
3 | * Use of this source code is governed by the BSD-style license
4 | * available in the top-level LICENSE file of the project.
5 | */
6 |
7 | package org.readium.r2.shared.util.units
8 |
9 | @JvmInline
10 | public value class Hz(public val value: Double)
11 |
12 | public val Double.hz: Hz get() = Hz(this)
13 |
--------------------------------------------------------------------------------
/readium/shared/src/main/java/org/readium/r2/shared/util/zip/jvm/AsynchronousCloseException.java:
--------------------------------------------------------------------------------
1 | package org.readium.r2.shared.util.zip.jvm;
2 |
3 | /**
4 | * An {@code AsynchronousCloseException} is thrown when the underlying channel
5 | * for an I/O operation is closed by another thread.
6 | */
7 | public class AsynchronousCloseException extends ClosedChannelException {
8 | private static final long serialVersionUID = 6891178312432313966L;
9 | /**
10 | * Constructs an {@code AsynchronousCloseException}.
11 | */
12 | public AsynchronousCloseException() {
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/readium/shared/src/main/java/org/readium/r2/shared/util/zip/jvm/ByteChannel.java:
--------------------------------------------------------------------------------
1 | package org.readium.r2.shared.util.zip.jvm;
2 | /**
3 | * A ByteChannel is both readable and writable.
4 | *
5 | * The methods for the byte channel are precisely those defined by readable and
6 | * writable byte channels.
7 | *
8 | * @see ReadableByteChannel
9 | * @see WritableByteChannel
10 | */
11 | public interface ByteChannel extends ReadableByteChannel, WritableByteChannel {
12 | // No methods defined.
13 | }
14 |
--------------------------------------------------------------------------------
/readium/shared/src/main/java/org/readium/r2/shared/util/zip/jvm/ClosedByInterruptException.java:
--------------------------------------------------------------------------------
1 | package org.readium.r2.shared.util.zip.jvm;
2 |
3 | /**
4 | * A {@code ClosedByInterruptException} is thrown when a thread is interrupted
5 | * in a blocking I/O operation.
6 | *
7 | * When the thread is interrupted by a call to {@code interrupt()}, it closes
8 | * the channel, sets the interrupt status of the thread to {@code true} and
9 | * throws a {@code ClosedByInterruptException}.
10 | */
11 | public class ClosedByInterruptException extends AsynchronousCloseException {
12 | private static final long serialVersionUID = -4488191543534286750L;
13 | /**
14 | * Constructs a {@code ClosedByInterruptException}.
15 | */
16 | public ClosedByInterruptException() {
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/readium/shared/src/main/java/org/readium/r2/shared/util/zip/jvm/ClosedChannelException.java:
--------------------------------------------------------------------------------
1 | package org.readium.r2.shared.util.zip.jvm;
2 |
3 | import java.io.IOException;
4 | /**
5 | * A {@code ClosedChannelException} is thrown when a channel is closed for the
6 | * type of operation attempted.
7 | */
8 | public class ClosedChannelException extends IOException {
9 | private static final long serialVersionUID = 882777185433553857L;
10 | /**
11 | * Constructs a {@code ClosedChannelException}.
12 | */
13 | public ClosedChannelException() {
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/readium/shared/src/main/java/org/readium/r2/shared/util/zip/jvm/NonReadableChannelException.java:
--------------------------------------------------------------------------------
1 | package org.readium.r2.shared.util.zip.jvm;
2 |
3 | /**
4 | * A {@code NonReadableChannelException} is thrown when attempting to read from
5 | * a channel that is not open for reading.
6 | */
7 | public class NonReadableChannelException extends IllegalStateException {
8 | private static final long serialVersionUID = -3200915679294993514L;
9 | /**
10 | * Constructs a {@code NonReadableChannelException}.
11 | */
12 | public NonReadableChannelException() {
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/readium/shared/src/main/java/org/readium/r2/shared/util/zip/jvm/NonWritableChannelException.java:
--------------------------------------------------------------------------------
1 | package org.readium.r2.shared.util.zip.jvm;
2 |
3 | /**
4 | * A {@code NonWritableChannelException} is thrown when attempting to write to a
5 | * channel that is not open for writing.
6 | */
7 | public class NonWritableChannelException extends IllegalStateException {
8 | private static final long serialVersionUID = -7071230488279011621L;
9 | /**
10 | * Constructs a {@code NonWritableChannelException}.
11 | */
12 | public NonWritableChannelException() {
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/readium/shared/src/test/java/org/readium/r2/shared/extensions/LongRangeTest.kt:
--------------------------------------------------------------------------------
1 | @file:OptIn(InternalReadiumApi::class)
2 |
3 | package org.readium.r2.shared.extensions
4 |
5 | import kotlin.test.assertEquals
6 | import org.junit.Test
7 | import org.readium.r2.shared.InternalReadiumApi
8 |
9 | class LongRangeTest {
10 |
11 | @Test
12 | fun `coerceIn is correct`() {
13 | assertEquals((25L..30), (25L..30).coerceIn(22L..32))
14 | assertEquals((27L..28), (25L..30).coerceIn(27L..28))
15 | assertEquals((27L..30), (25L..30).coerceIn(27L..32))
16 | assertEquals((25L..28), (25L..30).coerceIn(22L..28))
17 | assertEquals(0L until 0, (25L..30).coerceIn(0L until 0))
18 | assertEquals(0L until 0, (25L..30).coerceIn(32L until 34))
19 | assertEquals(0L until 0, (25L..30).coerceIn(0L until 25))
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/readium/shared/src/test/java/org/readium/r2/shared/extensions/StringTest.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2024 Readium Foundation. All rights reserved.
3 | * Use of this source code is governed by the BSD-style license
4 | * available in the top-level LICENSE file of the project.
5 | */
6 |
7 | package org.readium.r2.shared.extensions
8 |
9 | import kotlin.test.assertFalse
10 | import kotlin.test.assertTrue
11 | import org.junit.Test
12 |
13 | class StringTest {
14 |
15 | @Test
16 | fun `checks if a string is made of printable ASCII characters`() {
17 | assertTrue("".isPrintableAscii())
18 | assertTrue(" foo/@bar".isPrintableAscii())
19 | assertFalse("école".isPrintableAscii())
20 | assertFalse("\u0001 non printable".isPrintableAscii())
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/readium/shared/src/test/java/org/readium/r2/shared/publication/ReadingProgressionTest.kt:
--------------------------------------------------------------------------------
1 | package org.readium.r2.shared.publication
2 |
3 | import org.junit.Assert.*
4 | import org.junit.Test
5 |
6 | class ReadingProgressionTest {
7 |
8 | @Test
9 | fun `parse reading progression`() {
10 | assertEquals(ReadingProgression.LTR, ReadingProgression("LTR"))
11 | assertEquals(ReadingProgression.LTR, ReadingProgression("ltr"))
12 | assertEquals(ReadingProgression.RTL, ReadingProgression("rtl"))
13 | assertEquals(null, ReadingProgression("auto"))
14 | assertEquals(null, ReadingProgression("foobar"))
15 | assertEquals(null, ReadingProgression(null))
16 | }
17 |
18 | @Test fun `get reading progression value`() {
19 | assertEquals("ltr", ReadingProgression.LTR.value)
20 | assertEquals("rtl", ReadingProgression.RTL.value)
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/readium/shared/src/test/resources/junit-platform.properties:
--------------------------------------------------------------------------------
1 | junit.jupiter.testinstance.lifecycle.default = per_class
--------------------------------------------------------------------------------
/readium/shared/src/test/resources/org/readium/r2/shared/extensions/image.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/readium/kotlin-toolkit/38b1a810235409967b9c9bacea1516aabc344699/readium/shared/src/test/resources/org/readium/r2/shared/extensions/image.jpg
--------------------------------------------------------------------------------
/readium/shared/src/test/resources/org/readium/r2/shared/publication/services/cover.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/readium/kotlin-toolkit/38b1a810235409967b9c9bacea1516aabc344699/readium/shared/src/test/resources/org/readium/r2/shared/publication/services/cover.jpg
--------------------------------------------------------------------------------
/readium/shared/src/test/resources/org/readium/r2/shared/util/asset/any.json:
--------------------------------------------------------------------------------
1 | {
2 | "key": "value"
3 | }
4 |
--------------------------------------------------------------------------------
/readium/shared/src/test/resources/org/readium/r2/shared/util/asset/audiobook-lcp.unknown:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/readium/kotlin-toolkit/38b1a810235409967b9c9bacea1516aabc344699/readium/shared/src/test/resources/org/readium/r2/shared/util/asset/audiobook-lcp.unknown
--------------------------------------------------------------------------------
/readium/shared/src/test/resources/org/readium/r2/shared/util/asset/audiobook-package.unknown:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/readium/kotlin-toolkit/38b1a810235409967b9c9bacea1516aabc344699/readium/shared/src/test/resources/org/readium/r2/shared/util/asset/audiobook-package.unknown
--------------------------------------------------------------------------------
/readium/shared/src/test/resources/org/readium/r2/shared/util/asset/cbz.unknown:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/readium/kotlin-toolkit/38b1a810235409967b9c9bacea1516aabc344699/readium/shared/src/test/resources/org/readium/r2/shared/util/asset/cbz.unknown
--------------------------------------------------------------------------------
/readium/shared/src/test/resources/org/readium/r2/shared/util/asset/divina-package.unknown:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/readium/kotlin-toolkit/38b1a810235409967b9c9bacea1516aabc344699/readium/shared/src/test/resources/org/readium/r2/shared/util/asset/divina-package.unknown
--------------------------------------------------------------------------------
/readium/shared/src/test/resources/org/readium/r2/shared/util/asset/epub.unknown:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/readium/kotlin-toolkit/38b1a810235409967b9c9bacea1516aabc344699/readium/shared/src/test/resources/org/readium/r2/shared/util/asset/epub.unknown
--------------------------------------------------------------------------------
/readium/shared/src/test/resources/org/readium/r2/shared/util/asset/html-doctype-case.unknown:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | sample HTML document
5 |
6 |
7 |
8 | Sample HTML document.
9 |
10 |
11 |
--------------------------------------------------------------------------------
/readium/shared/src/test/resources/org/readium/r2/shared/util/asset/html.unknown:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | sample HTML document
5 |
6 |
7 |
8 | Sample HTML document.
9 |
10 |
11 |
--------------------------------------------------------------------------------
/readium/shared/src/test/resources/org/readium/r2/shared/util/asset/lpf-index-html.unknown:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/readium/kotlin-toolkit/38b1a810235409967b9c9bacea1516aabc344699/readium/shared/src/test/resources/org/readium/r2/shared/util/asset/lpf-index-html.unknown
--------------------------------------------------------------------------------
/readium/shared/src/test/resources/org/readium/r2/shared/util/asset/lpf.unknown:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/readium/kotlin-toolkit/38b1a810235409967b9c9bacea1516aabc344699/readium/shared/src/test/resources/org/readium/r2/shared/util/asset/lpf.unknown
--------------------------------------------------------------------------------
/readium/shared/src/test/resources/org/readium/r2/shared/util/asset/pdf-lcp.unknown:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/readium/kotlin-toolkit/38b1a810235409967b9c9bacea1516aabc344699/readium/shared/src/test/resources/org/readium/r2/shared/util/asset/pdf-lcp.unknown
--------------------------------------------------------------------------------
/readium/shared/src/test/resources/org/readium/r2/shared/util/asset/pdf.unknown:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/readium/kotlin-toolkit/38b1a810235409967b9c9bacea1516aabc344699/readium/shared/src/test/resources/org/readium/r2/shared/util/asset/pdf.unknown
--------------------------------------------------------------------------------
/readium/shared/src/test/resources/org/readium/r2/shared/util/asset/png.unknown:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/readium/kotlin-toolkit/38b1a810235409967b9c9bacea1516aabc344699/readium/shared/src/test/resources/org/readium/r2/shared/util/asset/png.unknown
--------------------------------------------------------------------------------
/readium/shared/src/test/resources/org/readium/r2/shared/util/asset/unknown:
--------------------------------------------------------------------------------
1 | unknown format
2 |
--------------------------------------------------------------------------------
/readium/shared/src/test/resources/org/readium/r2/shared/util/asset/unknown.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/readium/kotlin-toolkit/38b1a810235409967b9c9bacea1516aabc344699/readium/shared/src/test/resources/org/readium/r2/shared/util/asset/unknown.zip
--------------------------------------------------------------------------------
/readium/shared/src/test/resources/org/readium/r2/shared/util/asset/w3c-wpub.json:
--------------------------------------------------------------------------------
1 | {
2 | "@context" : ["https://schema.org","https://www.w3.org/ns/wp-context"],
3 | "type" : "Book",
4 | "url" : "https://publisher.example.org/mobydick",
5 | "name" : "Moby Dick",
6 | "readingOrder" : [
7 | "html/title.html",
8 | "html/copyright.html",
9 | "html/introduction.html",
10 | "html/epigraph.html",
11 | "html/c001.html",
12 | ]
13 | }
14 |
--------------------------------------------------------------------------------
/readium/shared/src/test/resources/org/readium/r2/shared/util/asset/webpub-lcp.unknown:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/readium/kotlin-toolkit/38b1a810235409967b9c9bacea1516aabc344699/readium/shared/src/test/resources/org/readium/r2/shared/util/asset/webpub-lcp.unknown
--------------------------------------------------------------------------------
/readium/shared/src/test/resources/org/readium/r2/shared/util/asset/webpub-package.unknown:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/readium/kotlin-toolkit/38b1a810235409967b9c9bacea1516aabc344699/readium/shared/src/test/resources/org/readium/r2/shared/util/asset/webpub-package.unknown
--------------------------------------------------------------------------------
/readium/shared/src/test/resources/org/readium/r2/shared/util/asset/xhtml.unknown:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
10 |
11 | Sample XHTML Document
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/readium/shared/src/test/resources/org/readium/r2/shared/util/asset/zab.unknown:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/readium/kotlin-toolkit/38b1a810235409967b9c9bacea1516aabc344699/readium/shared/src/test/resources/org/readium/r2/shared/util/asset/zab.unknown
--------------------------------------------------------------------------------
/readium/shared/src/test/resources/org/readium/r2/shared/util/resource/directory/subdirectory/hello.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/readium/kotlin-toolkit/38b1a810235409967b9c9bacea1516aabc344699/readium/shared/src/test/resources/org/readium/r2/shared/util/resource/directory/subdirectory/hello.mp3
--------------------------------------------------------------------------------
/readium/shared/src/test/resources/org/readium/r2/shared/util/resource/directory/subdirectory/text2.txt:
--------------------------------------------------------------------------------
1 | text2
--------------------------------------------------------------------------------
/readium/shared/src/test/resources/org/readium/r2/shared/util/resource/directory/text1.txt:
--------------------------------------------------------------------------------
1 | text1
--------------------------------------------------------------------------------
/readium/shared/src/test/resources/org/readium/r2/shared/util/resource/epub.epub:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/readium/kotlin-toolkit/38b1a810235409967b9c9bacea1516aabc344699/readium/shared/src/test/resources/org/readium/r2/shared/util/resource/epub.epub
--------------------------------------------------------------------------------
/readium/shared/src/test/resources/org/readium/r2/shared/util/resource/epub/EPUB/cover.xhtml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Children's Literature
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/readium/shared/src/test/resources/org/readium/r2/shared/util/resource/epub/EPUB/css/nav.css:
--------------------------------------------------------------------------------
1 |
2 | @namespace epub "http://www.idpf.org/2007/ops";
3 |
4 | h2 {
5 | text-align: left;
6 | }
7 |
8 | a {
9 | text-decoration: none;
10 | }
11 |
12 | nav[epub\:type~='landmarks'], nav[epub\:type~='page-list'] {
13 | display: none;
14 | visibility: hidden;
15 | }
16 |
17 | ol {
18 | list-style-type: none;
19 | }
20 |
21 | ol > li:first-child {
22 | margin-top: 0.3em;
23 | }
24 |
25 | nav[epub|type~='toc'] > ol > li > ol > li {
26 | margin-top: 0.3em;
27 | }
28 |
29 | li.front {
30 | font-style: italic;
31 | font-size: 85%;
32 | }
33 |
34 | li.front + li.body {
35 | margin-top: 1.5em;
36 | }
37 |
38 | span.author {
39 | font-family: arial, helvetica, sans-serif;
40 | font-weight: bold;
41 | }
42 |
--------------------------------------------------------------------------------
/readium/shared/src/test/resources/org/readium/r2/shared/util/resource/epub/EPUB/images/cover.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/readium/kotlin-toolkit/38b1a810235409967b9c9bacea1516aabc344699/readium/shared/src/test/resources/org/readium/r2/shared/util/resource/epub/EPUB/images/cover.png
--------------------------------------------------------------------------------
/readium/shared/src/test/resources/org/readium/r2/shared/util/resource/epub/META-INF/container.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/readium/shared/src/test/resources/org/readium/r2/shared/util/resource/epub/mimetype:
--------------------------------------------------------------------------------
1 | application/epub+zip
--------------------------------------------------------------------------------
/readium/shared/src/test/resources/robolectric.properties:
--------------------------------------------------------------------------------
1 | sdk=30
2 |
--------------------------------------------------------------------------------
/readium/streamer/build.gradle.kts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018 Readium Foundation. All rights reserved.
3 | * Use of this source code is governed by the BSD-style license
4 | * available in the top-level LICENSE file of the project.
5 | */
6 |
7 | plugins {
8 | id("readium.library-conventions")
9 | }
10 |
11 | android {
12 | namespace = "org.readium.r2.streamer"
13 | }
14 |
15 | dependencies {
16 | api(project(":readium:readium-shared"))
17 |
18 | @Suppress("GradleDependency")
19 | implementation(libs.timber)
20 | // AM NOTE: conflicting support libraries, excluding these
21 | implementation("com.mcxiaoke.koi:core:0.5.5") {
22 | exclude(module = "support-v4")
23 | }
24 | implementation(libs.kotlinx.coroutines.android)
25 |
26 | // Tests
27 | testImplementation(libs.junit)
28 | testImplementation(libs.kotlin.junit)
29 | testImplementation(libs.assertj)
30 | testImplementation(libs.robolectric)
31 | }
32 |
--------------------------------------------------------------------------------
/readium/streamer/gradle.properties:
--------------------------------------------------------------------------------
1 | pom.artifactId=readium-streamer
2 |
--------------------------------------------------------------------------------
/readium/streamer/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/readium/streamer/src/main/java/org/readium/r2/streamer/extensions/File.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Module: r2-streamer-kotlin
3 | * Developers: Quentin Gliosca
4 | *
5 | * Copyright (c) 2020. Readium Foundation. All rights reserved.
6 | * Use of this source code is governed by a BSD-style license which is detailed in the
7 | * LICENSE file present in the project repository where this source code is maintained.
8 | */
9 |
10 | package org.readium.r2.streamer.extensions
11 |
12 | import java.io.File
13 |
14 | /**
15 | * Returns a [File] to the first component of the [File]'s path,
16 | * regardless of whether it is a directory or a file.
17 | */
18 | internal val File.firstComponent: File
19 | get() = parent.takeUnless { it == "/" }
20 | ?.let { File(it).firstComponent }
21 | ?: this
22 |
--------------------------------------------------------------------------------
/readium/streamer/src/main/java/org/readium/r2/streamer/extensions/Url.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2023 Readium Foundation. All rights reserved.
3 | * Use of this source code is governed by the BSD-style license
4 | * available in the top-level LICENSE file of the project.
5 | */
6 |
7 | package org.readium.r2.streamer.extensions
8 |
9 | import org.readium.r2.shared.util.Url
10 |
11 | internal val Url.isHiddenOrThumbs: Boolean
12 | get() = filename?.let { it.startsWith(".") || it == "Thumbs.db" } ?: false
13 |
--------------------------------------------------------------------------------
/readium/streamer/src/test/java/org/readium/r2/streamer/TestUtils.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Module: r2-streamer-kotlin
3 | * Developers: Quentin Gliosca
4 | *
5 | * Copyright (c) 2020. Readium Foundation. All rights reserved.
6 | * Use of this source code is governed by a BSD-style license which is detailed in the
7 | * LICENSE file present in the project repository where this source code is maintained.
8 | */
9 |
10 | package org.readium.r2.streamer
11 |
12 | import kotlinx.coroutines.runBlocking
13 | import org.readium.r2.shared.publication.Publication
14 | import org.readium.r2.shared.util.asset.Asset
15 | import org.readium.r2.shared.util.resource.Resource
16 | import org.readium.r2.streamer.parser.PublicationParser
17 |
18 | internal fun Resource.readBlocking(range: LongRange? = null) = runBlocking { read(range) }
19 |
20 | internal fun PublicationParser.parseBlocking(asset: Asset): Publication.Builder? =
21 | runBlocking { parse(asset).getOrNull() }
22 |
--------------------------------------------------------------------------------
/readium/streamer/src/test/resources/junit-platform.properties:
--------------------------------------------------------------------------------
1 | junit.jupiter.testinstance.lifecycle.default = per_class
--------------------------------------------------------------------------------
/readium/streamer/src/test/resources/org/readium/r2/streamer/parser/epub/deobfuscation/cut-cut.adb.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/readium/kotlin-toolkit/38b1a810235409967b9c9bacea1516aabc344699/readium/streamer/src/test/resources/org/readium/r2/streamer/parser/epub/deobfuscation/cut-cut.adb.woff
--------------------------------------------------------------------------------
/readium/streamer/src/test/resources/org/readium/r2/streamer/parser/epub/deobfuscation/cut-cut.obf.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/readium/kotlin-toolkit/38b1a810235409967b9c9bacea1516aabc344699/readium/streamer/src/test/resources/org/readium/r2/streamer/parser/epub/deobfuscation/cut-cut.obf.woff
--------------------------------------------------------------------------------
/readium/streamer/src/test/resources/org/readium/r2/streamer/parser/epub/deobfuscation/cut-cut.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/readium/kotlin-toolkit/38b1a810235409967b9c9bacea1516aabc344699/readium/streamer/src/test/resources/org/readium/r2/streamer/parser/epub/deobfuscation/cut-cut.woff
--------------------------------------------------------------------------------
/readium/streamer/src/test/resources/org/readium/r2/streamer/parser/epub/navigation/nav-children.xhtml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/readium/streamer/src/test/resources/org/readium/r2/streamer/parser/epub/navigation/nav-empty.xhtml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | Section Title
10 | Some text
11 | Table of Contents
12 | Some text
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/readium/streamer/src/test/resources/org/readium/r2/streamer/parser/epub/navigation/nav-section.xhtml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | Section Title
10 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/readium/streamer/src/test/resources/org/readium/r2/streamer/parser/epub/ncx/ncx-empty.ncx:
--------------------------------------------------------------------------------
1 |
2 |
3 | Document Title
4 |
5 |
--------------------------------------------------------------------------------
/readium/streamer/src/test/resources/org/readium/r2/streamer/parser/epub/package/collections-epub2.opf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Alice's Adventures in Wonderland
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/readium/streamer/src/test/resources/org/readium/r2/streamer/parser/epub/package/cover-epub2.opf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Alice's Adventures in Wonderland
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/readium/streamer/src/test/resources/org/readium/r2/streamer/parser/epub/package/cover-epub3.opf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Alice's Adventures in Wonderland
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/readium/streamer/src/test/resources/org/readium/r2/streamer/parser/epub/package/cover-mix.opf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Alice's Adventures in Wonderland
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/readium/streamer/src/test/resources/org/readium/r2/streamer/parser/epub/package/dates-epub2.opf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Alice's Adventures in Wonderland
5 | 2012-04-02T12:47:00Z
6 | 1865-07-04
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/readium/streamer/src/test/resources/org/readium/r2/streamer/parser/epub/package/dates-epub3.opf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Alice's Adventures in Wonderland
5 | 1865-07-04
6 | 2012-04-02T12:47:00Z
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/readium/streamer/src/test/resources/org/readium/r2/streamer/parser/epub/package/fallbacks-termination.opf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Alice's Adventures in Wonderland
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/readium/streamer/src/test/resources/org/readium/r2/streamer/parser/epub/package/fallbacks.opf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Alice's Adventures in Wonderland
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/readium/streamer/src/test/resources/org/readium/r2/streamer/parser/epub/package/identifier-unique.opf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Alice's Adventures in Wonderland
5 |
6 | BEQ
7 | urn:uuid:2
8 | 978-3-16-148410-0
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/readium/streamer/src/test/resources/org/readium/r2/streamer/parser/epub/package/languages-order-nomatch.opf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 | Alice's Adventures in Wonderland
8 | en
9 | fr
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/readium/streamer/src/test/resources/org/readium/r2/streamer/parser/epub/package/languages-order.opf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 | Alice's Adventures in Wonderland
8 | en
9 | ar
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/readium/streamer/src/test/resources/org/readium/r2/streamer/parser/epub/package/meta-termination.opf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Alice's Adventures in Wonderland
5 | Media Overlays Narrator
6 | nrt
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/readium/streamer/src/test/resources/org/readium/r2/streamer/parser/epub/package/presentation-metadata.opf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Alice's Adventures in Wonderland
5 |
6 | pre-paginated
7 | landscape
8 | scrolled-doc
9 | both
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/readium/streamer/src/test/resources/org/readium/r2/streamer/parser/epub/package/progression-default.opf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 | Alice's Adventures in Wonderland
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/readium/streamer/src/test/resources/org/readium/r2/streamer/parser/epub/package/progression-ltr.opf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 | Alice's Adventures in Wonderland
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/readium/streamer/src/test/resources/org/readium/r2/streamer/parser/epub/package/progression-none.opf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 | Alice's Adventures in Wonderland
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/readium/streamer/src/test/resources/org/readium/r2/streamer/parser/epub/package/progression-rtl.opf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 | Alice's Adventures in Wonderland
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/readium/streamer/src/test/resources/org/readium/r2/streamer/parser/epub/package/subjects-complex.opf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Alice's Adventures in Wonderland
5 | FICTION / Occult & Supernatural
6 | FICTION / Occulte & Surnaturel
7 | occult
8 | BISAC
9 | FIC024000
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/readium/streamer/src/test/resources/org/readium/r2/streamer/parser/epub/package/subjects-multiple.opf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Alice's Adventures in Wonderland
5 | fiction
6 |
7 | apple; banana, pear
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/readium/streamer/src/test/resources/org/readium/r2/streamer/parser/epub/package/subjects-single.opf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Alice's Adventures in Wonderland
5 |
6 | apple; banana, pear
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/readium/streamer/src/test/resources/org/readium/r2/streamer/parser/epub/package/tdm-epub2.opf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Alice's Adventures in Wonderland
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/readium/streamer/src/test/resources/org/readium/r2/streamer/parser/epub/package/tdm-epub3.opf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Alice's Adventures in Wonderland
5 |
6 | 1
7 | https://provider.com/policies/policy.json
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/readium/streamer/src/test/resources/org/readium/r2/streamer/parser/epub/package/title-main-precedence.opf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Alice's Adventures in Wonderland
5 | Main title takes precedence
6 | main
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/readium/streamer/src/test/resources/org/readium/r2/streamer/parser/epub/package/title-multiple-subtitles.opf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Alice's Adventures in Wonderland
5 | Subtitle 1
6 | subtitle
7 | 2
8 | Subtitle 2
9 | subtitle
10 | 1
11 | en
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/readium/streamer/src/test/resources/org/readium/r2/streamer/parser/epub/package/titles-epub2.opf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Alice's Adventures in Wonderland
5 |
6 | en
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/readium/streamer/src/test/resources/org/readium/r2/streamer/parser/epub/package/version-default.opf:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
10 | Alice's Adventures in Wonderland
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/readium/streamer/src/test/resources/org/readium/r2/streamer/parser/epub/package/version-epub2.opf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Alice's Adventures in Wonderland
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/readium/streamer/src/test/resources/org/readium/r2/streamer/parser/epub/package/version-epub3.opf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Alice's Adventures in Wonderland
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/readium/streamer/src/test/resources/org/readium/r2/streamer/parser/image/futuristic_tales.cbz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/readium/kotlin-toolkit/38b1a810235409967b9c9bacea1516aabc344699/readium/streamer/src/test/resources/org/readium/r2/streamer/parser/image/futuristic_tales.cbz
--------------------------------------------------------------------------------
/readium/streamer/src/test/resources/org/readium/r2/streamer/parser/image/futuristic_tales.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/readium/kotlin-toolkit/38b1a810235409967b9c9bacea1516aabc344699/readium/streamer/src/test/resources/org/readium/r2/streamer/parser/image/futuristic_tales.jpg
--------------------------------------------------------------------------------
/readium/streamer/src/test/resources/robolectric.properties:
--------------------------------------------------------------------------------
1 | sdk=30
2 |
--------------------------------------------------------------------------------
/test-app/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/workspace.xml
5 | /.idea/libraries
6 | .DS_Store
7 | /build
8 | /captures
9 | .externalNativeBuild
10 | *.aab
11 | r2-testapp/release
12 |
--------------------------------------------------------------------------------
/test-app/src/main/assets/annotation-icon.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test-app/src/main/assets/configs/config.properties:
--------------------------------------------------------------------------------
1 | useExternalFileDir=false
--------------------------------------------------------------------------------
/test-app/src/main/assets/fonts/Literata-Italic-VariableFont_opsz,wght.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/readium/kotlin-toolkit/38b1a810235409967b9c9bacea1516aabc344699/test-app/src/main/assets/fonts/Literata-Italic-VariableFont_opsz,wght.ttf
--------------------------------------------------------------------------------
/test-app/src/main/assets/fonts/Literata-VariableFont_opsz,wght.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/readium/kotlin-toolkit/38b1a810235409967b9c9bacea1516aabc344699/test-app/src/main/assets/fonts/Literata-VariableFont_opsz,wght.ttf
--------------------------------------------------------------------------------
/test-app/src/main/ic_launcher-web.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/readium/kotlin-toolkit/38b1a810235409967b9c9bacea1516aabc344699/test-app/src/main/ic_launcher-web.png
--------------------------------------------------------------------------------
/test-app/src/main/java/org/readium/r2/testapp/about/AboutFragment.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2021 Readium Foundation. All rights reserved.
3 | * Use of this source code is governed by the BSD-style license
4 | * available in the top-level LICENSE file of the project.
5 | */
6 |
7 | package org.readium.r2.testapp.about
8 |
9 | import android.os.Bundle
10 | import android.view.LayoutInflater
11 | import android.view.View
12 | import android.view.ViewGroup
13 | import androidx.fragment.app.Fragment
14 | import org.readium.r2.testapp.R
15 |
16 | class AboutFragment : Fragment() {
17 |
18 | override fun onCreateView(
19 | inflater: LayoutInflater,
20 | container: ViewGroup?,
21 | savedInstanceState: Bundle?,
22 | ): View? {
23 | return inflater.inflate(R.layout.fragment_about, container, false)
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/test-app/src/main/java/org/readium/r2/testapp/data/CatalogRepository.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2021 Readium Foundation. All rights reserved.
3 | * Use of this source code is governed by the BSD-style license
4 | * available in the top-level LICENSE file of the project.
5 | */
6 |
7 | package org.readium.r2.testapp.data
8 |
9 | import kotlinx.coroutines.flow.Flow
10 | import org.readium.r2.testapp.data.db.CatalogDao
11 | import org.readium.r2.testapp.data.model.Catalog
12 |
13 | class CatalogRepository(private val catalogDao: CatalogDao) {
14 |
15 | suspend fun insertCatalog(catalog: Catalog): Long {
16 | return catalogDao.insertCatalog(catalog)
17 | }
18 |
19 | fun getCatalogsFromDatabase(): Flow> = catalogDao.getCatalogModels()
20 |
21 | suspend fun deleteCatalog(id: Long) = catalogDao.deleteCatalog(id)
22 | }
23 |
--------------------------------------------------------------------------------
/test-app/src/main/java/org/readium/r2/testapp/drm/DrmManagementContract.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2021 Readium Foundation. All rights reserved.
3 | * Use of this source code is governed by the BSD-style license
4 | * available in the top-level LICENSE file of the project.
5 | */
6 |
7 | package org.readium.r2.testapp.drm
8 |
9 | import android.os.Bundle
10 |
11 | object DrmManagementContract {
12 |
13 | private const val HAS_RETURNED_KEY = "hasReturned"
14 |
15 | val REQUEST_KEY: String = DrmManagementContract::class.java.name
16 |
17 | data class Result(val hasReturned: Boolean)
18 |
19 | fun createResult(hasReturned: Boolean): Bundle {
20 | return Bundle().apply {
21 | putBoolean(HAS_RETURNED_KEY, hasReturned)
22 | }
23 | }
24 |
25 | fun parseResult(result: Bundle): Result {
26 | val hasReturned = requireNotNull(result.getBoolean(HAS_RETURNED_KEY))
27 | return Result(hasReturned)
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/test-app/src/main/java/org/readium/r2/testapp/search/SearchUserError.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2020 Readium Foundation. All rights reserved.
3 | * Use of this source code is governed by the BSD-style license
4 | * available in the top-level LICENSE file of the project.
5 | */
6 |
7 | package org.readium.r2.testapp.search
8 |
9 | import org.readium.r2.shared.ExperimentalReadiumApi
10 | import org.readium.r2.shared.publication.services.search.SearchError
11 | import org.readium.r2.testapp.R
12 | import org.readium.r2.testapp.utils.UserError
13 |
14 | @OptIn(ExperimentalReadiumApi::class)
15 | fun SearchError.toUserError(): UserError = when (this) {
16 | is SearchError.Engine -> UserError(R.string.search_error_other, cause = this)
17 | is SearchError.Reading -> UserError(R.string.search_error_other, cause = this)
18 | }
19 |
--------------------------------------------------------------------------------
/test-app/src/main/java/org/readium/r2/testapp/shared/views/Group.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2022 Readium Foundation. All rights reserved.
3 | * Use of this source code is governed by the BSD-style license
4 | * available in the top-level LICENSE file of the project.
5 | */
6 |
7 | package org.readium.r2.testapp.shared.views
8 |
9 | import androidx.compose.runtime.Composable
10 | import org.readium.r2.testapp.utils.compose.Emphasis
11 | import org.readium.r2.testapp.utils.compose.EmphasisProvider
12 | import org.readium.r2.testapp.utils.compose.LocalContentEmphasis
13 |
14 | /**
15 | * Sets the emphasis (alpha) of a group of [Composable] views.
16 | */
17 | @Composable
18 | fun Group(enabled: Boolean = true, content: @Composable () -> Unit) {
19 | val emphasis = when {
20 | !enabled -> Emphasis.Disabled
21 | else -> Emphasis.Medium
22 | }
23 | EmphasisProvider(LocalContentEmphasis provides emphasis) {
24 | content()
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/test-app/src/main/java/org/readium/r2/testapp/utils/Exception.kt:
--------------------------------------------------------------------------------
1 | package org.readium.r2.testapp.utils
2 |
3 | import timber.log.Timber
4 |
5 | /**
6 | * Returns the result of the given [closure], or null if an [Exception] was raised.
7 | */
8 | inline fun tryOrNull(closure: () -> T): T? =
9 | tryOr(null, closure)
10 |
11 | /**
12 | * Returns the result of the given [closure], or [default] if an [Exception] was raised.
13 | */
14 | inline fun tryOr(default: T, closure: () -> T): T =
15 | try {
16 | closure()
17 | } catch (e: Exception) {
18 | default
19 | }
20 |
21 | /**
22 | * Returns the result of the given [closure], or null if an [Exception] was raised.
23 | * The [Exception] will be logged.
24 | */
25 | inline fun tryOrLog(closure: () -> T): T? =
26 | try {
27 | closure()
28 | } catch (e: Exception) {
29 | Timber.e(e)
30 | null
31 | }
32 |
--------------------------------------------------------------------------------
/test-app/src/main/java/org/readium/r2/testapp/utils/extensions/Intent.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2024 Readium Foundation. All rights reserved.
3 | * Use of this source code is governed by the BSD-style license
4 | * available in the top-level LICENSE file of the project.
5 | */
6 |
7 | package org.readium.r2.testapp.utils.extensions
8 |
9 | import android.content.Context
10 | import android.content.Intent
11 | import androidx.core.app.ShareCompat
12 |
13 | /**
14 | * Start a new activity to share the given plain [text] to other applications.
15 | */
16 | fun createShareIntent(
17 | launchingContext: Context,
18 | text: String,
19 | title: String? = null,
20 | ): Intent {
21 | val intent =
22 | ShareCompat.IntentBuilder(launchingContext)
23 | .setType("text/plain")
24 | .setText(text)
25 | .intent
26 | .setAction(Intent.ACTION_SEND)
27 | .addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
28 | return Intent.createChooser(intent, title)
29 | }
30 |
--------------------------------------------------------------------------------
/test-app/src/main/java/org/readium/r2/testapp/utils/extensions/Number.kt:
--------------------------------------------------------------------------------
1 | package org.readium.r2.testapp.utils.extensions
2 |
3 | import java.text.NumberFormat
4 |
5 | fun Number.formatPercentage(maximumFractionDigits: Int = 0): String {
6 | val format = NumberFormat.getPercentInstance()
7 | format.maximumFractionDigits = maximumFractionDigits
8 | return format.format(this)
9 | }
10 |
--------------------------------------------------------------------------------
/test-app/src/main/java/org/readium/r2/testapp/utils/extensions/String.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2024 Readium Foundation. All rights reserved.
3 | * Use of this source code is governed by the BSD-style license
4 | * available in the top-level LICENSE file of the project.
5 | */
6 |
7 | package org.readium.r2.testapp.utils.extensions
8 |
9 | import android.os.Build
10 | import android.text.Html
11 | import android.text.Spanned
12 |
13 | fun String.toHtml(): Spanned =
14 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
15 | Html.fromHtml(this, Html.FROM_HTML_MODE_COMPACT)
16 | } else {
17 | @Suppress("DEPRECATION")
18 | Html.fromHtml(this)
19 | }
20 |
--------------------------------------------------------------------------------
/test-app/src/main/java/org/readium/r2/testapp/utils/extensions/readium/LinkExt.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2023 Readium Foundation. All rights reserved.
3 | * Use of this source code is governed by the BSD-style license
4 | * available in the top-level LICENSE file of the project.
5 | */
6 |
7 | package org.readium.r2.testapp.utils.extensions.readium
8 |
9 | import org.readium.r2.shared.publication.Link
10 |
11 | val Link.outlineTitle: String
12 | get() = title ?: href.toString()
13 |
--------------------------------------------------------------------------------
/test-app/src/main/java/org/readium/r2/testapp/utils/extensions/readium/MetadataExt.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2023 Readium Foundation. All rights reserved.
3 | * Use of this source code is governed by the BSD-style license
4 | * available in the top-level LICENSE file of the project.
5 | */
6 |
7 | package org.readium.r2.testapp.utils.extensions.readium
8 |
9 | import org.readium.r2.shared.publication.Metadata
10 |
11 | val Metadata.authorName: String get() =
12 | authors.firstOrNull()?.name ?: ""
13 |
--------------------------------------------------------------------------------
/test-app/src/main/res/drawable/background_action_mode.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/test-app/src/main/res/drawable/baseline_dashboard_24.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/test-app/src/main/res/drawable/baseline_info_24.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/test-app/src/main/res/drawable/baseline_local_library_24.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/test-app/src/main/res/drawable/cover.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/readium/kotlin-toolkit/38b1a810235409967b9c9bacea1516aabc344699/test-app/src/main/res/drawable/cover.png
--------------------------------------------------------------------------------
/test-app/src/main/res/drawable/ic_add_white_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
--------------------------------------------------------------------------------
/test-app/src/main/res/drawable/ic_baseline_arrow_forward_24.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/test-app/src/main/res/drawable/ic_baseline_bookmark_24.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/test-app/src/main/res/drawable/ic_baseline_delete_24.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/test-app/src/main/res/drawable/ic_baseline_edit_24.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/test-app/src/main/res/drawable/ic_baseline_enhanced_encryption_24.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/test-app/src/main/res/drawable/ic_baseline_headphones_24.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/test-app/src/main/res/drawable/ic_baseline_info_24.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/test-app/src/main/res/drawable/ic_baseline_pause_24.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/test-app/src/main/res/drawable/ic_baseline_play_arrow_24.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/test-app/src/main/res/drawable/ic_baseline_search_24.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/test-app/src/main/res/drawable/ic_notch.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/test-app/src/main/res/drawable/ic_outline_format_size_24.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/test-app/src/main/res/drawable/ic_outline_menu_24.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/test-app/src/main/res/drawable/icon_overflow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/readium/kotlin-toolkit/38b1a810235409967b9c9bacea1516aabc344699/test-app/src/main/res/drawable/icon_overflow.png
--------------------------------------------------------------------------------
/test-app/src/main/res/drawable/repfr.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/readium/kotlin-toolkit/38b1a810235409967b9c9bacea1516aabc344699/test-app/src/main/res/drawable/repfr.png
--------------------------------------------------------------------------------
/test-app/src/main/res/layout/activity_reader.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
--------------------------------------------------------------------------------
/test-app/src/main/res/layout/add_catalog_dialog.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
17 |
18 |
25 |
--------------------------------------------------------------------------------
/test-app/src/main/res/layout/fragment_listview.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
14 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/test-app/src/main/res/layout/fragment_reader.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
14 |
19 |
20 |
--------------------------------------------------------------------------------
/test-app/src/main/res/layout/item_recycle_button.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
12 |
13 |
17 |
18 |
--------------------------------------------------------------------------------
/test-app/src/main/res/layout/item_recycle_search.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
13 |
14 |
--------------------------------------------------------------------------------
/test-app/src/main/res/layout/popup_footnote.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
17 |
18 |
24 |
25 |
--------------------------------------------------------------------------------
/test-app/src/main/res/layout/section_header.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/test-app/src/main/res/menu/bottom_nav_menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/test-app/src/main/res/menu/menu_action_mode.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/test-app/src/main/res/menu/menu_bookmark.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/test-app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/test-app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/readium/kotlin-toolkit/38b1a810235409967b9c9bacea1516aabc344699/test-app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/test-app/src/main/res/mipmap-hdpi/ic_launcher_background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/readium/kotlin-toolkit/38b1a810235409967b9c9bacea1516aabc344699/test-app/src/main/res/mipmap-hdpi/ic_launcher_background.png
--------------------------------------------------------------------------------
/test-app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/readium/kotlin-toolkit/38b1a810235409967b9c9bacea1516aabc344699/test-app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/test-app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/readium/kotlin-toolkit/38b1a810235409967b9c9bacea1516aabc344699/test-app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/test-app/src/main/res/mipmap-mdpi/ic_launcher_background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/readium/kotlin-toolkit/38b1a810235409967b9c9bacea1516aabc344699/test-app/src/main/res/mipmap-mdpi/ic_launcher_background.png
--------------------------------------------------------------------------------
/test-app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/readium/kotlin-toolkit/38b1a810235409967b9c9bacea1516aabc344699/test-app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/test-app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/readium/kotlin-toolkit/38b1a810235409967b9c9bacea1516aabc344699/test-app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/test-app/src/main/res/mipmap-xhdpi/ic_launcher_background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/readium/kotlin-toolkit/38b1a810235409967b9c9bacea1516aabc344699/test-app/src/main/res/mipmap-xhdpi/ic_launcher_background.png
--------------------------------------------------------------------------------
/test-app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/readium/kotlin-toolkit/38b1a810235409967b9c9bacea1516aabc344699/test-app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/test-app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/readium/kotlin-toolkit/38b1a810235409967b9c9bacea1516aabc344699/test-app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/test-app/src/main/res/mipmap-xxhdpi/ic_launcher_background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/readium/kotlin-toolkit/38b1a810235409967b9c9bacea1516aabc344699/test-app/src/main/res/mipmap-xxhdpi/ic_launcher_background.png
--------------------------------------------------------------------------------
/test-app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/readium/kotlin-toolkit/38b1a810235409967b9c9bacea1516aabc344699/test-app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/test-app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/readium/kotlin-toolkit/38b1a810235409967b9c9bacea1516aabc344699/test-app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/test-app/src/main/res/mipmap-xxxhdpi/ic_launcher_background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/readium/kotlin-toolkit/38b1a810235409967b9c9bacea1516aabc344699/test-app/src/main/res/mipmap-xxxhdpi/ic_launcher_background.png
--------------------------------------------------------------------------------
/test-app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/readium/kotlin-toolkit/38b1a810235409967b9c9bacea1516aabc344699/test-app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/test-app/src/main/res/navigation/about.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
14 |
--------------------------------------------------------------------------------
/test-app/src/main/res/navigation/bookshelf.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
14 |
--------------------------------------------------------------------------------
/test-app/src/main/res/navigation/navigation.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/test-app/src/main/res/values/arrays.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | - Import to app storage
5 | - Read from shared storage
6 | - Stream from the Web
7 |
8 |
9 |
--------------------------------------------------------------------------------
/test-app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
13 |
14 |
--------------------------------------------------------------------------------