diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml
index 8d81632f83..148fdd2469 100644
--- a/.idea/kotlinc.xml
+++ b/.idea/kotlinc.xml
@@ -1,6 +1,6 @@
-
+
\ No newline at end of file
diff --git a/README.md b/README.md
index 8a01013c21..56d91a6c64 100644
--- a/README.md
+++ b/README.md
@@ -10,7 +10,7 @@
| Readium | Android min SDK | Android compile SDK | Kotlin compiler (✻) | Gradle (✻) |
|---------|-----------------|---------------------|---------------------|------------|
-| 3.0.0 | 21 | 34 | 1.9.22 | 8.2.2 |
+| 3.0.0 | 21 | 34 | 1.9.24 | 8.6.0 |
| 2.3.0 | 21 | 33 | 1.7.10 | 6.9.3 |
✻ Only required if you integrate Readium as a submodule instead of using Maven Central.
diff --git a/buildSrc/src/main/kotlin/readium.library-conventions.gradle.kts b/buildSrc/src/main/kotlin/readium.library-conventions.gradle.kts
index ed4725d2b3..e86e6490bf 100644
--- a/buildSrc/src/main/kotlin/readium.library-conventions.gradle.kts
+++ b/buildSrc/src/main/kotlin/readium.library-conventions.gradle.kts
@@ -29,10 +29,6 @@ android {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
allWarningsAsErrors = true
- freeCompilerArgs = freeCompilerArgs + listOf(
- "-opt-in=kotlin.RequiresOptIn",
- "-opt-in=org.readium.r2.shared.InternalReadiumApi"
- )
}
testOptions {
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index 519dd3c27e..a8e0b4faaf 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -1,73 +1,74 @@
[versions]
-kotlin = "1.9.22"
-agp = "8.2.2"
+kotlin = "1.9.24"
+agp = "8.4.0"
desugar_jdk_libs = "2.0.4"
-gradle-maven-publish-plugin = "0.27.0"
+gradle-maven-publish-plugin = "0.28.0"
-accompanist = "0.34.0"
-
-androidx-activity = "1.8.2"
+androidx-activity = "1.9.0"
androidx-appcompat = "1.6.1"
-androidx-browser = "1.7.0"
+androidx-browser = "1.8.0"
androidx-cardview = "1.0.0"
# Make sure to align with the Kotlin version
# https://developer.android.com/jetpack/androidx/releases/compose-kotlin
-androidx-compose-compiler = "1.5.8"
-androidx-compose-animation = "1.6.0"
-androidx-compose-foundation = "1.6.0"
-androidx-compose-material = "1.6.0"
-androidx-compose-material3 = "1.1.2"
-androidx-compose-runtime = "1.6.0"
-androidx-compose-ui = "1.6.0"
+androidx-compose-compiler = "1.5.14"
+androidx-compose-animation = "1.6.7"
+androidx-compose-foundation = "1.6.7"
+androidx-compose-material = "1.6.7"
+androidx-compose-material3 = "1.2.1"
+androidx-compose-runtime = "1.6.7"
+androidx-compose-ui = "1.6.7"
androidx-constraintlayout = "2.1.4"
-androidx-core = "1.12.0"
-androidx-datastore = "1.0.0"
+androidx-core = "1.13.1"
+androidx-datastore = "1.1.1"
androidx-expresso-core = "3.5.1"
androidx-ext-junit = "1.1.5"
-androidx-fragment-ktx = "1.6.2"
+androidx-fragment-ktx = "1.7.1"
androidx-legacy = "1.0.0"
-androidx-lifecycle = "2.7.0"
+androidx-lifecycle = "2.8.0"
androidx-lifecycle-extensions = "2.2.0"
androidx-media = "1.7.0"
androidx-media2 = "1.3.0"
-androidx-media3 = "1.3.0"
-androidx-navigation = "2.7.6"
-androidx-paging = "3.2.1"
+androidx-media3 = "1.3.1"
+androidx-navigation = "2.7.7"
+androidx-paging = "3.3.0"
androidx-recyclerview = "1.3.2"
androidx-room = "2.6.1"
-androidx-viewpager2 = "1.0.0"
-androidx-webkit = "1.10.0"
+androidx-viewpager2 = "1.1.0"
+androidx-webkit = "1.11.0"
-assertj = "3.25.2"
+assertj = "3.25.3"
-dokka = "1.9.10"
+dokka = "1.9.20"
google-exoplayer = "2.19.1"
-google-material = "1.11.0"
+google-material = "1.12.0"
-joda-time = "2.12.6"
+joda-time = "2.12.7"
jsoup = "1.17.2"
junit = "4.13.2"
-kotlinx-coroutines = "1.7.3"
-kotlinx-coroutines-test = "1.7.3"
-kotlinx-datetime = "0.6.0-RC.2"
-kotlinx-serialization-json = "1.6.2"
+kotlinx-coroutines = "1.8.1"
+kotlinx-coroutines-test = "1.8.1"
+kotlinx-datetime = "0.6.0"
+kotlinx-serialization-json = "1.6.3"
# Make sure to align with the Kotlin version.
# See https://github.com/google/ksp/releases
-ksp = "1.9.22-1.0.16"
+ksp = "1.9.24-1.0.20"
ktlint = "11.5.1"
+# We cannot upgrade to 1.9.0 as it conflicts with liblcp.
+# See https://github.com/readium/kotlin-toolkit/issues/29
+#noinspection GradleDependency
pdfium = "1.8.2"
pdf-viewer = "2.8.2"
#noinspection GradleDependency
picasso = "2.8"
pspdfkit = "8.4.1"
-robolectric = "4.11.1"
+robolectric = "4.12.2"
timber = "5.0.1"
@@ -168,6 +169,4 @@ exoplayer = ["google-exoplayer-core", "google-exoplayer-ui", "google-exoplayer-m
lifecycle = ["androidx-lifecycle-common", "androidx-lifecycle-extensions", "androidx-lifecycle-livedata", "androidx-lifecycle-runtime", "androidx-lifecycle-viewmodel", "androidx-lifecycle-vmsavedstate", "androidx-lifecycle-viewmodel-compose"]
media2 = ["androidx-media2-session", "androidx-media2-player", "google-exoplayer-core", "google-exoplayer-extension-media2"]
media3 = ["androidx-media3-session", "androidx-media3-common", "androidx-media3-exoplayer"]
-navigation = ["androidx-navigation-fragment", "androidx-navigation-ui"]
room = ["androidx-room-runtime", "androidx-room-ktx"]
-test-frameworks = ["junit", "androidx-ext-junit", "androidx-expresso-core", "robolectric", "kotlin-junit", "assertj", "kotlinx-coroutines-test"]
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index a595206642..17655d0ef2 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
diff --git a/readium/adapters/exoplayer/audio/src/main/java/org/readium/adapter/exoplayer/audio/ExoPlayerEngineProvider.kt b/readium/adapters/exoplayer/audio/src/main/java/org/readium/adapter/exoplayer/audio/ExoPlayerEngineProvider.kt
index 63355d0aa1..1674c910d7 100644
--- a/readium/adapters/exoplayer/audio/src/main/java/org/readium/adapter/exoplayer/audio/ExoPlayerEngineProvider.kt
+++ b/readium/adapters/exoplayer/audio/src/main/java/org/readium/adapter/exoplayer/audio/ExoPlayerEngineProvider.kt
@@ -4,6 +4,8 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.adapter.exoplayer.audio
import android.app.Application
@@ -15,6 +17,7 @@ import org.readium.navigator.media.common.DefaultMediaMetadataProvider
import org.readium.navigator.media.common.MediaMetadataProvider
import org.readium.r2.navigator.extensions.time
import org.readium.r2.shared.ExperimentalReadiumApi
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.publication.Locator
import org.readium.r2.shared.publication.Publication
import org.readium.r2.shared.publication.indexOfFirstWithHref
diff --git a/readium/adapters/exoplayer/audio/src/main/java/org/readium/adapter/exoplayer/audio/ExoPlayerPreferencesEditor.kt b/readium/adapters/exoplayer/audio/src/main/java/org/readium/adapter/exoplayer/audio/ExoPlayerPreferencesEditor.kt
index c17da9f058..f040953744 100644
--- a/readium/adapters/exoplayer/audio/src/main/java/org/readium/adapter/exoplayer/audio/ExoPlayerPreferencesEditor.kt
+++ b/readium/adapters/exoplayer/audio/src/main/java/org/readium/adapter/exoplayer/audio/ExoPlayerPreferencesEditor.kt
@@ -4,6 +4,8 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.adapter.exoplayer.audio
import org.readium.r2.navigator.extensions.format
@@ -12,6 +14,7 @@ import org.readium.r2.navigator.preferences.PreferencesEditor
import org.readium.r2.navigator.preferences.RangePreference
import org.readium.r2.navigator.preferences.RangePreferenceDelegate
import org.readium.r2.shared.ExperimentalReadiumApi
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.publication.Metadata
/**
diff --git a/readium/adapters/pdfium/document/src/main/java/org/readium/adapter/pdfium/document/PdfiumDocument.kt b/readium/adapters/pdfium/document/src/main/java/org/readium/adapter/pdfium/document/PdfiumDocument.kt
index 712bc41537..78f3743601 100644
--- a/readium/adapters/pdfium/document/src/main/java/org/readium/adapter/pdfium/document/PdfiumDocument.kt
+++ b/readium/adapters/pdfium/document/src/main/java/org/readium/adapter/pdfium/document/PdfiumDocument.kt
@@ -4,6 +4,8 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.adapter.pdfium.document
import android.content.Context
diff --git a/readium/adapters/pdfium/navigator/src/main/java/org/readium/adapter/pdfium/navigator/PdfiumDocumentFragment.kt b/readium/adapters/pdfium/navigator/src/main/java/org/readium/adapter/pdfium/navigator/PdfiumDocumentFragment.kt
index 21911e3ad9..c9fe402325 100644
--- a/readium/adapters/pdfium/navigator/src/main/java/org/readium/adapter/pdfium/navigator/PdfiumDocumentFragment.kt
+++ b/readium/adapters/pdfium/navigator/src/main/java/org/readium/adapter/pdfium/navigator/PdfiumDocumentFragment.kt
@@ -4,6 +4,8 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.adapter.pdfium.navigator
import android.graphics.PointF
@@ -23,6 +25,7 @@ import org.readium.r2.navigator.preferences.Axis
import org.readium.r2.navigator.preferences.Fit
import org.readium.r2.navigator.preferences.ReadingProgression
import org.readium.r2.shared.ExperimentalReadiumApi
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.publication.LocalizedString
import org.readium.r2.shared.publication.Manifest
import org.readium.r2.shared.publication.Metadata
diff --git a/readium/adapters/pdfium/navigator/src/main/java/org/readium/adapter/pdfium/navigator/PdfiumEngineProvider.kt b/readium/adapters/pdfium/navigator/src/main/java/org/readium/adapter/pdfium/navigator/PdfiumEngineProvider.kt
index 5d8fe18863..749744f570 100644
--- a/readium/adapters/pdfium/navigator/src/main/java/org/readium/adapter/pdfium/navigator/PdfiumEngineProvider.kt
+++ b/readium/adapters/pdfium/navigator/src/main/java/org/readium/adapter/pdfium/navigator/PdfiumEngineProvider.kt
@@ -4,6 +4,8 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.adapter.pdfium.navigator
import android.graphics.PointF
@@ -16,6 +18,7 @@ import org.readium.r2.navigator.pdf.PdfEngineProvider
import org.readium.r2.navigator.util.SingleFragmentFactory
import org.readium.r2.navigator.util.createFragmentFactory
import org.readium.r2.shared.ExperimentalReadiumApi
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.publication.Metadata
import org.readium.r2.shared.publication.Publication
import org.readium.r2.shared.util.Url
diff --git a/readium/adapters/pdfium/navigator/src/main/java/org/readium/adapter/pdfium/navigator/PdfiumPreferencesEditor.kt b/readium/adapters/pdfium/navigator/src/main/java/org/readium/adapter/pdfium/navigator/PdfiumPreferencesEditor.kt
index fefd7eeedd..f2ce7f52f3 100644
--- a/readium/adapters/pdfium/navigator/src/main/java/org/readium/adapter/pdfium/navigator/PdfiumPreferencesEditor.kt
+++ b/readium/adapters/pdfium/navigator/src/main/java/org/readium/adapter/pdfium/navigator/PdfiumPreferencesEditor.kt
@@ -4,11 +4,14 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.adapter.pdfium.navigator
import org.readium.r2.navigator.extensions.format
import org.readium.r2.navigator.preferences.*
import org.readium.r2.shared.ExperimentalReadiumApi
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.publication.Metadata
/**
diff --git a/readium/adapters/pspdfkit/navigator/src/main/java/org/readium/adapter/pspdfkit/navigator/PsPdfKitDocumentFragment.kt b/readium/adapters/pspdfkit/navigator/src/main/java/org/readium/adapter/pspdfkit/navigator/PsPdfKitDocumentFragment.kt
index a2e0532f94..30205b0e2b 100644
--- a/readium/adapters/pspdfkit/navigator/src/main/java/org/readium/adapter/pspdfkit/navigator/PsPdfKitDocumentFragment.kt
+++ b/readium/adapters/pspdfkit/navigator/src/main/java/org/readium/adapter/pspdfkit/navigator/PsPdfKitDocumentFragment.kt
@@ -4,6 +4,8 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.adapter.pspdfkit.navigator
import android.graphics.PointF
@@ -51,6 +53,7 @@ import org.readium.r2.navigator.preferences.ReadingProgression
import org.readium.r2.navigator.preferences.Spread
import org.readium.r2.navigator.util.createViewModelFactory
import org.readium.r2.shared.ExperimentalReadiumApi
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.publication.Publication
import org.readium.r2.shared.publication.services.isProtected
import org.readium.r2.shared.util.Url
diff --git a/readium/adapters/pspdfkit/navigator/src/main/java/org/readium/adapter/pspdfkit/navigator/PsPdfKitEngineProvider.kt b/readium/adapters/pspdfkit/navigator/src/main/java/org/readium/adapter/pspdfkit/navigator/PsPdfKitEngineProvider.kt
index 580748f6f3..cd132e2b9b 100644
--- a/readium/adapters/pspdfkit/navigator/src/main/java/org/readium/adapter/pspdfkit/navigator/PsPdfKitEngineProvider.kt
+++ b/readium/adapters/pspdfkit/navigator/src/main/java/org/readium/adapter/pspdfkit/navigator/PsPdfKitEngineProvider.kt
@@ -4,6 +4,8 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.adapter.pspdfkit.navigator
import android.graphics.PointF
@@ -17,6 +19,7 @@ import org.readium.r2.navigator.preferences.Axis
import org.readium.r2.navigator.util.SingleFragmentFactory
import org.readium.r2.navigator.util.createFragmentFactory
import org.readium.r2.shared.ExperimentalReadiumApi
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.publication.Metadata
import org.readium.r2.shared.publication.Publication
import org.readium.r2.shared.util.Url
diff --git a/readium/adapters/pspdfkit/navigator/src/main/java/org/readium/adapter/pspdfkit/navigator/PsPdfKitPreferencesEditor.kt b/readium/adapters/pspdfkit/navigator/src/main/java/org/readium/adapter/pspdfkit/navigator/PsPdfKitPreferencesEditor.kt
index 3b1e5842a5..443098ab4d 100644
--- a/readium/adapters/pspdfkit/navigator/src/main/java/org/readium/adapter/pspdfkit/navigator/PsPdfKitPreferencesEditor.kt
+++ b/readium/adapters/pspdfkit/navigator/src/main/java/org/readium/adapter/pspdfkit/navigator/PsPdfKitPreferencesEditor.kt
@@ -4,6 +4,8 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.adapter.pspdfkit.navigator
import org.readium.r2.navigator.extensions.format
@@ -20,6 +22,7 @@ import org.readium.r2.navigator.preferences.RangePreferenceDelegate
import org.readium.r2.navigator.preferences.ReadingProgression
import org.readium.r2.navigator.preferences.Spread
import org.readium.r2.shared.ExperimentalReadiumApi
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.publication.Metadata
/**
diff --git a/readium/lcp/src/main/java/org/readium/r2/lcp/LcpContentProtection.kt b/readium/lcp/src/main/java/org/readium/r2/lcp/LcpContentProtection.kt
index ed6646c877..05bd616326 100644
--- a/readium/lcp/src/main/java/org/readium/r2/lcp/LcpContentProtection.kt
+++ b/readium/lcp/src/main/java/org/readium/r2/lcp/LcpContentProtection.kt
@@ -4,10 +4,13 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.lcp
import org.readium.r2.lcp.auth.LcpPassphraseAuthentication
import org.readium.r2.lcp.license.model.LicenseDocument
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.publication.encryption.Encryption
import org.readium.r2.shared.publication.encryption.encryption
import org.readium.r2.shared.publication.epub.EpubEncryptionParser
diff --git a/readium/lcp/src/main/java/org/readium/r2/lcp/LcpDecryptor.kt b/readium/lcp/src/main/java/org/readium/r2/lcp/LcpDecryptor.kt
index f1d68f516e..0032b014fe 100644
--- a/readium/lcp/src/main/java/org/readium/r2/lcp/LcpDecryptor.kt
+++ b/readium/lcp/src/main/java/org/readium/r2/lcp/LcpDecryptor.kt
@@ -7,8 +7,11 @@
* LICENSE file present in the project repository where this source code is maintained.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.lcp
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.extensions.coerceFirstNonNegative
import org.readium.r2.shared.extensions.inflate
import org.readium.r2.shared.extensions.requireLengthFitInt
diff --git a/readium/lcp/src/main/java/org/readium/r2/lcp/LcpDecryptorTest.kt b/readium/lcp/src/main/java/org/readium/r2/lcp/LcpDecryptorTest.kt
index bc38a882df..262529b2bb 100644
--- a/readium/lcp/src/main/java/org/readium/r2/lcp/LcpDecryptorTest.kt
+++ b/readium/lcp/src/main/java/org/readium/r2/lcp/LcpDecryptorTest.kt
@@ -8,10 +8,12 @@
*/
@file:Suppress("unused")
+@file:OptIn(InternalReadiumApi::class)
package org.readium.r2.lcp
import kotlin.math.ceil
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.extensions.coerceIn
import org.readium.r2.shared.publication.Publication
import org.readium.r2.shared.util.ErrorException
diff --git a/readium/lcp/src/main/java/org/readium/r2/lcp/auth/LcpDialogAuthentication.kt b/readium/lcp/src/main/java/org/readium/r2/lcp/auth/LcpDialogAuthentication.kt
index 02e513bce3..e1e4140c0e 100644
--- a/readium/lcp/src/main/java/org/readium/r2/lcp/auth/LcpDialogAuthentication.kt
+++ b/readium/lcp/src/main/java/org/readium/r2/lcp/auth/LcpDialogAuthentication.kt
@@ -4,6 +4,8 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.lcp.auth
import android.annotation.SuppressLint
@@ -33,6 +35,7 @@ import kotlinx.coroutines.withContext
import org.readium.r2.lcp.LcpAuthenticating
import org.readium.r2.lcp.R
import org.readium.r2.lcp.license.model.components.Link
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.extensions.tryOr
import org.readium.r2.shared.extensions.tryOrNull
import org.readium.r2.shared.util.AbsoluteUrl
diff --git a/readium/lcp/src/main/java/org/readium/r2/lcp/license/License.kt b/readium/lcp/src/main/java/org/readium/r2/lcp/license/License.kt
index 08996b0862..b46daa7134 100644
--- a/readium/lcp/src/main/java/org/readium/r2/lcp/license/License.kt
+++ b/readium/lcp/src/main/java/org/readium/r2/lcp/license/License.kt
@@ -7,6 +7,8 @@
* LICENSE file present in the project repository where this source code is maintained.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.lcp.license
import java.net.HttpURLConnection
@@ -29,6 +31,7 @@ import org.readium.r2.lcp.service.DeviceService
import org.readium.r2.lcp.service.LcpClient
import org.readium.r2.lcp.service.LicensesRepository
import org.readium.r2.lcp.service.NetworkService
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.extensions.tryOrNull
import org.readium.r2.shared.util.Instant
import org.readium.r2.shared.util.Try
diff --git a/readium/lcp/src/main/java/org/readium/r2/lcp/license/model/LicenseDocument.kt b/readium/lcp/src/main/java/org/readium/r2/lcp/license/model/LicenseDocument.kt
index 642b3694b3..0aceb7a87f 100644
--- a/readium/lcp/src/main/java/org/readium/r2/lcp/license/model/LicenseDocument.kt
+++ b/readium/lcp/src/main/java/org/readium/r2/lcp/license/model/LicenseDocument.kt
@@ -7,6 +7,8 @@
* LICENSE file present in the project repository where this source code is maintained.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.lcp.license.model
import java.nio.charset.Charset
@@ -20,6 +22,7 @@ import org.readium.r2.lcp.license.model.components.lcp.Rights
import org.readium.r2.lcp.license.model.components.lcp.Signature
import org.readium.r2.lcp.license.model.components.lcp.User
import org.readium.r2.lcp.service.URLParameters
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.extensions.optNullableString
import org.readium.r2.shared.util.AbsoluteUrl
import org.readium.r2.shared.util.Instant
diff --git a/readium/lcp/src/main/java/org/readium/r2/lcp/license/model/StatusDocument.kt b/readium/lcp/src/main/java/org/readium/r2/lcp/license/model/StatusDocument.kt
index 1df3f7a38e..a312b8a4d3 100644
--- a/readium/lcp/src/main/java/org/readium/r2/lcp/license/model/StatusDocument.kt
+++ b/readium/lcp/src/main/java/org/readium/r2/lcp/license/model/StatusDocument.kt
@@ -7,6 +7,8 @@
* LICENSE file present in the project repository where this source code is maintained.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.lcp.license.model
import java.nio.charset.Charset
@@ -19,6 +21,7 @@ import org.readium.r2.lcp.license.model.components.Links
import org.readium.r2.lcp.license.model.components.lsd.Event
import org.readium.r2.lcp.license.model.components.lsd.PotentialRights
import org.readium.r2.lcp.service.URLParameters
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.extensions.mapNotNull
import org.readium.r2.shared.extensions.optNullableString
import org.readium.r2.shared.util.Instant
diff --git a/readium/lcp/src/main/java/org/readium/r2/lcp/license/model/components/Link.kt b/readium/lcp/src/main/java/org/readium/r2/lcp/license/model/components/Link.kt
index c322e8d0f7..d4766e8e57 100644
--- a/readium/lcp/src/main/java/org/readium/r2/lcp/license/model/components/Link.kt
+++ b/readium/lcp/src/main/java/org/readium/r2/lcp/license/model/components/Link.kt
@@ -8,11 +8,14 @@
* LICENSE file present in the project repository where this source code is maintained.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.lcp.license.model.components
import org.json.JSONObject
import org.readium.r2.lcp.LcpError
import org.readium.r2.lcp.LcpException
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.extensions.optNullableInt
import org.readium.r2.shared.extensions.optNullableString
import org.readium.r2.shared.extensions.optStringsFromArrayOrSingle
diff --git a/readium/lcp/src/main/java/org/readium/r2/lcp/license/model/components/Links.kt b/readium/lcp/src/main/java/org/readium/r2/lcp/license/model/components/Links.kt
index 749783bcdb..befef7bdbd 100644
--- a/readium/lcp/src/main/java/org/readium/r2/lcp/license/model/components/Links.kt
+++ b/readium/lcp/src/main/java/org/readium/r2/lcp/license/model/components/Links.kt
@@ -7,10 +7,13 @@
* LICENSE file present in the project repository where this source code is maintained.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.lcp.license.model.components
import org.json.JSONArray
import org.json.JSONObject
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.extensions.mapNotNull
import org.readium.r2.shared.extensions.tryOrNull
import org.readium.r2.shared.util.mediatype.MediaType
diff --git a/readium/lcp/src/main/java/org/readium/r2/lcp/license/model/components/lcp/Rights.kt b/readium/lcp/src/main/java/org/readium/r2/lcp/license/model/components/lcp/Rights.kt
index b9161f0dff..728330f132 100644
--- a/readium/lcp/src/main/java/org/readium/r2/lcp/license/model/components/lcp/Rights.kt
+++ b/readium/lcp/src/main/java/org/readium/r2/lcp/license/model/components/lcp/Rights.kt
@@ -7,9 +7,12 @@
* LICENSE file present in the project repository where this source code is maintained.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.lcp.license.model.components.lcp
import org.json.JSONObject
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.extensions.optNullableInt
import org.readium.r2.shared.extensions.optNullableString
import org.readium.r2.shared.util.Instant
diff --git a/readium/lcp/src/main/java/org/readium/r2/lcp/license/model/components/lcp/Signature.kt b/readium/lcp/src/main/java/org/readium/r2/lcp/license/model/components/lcp/Signature.kt
index e17429c077..efb80ba0a7 100644
--- a/readium/lcp/src/main/java/org/readium/r2/lcp/license/model/components/lcp/Signature.kt
+++ b/readium/lcp/src/main/java/org/readium/r2/lcp/license/model/components/lcp/Signature.kt
@@ -7,11 +7,14 @@
* LICENSE file present in the project repository where this source code is maintained.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.lcp.license.model.components.lcp
import org.json.JSONObject
import org.readium.r2.lcp.LcpError
import org.readium.r2.lcp.LcpException
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.extensions.optNullableString
public data class Signature(val json: JSONObject) {
diff --git a/readium/lcp/src/main/java/org/readium/r2/lcp/license/model/components/lsd/Event.kt b/readium/lcp/src/main/java/org/readium/r2/lcp/license/model/components/lsd/Event.kt
index 48e07c6d86..634a2e10ec 100644
--- a/readium/lcp/src/main/java/org/readium/r2/lcp/license/model/components/lsd/Event.kt
+++ b/readium/lcp/src/main/java/org/readium/r2/lcp/license/model/components/lsd/Event.kt
@@ -7,9 +7,12 @@
* LICENSE file present in the project repository where this source code is maintained.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.lcp.license.model.components.lsd
import org.json.JSONObject
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.extensions.optNullableString
import org.readium.r2.shared.util.Instant
diff --git a/readium/lcp/src/main/java/org/readium/r2/lcp/license/model/components/lsd/PotentialRights.kt b/readium/lcp/src/main/java/org/readium/r2/lcp/license/model/components/lsd/PotentialRights.kt
index 6f97aeff45..80b4d1a7f2 100644
--- a/readium/lcp/src/main/java/org/readium/r2/lcp/license/model/components/lsd/PotentialRights.kt
+++ b/readium/lcp/src/main/java/org/readium/r2/lcp/license/model/components/lsd/PotentialRights.kt
@@ -7,9 +7,12 @@
* LICENSE file present in the project repository where this source code is maintained.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.lcp.license.model.components.lsd
import org.json.JSONObject
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.extensions.optNullableString
import org.readium.r2.shared.util.Instant
diff --git a/readium/lcp/src/main/java/org/readium/r2/lcp/service/LcpClient.kt b/readium/lcp/src/main/java/org/readium/r2/lcp/service/LcpClient.kt
index 5be0dd1dd7..88f7767e5c 100644
--- a/readium/lcp/src/main/java/org/readium/r2/lcp/service/LcpClient.kt
+++ b/readium/lcp/src/main/java/org/readium/r2/lcp/service/LcpClient.kt
@@ -1,8 +1,11 @@
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.lcp.service
import java.lang.reflect.InvocationTargetException
import org.readium.r2.lcp.LcpError
import org.readium.r2.lcp.LcpException
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.extensions.tryOr
internal object LcpClient {
diff --git a/readium/lcp/src/main/java/org/readium/r2/lcp/service/LicensesService.kt b/readium/lcp/src/main/java/org/readium/r2/lcp/service/LicensesService.kt
index 36ecd028fa..02ab0795fb 100644
--- a/readium/lcp/src/main/java/org/readium/r2/lcp/service/LicensesService.kt
+++ b/readium/lcp/src/main/java/org/readium/r2/lcp/service/LicensesService.kt
@@ -7,6 +7,8 @@
* LICENSE file present in the project repository where this source code is maintained.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.lcp.service
import android.content.Context
@@ -35,6 +37,7 @@ import org.readium.r2.lcp.license.container.WritableLicenseContainer
import org.readium.r2.lcp.license.container.createLicenseContainer
import org.readium.r2.lcp.license.model.LicenseDocument
import org.readium.r2.lcp.util.sha256
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.extensions.tryOrLog
import org.readium.r2.shared.publication.protection.ContentProtection
import org.readium.r2.shared.util.ErrorException
diff --git a/readium/lcp/src/main/java/org/readium/r2/lcp/util/Digest.kt b/readium/lcp/src/main/java/org/readium/r2/lcp/util/Digest.kt
index 5365e51b68..7277f68f32 100644
--- a/readium/lcp/src/main/java/org/readium/r2/lcp/util/Digest.kt
+++ b/readium/lcp/src/main/java/org/readium/r2/lcp/util/Digest.kt
@@ -4,10 +4,13 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.lcp.util
import java.io.File
import java.security.MessageDigest
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.extensions.tryOrNull
/**
diff --git a/readium/navigator-media2/src/main/java/org/readium/navigator/media2/DefaultMetadataFactory.kt b/readium/navigator-media2/src/main/java/org/readium/navigator/media2/DefaultMetadataFactory.kt
index 39821ff63b..1fc1257aad 100644
--- a/readium/navigator-media2/src/main/java/org/readium/navigator/media2/DefaultMetadataFactory.kt
+++ b/readium/navigator-media2/src/main/java/org/readium/navigator/media2/DefaultMetadataFactory.kt
@@ -1,4 +1,5 @@
@file:Suppress("DEPRECATION")
+@file:OptIn(InternalReadiumApi::class)
package org.readium.navigator.media2
@@ -8,6 +9,7 @@ import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Deferred
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.async
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.publication.Publication
import org.readium.r2.shared.publication.services.cover
diff --git a/readium/navigator/src/main/java/org/readium/r2/navigator/DecorableNavigator.kt b/readium/navigator/src/main/java/org/readium/r2/navigator/DecorableNavigator.kt
index d971cb4c2d..3555e85dfb 100644
--- a/readium/navigator/src/main/java/org/readium/r2/navigator/DecorableNavigator.kt
+++ b/readium/navigator/src/main/java/org/readium/r2/navigator/DecorableNavigator.kt
@@ -4,6 +4,8 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.navigator
import android.graphics.PointF
@@ -18,6 +20,7 @@ import kotlinx.coroutines.withContext
import kotlinx.parcelize.Parcelize
import kotlinx.parcelize.WriteWith
import org.json.JSONObject
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.JSONable
import org.readium.r2.shared.extensions.JSONParceler
import org.readium.r2.shared.publication.Locator
diff --git a/readium/navigator/src/main/java/org/readium/r2/navigator/Deprecated.kt b/readium/navigator/src/main/java/org/readium/r2/navigator/Deprecated.kt
index 0288affda4..1db8433c73 100644
--- a/readium/navigator/src/main/java/org/readium/r2/navigator/Deprecated.kt
+++ b/readium/navigator/src/main/java/org/readium/r2/navigator/Deprecated.kt
@@ -8,12 +8,14 @@
*/
@file:Suppress("UnusedReceiverParameter", "UnusedParameter")
+@file:OptIn(InternalReadiumApi::class)
package org.readium.r2.navigator
import kotlin.time.Duration
import kotlinx.coroutines.flow.Flow
import org.readium.r2.navigator.media.MediaPlayback
+import org.readium.r2.shared.InternalReadiumApi
@Deprecated("Use navigator fragments.", level = DeprecationLevel.ERROR)
public interface IR2Activity
diff --git a/readium/navigator/src/main/java/org/readium/r2/navigator/R2BasicWebView.kt b/readium/navigator/src/main/java/org/readium/r2/navigator/R2BasicWebView.kt
index 529ab33638..20b8a209ad 100644
--- a/readium/navigator/src/main/java/org/readium/r2/navigator/R2BasicWebView.kt
+++ b/readium/navigator/src/main/java/org/readium/r2/navigator/R2BasicWebView.kt
@@ -4,6 +4,8 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.navigator
import android.content.Context
diff --git a/readium/navigator/src/main/java/org/readium/r2/navigator/R2WebView.kt b/readium/navigator/src/main/java/org/readium/r2/navigator/R2WebView.kt
index 509e768786..a6cbda9ad7 100644
--- a/readium/navigator/src/main/java/org/readium/r2/navigator/R2WebView.kt
+++ b/readium/navigator/src/main/java/org/readium/r2/navigator/R2WebView.kt
@@ -7,6 +7,8 @@
* LICENSE file present in the project repository where this source code is maintained.
*/
+@file:Suppress("DEPRECATION")
+
package org.readium.r2.navigator
import android.content.Context
diff --git a/readium/navigator/src/main/java/org/readium/r2/navigator/epub/EpubNavigatorFactory.kt b/readium/navigator/src/main/java/org/readium/r2/navigator/epub/EpubNavigatorFactory.kt
index 359ce0e90d..9037f24040 100644
--- a/readium/navigator/src/main/java/org/readium/r2/navigator/epub/EpubNavigatorFactory.kt
+++ b/readium/navigator/src/main/java/org/readium/r2/navigator/epub/EpubNavigatorFactory.kt
@@ -4,10 +4,13 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.navigator.epub
import androidx.fragment.app.FragmentFactory
import org.readium.r2.shared.ExperimentalReadiumApi
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.publication.Link
import org.readium.r2.shared.publication.Locator
import org.readium.r2.shared.publication.Publication
diff --git a/readium/navigator/src/main/java/org/readium/r2/navigator/epub/EpubNavigatorFragment.kt b/readium/navigator/src/main/java/org/readium/r2/navigator/epub/EpubNavigatorFragment.kt
index f9fcad84da..f14dfa12c4 100644
--- a/readium/navigator/src/main/java/org/readium/r2/navigator/epub/EpubNavigatorFragment.kt
+++ b/readium/navigator/src/main/java/org/readium/r2/navigator/epub/EpubNavigatorFragment.kt
@@ -4,6 +4,8 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.navigator.epub
import android.content.SharedPreferences
@@ -80,6 +82,7 @@ import org.readium.r2.navigator.preferences.ReadingProgression
import org.readium.r2.navigator.util.createFragmentFactory
import org.readium.r2.shared.DelicateReadiumApi
import org.readium.r2.shared.ExperimentalReadiumApi
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.extensions.tryOrLog
import org.readium.r2.shared.publication.Href
import org.readium.r2.shared.publication.Link
diff --git a/readium/navigator/src/main/java/org/readium/r2/navigator/epub/EpubNavigatorViewModel.kt b/readium/navigator/src/main/java/org/readium/r2/navigator/epub/EpubNavigatorViewModel.kt
index 3366ac77b0..8d5c858577 100644
--- a/readium/navigator/src/main/java/org/readium/r2/navigator/epub/EpubNavigatorViewModel.kt
+++ b/readium/navigator/src/main/java/org/readium/r2/navigator/epub/EpubNavigatorViewModel.kt
@@ -4,7 +4,7 @@
* available in the top-level LICENSE file of the project.
*/
-@file:OptIn(ExperimentalReadiumApi::class)
+@file:OptIn(ExperimentalReadiumApi::class, InternalReadiumApi::class)
package org.readium.r2.navigator.epub
@@ -28,6 +28,7 @@ import org.readium.r2.navigator.preferences.*
import org.readium.r2.navigator.util.createViewModelFactory
import org.readium.r2.shared.DelicateReadiumApi
import org.readium.r2.shared.ExperimentalReadiumApi
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.extensions.mapStateIn
import org.readium.r2.shared.publication.Href
import org.readium.r2.shared.publication.Link
diff --git a/readium/navigator/src/main/java/org/readium/r2/navigator/epub/EpubPreferencesEditor.kt b/readium/navigator/src/main/java/org/readium/r2/navigator/epub/EpubPreferencesEditor.kt
index 7bdd1ed612..08b10c7d19 100644
--- a/readium/navigator/src/main/java/org/readium/r2/navigator/epub/EpubPreferencesEditor.kt
+++ b/readium/navigator/src/main/java/org/readium/r2/navigator/epub/EpubPreferencesEditor.kt
@@ -4,12 +4,15 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.navigator.epub
import org.readium.r2.navigator.epub.css.Layout
import org.readium.r2.navigator.extensions.format
import org.readium.r2.navigator.preferences.*
import org.readium.r2.shared.ExperimentalReadiumApi
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.publication.Metadata
import org.readium.r2.shared.publication.epub.EpubLayout
import org.readium.r2.shared.util.Language
diff --git a/readium/navigator/src/main/java/org/readium/r2/navigator/epub/WebViewServer.kt b/readium/navigator/src/main/java/org/readium/r2/navigator/epub/WebViewServer.kt
index 7a4047c264..6a24246aed 100644
--- a/readium/navigator/src/main/java/org/readium/r2/navigator/epub/WebViewServer.kt
+++ b/readium/navigator/src/main/java/org/readium/r2/navigator/epub/WebViewServer.kt
@@ -4,6 +4,8 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.navigator.epub
import android.app.Application
@@ -15,6 +17,7 @@ import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import org.readium.r2.navigator.epub.css.ReadiumCss
import org.readium.r2.shared.ExperimentalReadiumApi
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.publication.Href
import org.readium.r2.shared.publication.Link
import org.readium.r2.shared.publication.Publication
diff --git a/readium/navigator/src/main/java/org/readium/r2/navigator/epub/fxl/R2FXLLayout.kt b/readium/navigator/src/main/java/org/readium/r2/navigator/epub/fxl/R2FXLLayout.kt
index ec130cc2df..4404c9e9e9 100644
--- a/readium/navigator/src/main/java/org/readium/r2/navigator/epub/fxl/R2FXLLayout.kt
+++ b/readium/navigator/src/main/java/org/readium/r2/navigator/epub/fxl/R2FXLLayout.kt
@@ -7,6 +7,9 @@
* LICENSE file present in the project repository where this source code is maintained.
*/
+@file:Suppress("DEPRECATION")
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.navigator.epub.fxl
import android.annotation.SuppressLint
@@ -29,6 +32,7 @@ import java.util.Locale
import kotlin.math.min
import kotlin.math.roundToInt
import kotlin.math.roundToLong
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.extensions.equalsDelta
internal class R2FXLLayout : FrameLayout {
diff --git a/readium/navigator/src/main/java/org/readium/r2/navigator/extensions/Extensions.kt b/readium/navigator/src/main/java/org/readium/r2/navigator/extensions/Extensions.kt
index 233a2f12ee..3e70a8e332 100644
--- a/readium/navigator/src/main/java/org/readium/r2/navigator/extensions/Extensions.kt
+++ b/readium/navigator/src/main/java/org/readium/r2/navigator/extensions/Extensions.kt
@@ -2,10 +2,10 @@ package org.readium.r2.navigator.extensions
import android.app.Activity
import android.content.Context
+import android.view.View
import androidx.annotation.ColorInt
import androidx.annotation.ColorRes
import androidx.core.content.ContextCompat
-import androidx.core.view.ViewCompat
/**
* Extensions
@@ -14,7 +14,7 @@ import androidx.core.view.ViewCompat
/** returns true if the resolved layout direction of the content view in this
* activity is ViewCompat.LAYOUT_DIRECTION_RTL. Otherwise false. */
internal fun Activity.layoutDirectionIsRTL(): Boolean {
- return ViewCompat.getLayoutDirection(findViewById(android.R.id.content)) == ViewCompat.LAYOUT_DIRECTION_RTL
+ return findViewById(android.R.id.content).layoutDirection == View.LAYOUT_DIRECTION_RTL
}
@ColorInt
diff --git a/readium/navigator/src/main/java/org/readium/r2/navigator/extensions/Locator.kt b/readium/navigator/src/main/java/org/readium/r2/navigator/extensions/Locator.kt
index df8621dcec..fae3966245 100644
--- a/readium/navigator/src/main/java/org/readium/r2/navigator/extensions/Locator.kt
+++ b/readium/navigator/src/main/java/org/readium/r2/navigator/extensions/Locator.kt
@@ -7,6 +7,8 @@
* LICENSE file present in the project repository where this source code is maintained.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.navigator.extensions
import java.util.*
diff --git a/readium/navigator/src/main/java/org/readium/r2/navigator/image/ImageNavigatorFragment.kt b/readium/navigator/src/main/java/org/readium/r2/navigator/image/ImageNavigatorFragment.kt
index e01575854a..fcc5d4f99c 100644
--- a/readium/navigator/src/main/java/org/readium/r2/navigator/image/ImageNavigatorFragment.kt
+++ b/readium/navigator/src/main/java/org/readium/r2/navigator/image/ImageNavigatorFragment.kt
@@ -4,6 +4,8 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.navigator.image
import android.graphics.PointF
@@ -39,6 +41,7 @@ import org.readium.r2.navigator.preferences.ReadingProgression
import org.readium.r2.navigator.util.createFragmentFactory
import org.readium.r2.shared.DelicateReadiumApi
import org.readium.r2.shared.ExperimentalReadiumApi
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.publication.Link
import org.readium.r2.shared.publication.Locator
import org.readium.r2.shared.publication.Publication
diff --git a/readium/navigator/src/main/java/org/readium/r2/navigator/pager/R2EpubPageFragment.kt b/readium/navigator/src/main/java/org/readium/r2/navigator/pager/R2EpubPageFragment.kt
index 3ee03d1582..87935e9190 100755
--- a/readium/navigator/src/main/java/org/readium/r2/navigator/pager/R2EpubPageFragment.kt
+++ b/readium/navigator/src/main/java/org/readium/r2/navigator/pager/R2EpubPageFragment.kt
@@ -7,6 +7,8 @@
* LICENSE file present in the project repository where this source code is maintained.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.navigator.pager
import android.annotation.SuppressLint
diff --git a/readium/navigator/src/main/java/org/readium/r2/navigator/pager/R2FragmentPagerAdapter.kt b/readium/navigator/src/main/java/org/readium/r2/navigator/pager/R2FragmentPagerAdapter.kt
index 2c1c3df999..6f5871e996 100755
--- a/readium/navigator/src/main/java/org/readium/r2/navigator/pager/R2FragmentPagerAdapter.kt
+++ b/readium/navigator/src/main/java/org/readium/r2/navigator/pager/R2FragmentPagerAdapter.kt
@@ -81,7 +81,9 @@ internal abstract class R2FragmentPagerAdapter(private val mFragmentManager: Fra
}
if (fragment.isAdded && currentPosition != PagerAdapter.POSITION_NONE) {
- mSavedStates.put(fragmentKey, mFragmentManager.saveFragmentInstanceState(fragment))
+ mFragmentManager.saveFragmentInstanceState(fragment)?.let { state ->
+ mSavedStates.put(fragmentKey, state)
+ }
} else {
mSavedStates.remove(fragmentKey)
}
@@ -133,7 +135,7 @@ internal abstract class R2FragmentPagerAdapter(private val mFragmentManager: Fra
}
for (i in 0 until mFragments.size()) {
val f = mFragments.valueAt(i)
- if (f != null && f.isAdded) {
+ if (f.isAdded) {
if (state == null) {
state = Bundle()
}
@@ -153,14 +155,13 @@ internal abstract class R2FragmentPagerAdapter(private val mFragmentManager: Fra
mFragments.clear()
if (fss != null) {
for (fs in fss) {
- mSavedStates.put(
- fs,
- BundleCompat.getParcelable(
- bundle,
- fs.toString(),
- Fragment.SavedState::class.java
- )
- )
+ BundleCompat.getParcelable(
+ bundle,
+ fs.toString(),
+ Fragment.SavedState::class.java
+ )?.let { st ->
+ mSavedStates.put(fs, st)
+ }
}
}
val keys = bundle.keySet()
diff --git a/readium/navigator/src/main/java/org/readium/r2/navigator/pdf/PdfNavigatorFactory.kt b/readium/navigator/src/main/java/org/readium/r2/navigator/pdf/PdfNavigatorFactory.kt
index 827d8693d7..5efd93e4b2 100644
--- a/readium/navigator/src/main/java/org/readium/r2/navigator/pdf/PdfNavigatorFactory.kt
+++ b/readium/navigator/src/main/java/org/readium/r2/navigator/pdf/PdfNavigatorFactory.kt
@@ -4,6 +4,8 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.navigator.pdf
import androidx.fragment.app.FragmentFactory
@@ -11,6 +13,7 @@ import org.readium.r2.navigator.preferences.Configurable
import org.readium.r2.navigator.preferences.PreferencesEditor
import org.readium.r2.navigator.util.createFragmentFactory
import org.readium.r2.shared.ExperimentalReadiumApi
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.publication.Locator
import org.readium.r2.shared.publication.Publication
diff --git a/readium/navigator/src/main/java/org/readium/r2/navigator/pdf/PdfNavigatorFragment.kt b/readium/navigator/src/main/java/org/readium/r2/navigator/pdf/PdfNavigatorFragment.kt
index edc0f45b18..fdaf37e35a 100644
--- a/readium/navigator/src/main/java/org/readium/r2/navigator/pdf/PdfNavigatorFragment.kt
+++ b/readium/navigator/src/main/java/org/readium/r2/navigator/pdf/PdfNavigatorFragment.kt
@@ -4,6 +4,8 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.navigator.pdf
import android.os.Bundle
@@ -38,6 +40,7 @@ import org.readium.r2.navigator.util.SingleFragmentFactory
import org.readium.r2.navigator.util.createFragmentFactory
import org.readium.r2.shared.DelicateReadiumApi
import org.readium.r2.shared.ExperimentalReadiumApi
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.extensions.mapStateIn
import org.readium.r2.shared.publication.Link
import org.readium.r2.shared.publication.Locator
diff --git a/readium/navigator/src/main/java/org/readium/r2/navigator/pdf/PdfNavigatorViewModel.kt b/readium/navigator/src/main/java/org/readium/r2/navigator/pdf/PdfNavigatorViewModel.kt
index 04047bc21a..e80bea6fa3 100644
--- a/readium/navigator/src/main/java/org/readium/r2/navigator/pdf/PdfNavigatorViewModel.kt
+++ b/readium/navigator/src/main/java/org/readium/r2/navigator/pdf/PdfNavigatorViewModel.kt
@@ -4,6 +4,8 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.navigator.pdf
import android.app.Application
@@ -16,6 +18,7 @@ import kotlinx.coroutines.launch
import org.readium.r2.navigator.preferences.Configurable
import org.readium.r2.navigator.util.createViewModelFactory
import org.readium.r2.shared.ExperimentalReadiumApi
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.publication.Locator
import org.readium.r2.shared.publication.Publication
import org.readium.r2.shared.publication.services.positions
diff --git a/readium/navigator/src/main/java/org/readium/r2/navigator/preferences/ProgressionStrategy.kt b/readium/navigator/src/main/java/org/readium/r2/navigator/preferences/ProgressionStrategy.kt
index b8eca01445..2cd2f60e66 100644
--- a/readium/navigator/src/main/java/org/readium/r2/navigator/preferences/ProgressionStrategy.kt
+++ b/readium/navigator/src/main/java/org/readium/r2/navigator/preferences/ProgressionStrategy.kt
@@ -4,8 +4,11 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.navigator.preferences
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.extensions.equalsDelta
/**
diff --git a/readium/navigators/media/audio/src/main/java/org/readium/navigator/media/audio/AudioNavigator.kt b/readium/navigators/media/audio/src/main/java/org/readium/navigator/media/audio/AudioNavigator.kt
index 02c1b4d146..0b1f7e5c6e 100644
--- a/readium/navigators/media/audio/src/main/java/org/readium/navigator/media/audio/AudioNavigator.kt
+++ b/readium/navigators/media/audio/src/main/java/org/readium/navigator/media/audio/AudioNavigator.kt
@@ -4,6 +4,8 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.navigator.media.audio
import androidx.media3.common.Player
@@ -21,6 +23,7 @@ import org.readium.r2.navigator.extensions.time
import org.readium.r2.navigator.preferences.Configurable
import org.readium.r2.shared.DelicateReadiumApi
import org.readium.r2.shared.ExperimentalReadiumApi
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.extensions.mapStateIn
import org.readium.r2.shared.publication.Link
import org.readium.r2.shared.publication.Locator
diff --git a/readium/navigators/media/audio/src/main/java/org/readium/navigator/media/audio/AudioNavigatorFactory.kt b/readium/navigators/media/audio/src/main/java/org/readium/navigator/media/audio/AudioNavigatorFactory.kt
index 52356d206b..ef6b236221 100644
--- a/readium/navigators/media/audio/src/main/java/org/readium/navigator/media/audio/AudioNavigatorFactory.kt
+++ b/readium/navigators/media/audio/src/main/java/org/readium/navigator/media/audio/AudioNavigatorFactory.kt
@@ -4,6 +4,8 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.navigator.media.audio
import android.os.Build
@@ -16,6 +18,7 @@ import org.readium.r2.navigator.preferences.Configurable
import org.readium.r2.navigator.preferences.PreferencesEditor
import org.readium.r2.shared.DelicateReadiumApi
import org.readium.r2.shared.ExperimentalReadiumApi
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.publication.Link
import org.readium.r2.shared.publication.Locator
import org.readium.r2.shared.publication.Publication
diff --git a/readium/navigators/media/audio/src/main/java/org/readium/navigator/media/audio/MetadataRetriever.kt b/readium/navigators/media/audio/src/main/java/org/readium/navigator/media/audio/MetadataRetriever.kt
index 7c49ccb475..2030b75aa8 100644
--- a/readium/navigators/media/audio/src/main/java/org/readium/navigator/media/audio/MetadataRetriever.kt
+++ b/readium/navigators/media/audio/src/main/java/org/readium/navigator/media/audio/MetadataRetriever.kt
@@ -4,6 +4,8 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.navigator.media.audio
import android.media.MediaDataSource
@@ -15,6 +17,7 @@ import java.io.IOException
import kotlin.time.Duration
import kotlin.time.Duration.Companion.milliseconds
import kotlinx.coroutines.runBlocking
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.extensions.tryOrLog
import org.readium.r2.shared.util.ErrorException
import org.readium.r2.shared.util.getOrThrow
diff --git a/readium/navigators/media/common/src/main/java/org/readium/navigator/media/common/DefaultMediaMetadataFactory.kt b/readium/navigators/media/common/src/main/java/org/readium/navigator/media/common/DefaultMediaMetadataFactory.kt
index 2a09b9445a..c9f8bd1b00 100644
--- a/readium/navigators/media/common/src/main/java/org/readium/navigator/media/common/DefaultMediaMetadataFactory.kt
+++ b/readium/navigators/media/common/src/main/java/org/readium/navigator/media/common/DefaultMediaMetadataFactory.kt
@@ -4,6 +4,8 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.navigator.media.common
import android.graphics.Bitmap
@@ -13,6 +15,7 @@ import androidx.media3.common.MediaMetadata
import androidx.media3.common.MediaMetadata.PICTURE_TYPE_FRONT_COVER
import java.io.ByteArrayOutputStream
import kotlinx.coroutines.*
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.extensions.tryOrNull
import org.readium.r2.shared.publication.Publication
import org.readium.r2.shared.publication.services.coverFitting
diff --git a/readium/navigators/media/tts/src/main/java/org/readium/navigator/media/tts/TtsNavigator.kt b/readium/navigators/media/tts/src/main/java/org/readium/navigator/media/tts/TtsNavigator.kt
index 9a09914b19..6bd3702eb5 100644
--- a/readium/navigators/media/tts/src/main/java/org/readium/navigator/media/tts/TtsNavigator.kt
+++ b/readium/navigators/media/tts/src/main/java/org/readium/navigator/media/tts/TtsNavigator.kt
@@ -4,6 +4,8 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.navigator.media.tts
import androidx.media3.common.Player
@@ -17,6 +19,7 @@ import org.readium.r2.navigator.extensions.normalizeLocator
import org.readium.r2.navigator.preferences.Configurable
import org.readium.r2.shared.DelicateReadiumApi
import org.readium.r2.shared.ExperimentalReadiumApi
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.extensions.combineStateIn
import org.readium.r2.shared.extensions.mapStateIn
import org.readium.r2.shared.publication.Link
diff --git a/readium/navigators/media/tts/src/main/java/org/readium/navigator/media/tts/TtsNavigatorFactory.kt b/readium/navigators/media/tts/src/main/java/org/readium/navigator/media/tts/TtsNavigatorFactory.kt
index 27deebac6a..1af0cb61b7 100644
--- a/readium/navigators/media/tts/src/main/java/org/readium/navigator/media/tts/TtsNavigatorFactory.kt
+++ b/readium/navigators/media/tts/src/main/java/org/readium/navigator/media/tts/TtsNavigatorFactory.kt
@@ -4,6 +4,8 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.navigator.media.tts
import android.app.Application
@@ -20,6 +22,7 @@ import org.readium.r2.navigator.extensions.normalizeLocator
import org.readium.r2.navigator.preferences.PreferencesEditor
import org.readium.r2.shared.DelicateReadiumApi
import org.readium.r2.shared.ExperimentalReadiumApi
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.extensions.mapStateIn
import org.readium.r2.shared.publication.Locator
import org.readium.r2.shared.publication.Publication
diff --git a/readium/navigators/media/tts/src/main/java/org/readium/navigator/media/tts/TtsPlayer.kt b/readium/navigators/media/tts/src/main/java/org/readium/navigator/media/tts/TtsPlayer.kt
index 42ebdf4771..3b96fca7d5 100644
--- a/readium/navigators/media/tts/src/main/java/org/readium/navigator/media/tts/TtsPlayer.kt
+++ b/readium/navigators/media/tts/src/main/java/org/readium/navigator/media/tts/TtsPlayer.kt
@@ -4,6 +4,8 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.navigator.media.tts
import android.media.AudioAttributes
@@ -26,6 +28,7 @@ import kotlinx.coroutines.sync.Mutex
import kotlinx.coroutines.sync.withLock
import org.readium.r2.navigator.preferences.Configurable
import org.readium.r2.shared.ExperimentalReadiumApi
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.extensions.tryOrNull
import org.readium.r2.shared.publication.Locator
import org.readium.r2.shared.util.Error
diff --git a/readium/navigators/media/tts/src/main/java/org/readium/navigator/media/tts/TtsUtteranceIterator.kt b/readium/navigators/media/tts/src/main/java/org/readium/navigator/media/tts/TtsUtteranceIterator.kt
index f3179ab5a7..eb9d54dc24 100644
--- a/readium/navigators/media/tts/src/main/java/org/readium/navigator/media/tts/TtsUtteranceIterator.kt
+++ b/readium/navigators/media/tts/src/main/java/org/readium/navigator/media/tts/TtsUtteranceIterator.kt
@@ -4,9 +4,12 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.navigator.media.tts
import org.readium.r2.shared.ExperimentalReadiumApi
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.publication.Locator
import org.readium.r2.shared.publication.Publication
import org.readium.r2.shared.publication.indexOfFirstWithHref
diff --git a/readium/navigators/media/tts/src/main/java/org/readium/navigator/media/tts/android/AndroidTtsEngine.kt b/readium/navigators/media/tts/src/main/java/org/readium/navigator/media/tts/android/AndroidTtsEngine.kt
index 0639f30306..54b20d1b93 100644
--- a/readium/navigators/media/tts/src/main/java/org/readium/navigator/media/tts/android/AndroidTtsEngine.kt
+++ b/readium/navigators/media/tts/src/main/java/org/readium/navigator/media/tts/android/AndroidTtsEngine.kt
@@ -4,6 +4,8 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.navigator.media.tts.android
import android.annotation.SuppressLint
@@ -22,6 +24,7 @@ import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.asStateFlow
import org.readium.navigator.media.tts.TtsEngine
import org.readium.r2.shared.ExperimentalReadiumApi
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.extensions.tryOrNull
import org.readium.r2.shared.util.Language
diff --git a/readium/navigators/media/tts/src/main/java/org/readium/navigator/media/tts/android/AndroidTtsPreferencesEditor.kt b/readium/navigators/media/tts/src/main/java/org/readium/navigator/media/tts/android/AndroidTtsPreferencesEditor.kt
index 55138bf29f..286b2d02e1 100644
--- a/readium/navigators/media/tts/src/main/java/org/readium/navigator/media/tts/android/AndroidTtsPreferencesEditor.kt
+++ b/readium/navigators/media/tts/src/main/java/org/readium/navigator/media/tts/android/AndroidTtsPreferencesEditor.kt
@@ -4,11 +4,14 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.navigator.media.tts.android
import org.readium.r2.navigator.extensions.format
import org.readium.r2.navigator.preferences.*
import org.readium.r2.shared.ExperimentalReadiumApi
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.publication.Metadata
import org.readium.r2.shared.util.Language
diff --git a/readium/opds/src/main/java/org/readium/r2/opds/OPDS1Parser.kt b/readium/opds/src/main/java/org/readium/r2/opds/OPDS1Parser.kt
index 15cffc5e6f..9245fdb9b0 100644
--- a/readium/opds/src/main/java/org/readium/r2/opds/OPDS1Parser.kt
+++ b/readium/opds/src/main/java/org/readium/r2/opds/OPDS1Parser.kt
@@ -7,13 +7,30 @@
* LICENSE file present in the project repository where this source code is maintained.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.opds
import java.net.URL
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.extensions.toList
import org.readium.r2.shared.extensions.toMap
-import org.readium.r2.shared.opds.*
-import org.readium.r2.shared.publication.*
+import org.readium.r2.shared.opds.Acquisition
+import org.readium.r2.shared.opds.Facet
+import org.readium.r2.shared.opds.Feed
+import org.readium.r2.shared.opds.Group
+import org.readium.r2.shared.opds.ParseData
+import org.readium.r2.shared.opds.Price
+import org.readium.r2.shared.publication.Contributor
+import org.readium.r2.shared.publication.Href
+import org.readium.r2.shared.publication.Link
+import org.readium.r2.shared.publication.LocalizedString
+import org.readium.r2.shared.publication.Manifest
+import org.readium.r2.shared.publication.Metadata
+import org.readium.r2.shared.publication.Properties
+import org.readium.r2.shared.publication.Publication
+import org.readium.r2.shared.publication.PublicationCollection
+import org.readium.r2.shared.publication.Subject
import org.readium.r2.shared.toJSON
import org.readium.r2.shared.util.AbsoluteUrl
import org.readium.r2.shared.util.ErrorException
diff --git a/readium/opds/src/main/java/org/readium/r2/opds/OPDS2Parser.kt b/readium/opds/src/main/java/org/readium/r2/opds/OPDS2Parser.kt
index 5dbf20283e..21ffc6d230 100644
--- a/readium/opds/src/main/java/org/readium/r2/opds/OPDS2Parser.kt
+++ b/readium/opds/src/main/java/org/readium/r2/opds/OPDS2Parser.kt
@@ -7,7 +7,7 @@
* LICENSE file present in the project repository where this source code is maintained.
*/
-@file:OptIn(ExperimentalReadiumApi::class)
+@file:OptIn(ExperimentalReadiumApi::class, InternalReadiumApi::class)
package org.readium.r2.opds
@@ -15,6 +15,7 @@ import java.net.URL
import org.json.JSONArray
import org.json.JSONObject
import org.readium.r2.shared.ExperimentalReadiumApi
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.opds.Facet
import org.readium.r2.shared.opds.Feed
import org.readium.r2.shared.opds.Group
diff --git a/readium/shared/src/main/java/org/readium/r2/shared/Deprecated.kt b/readium/shared/src/main/java/org/readium/r2/shared/Deprecated.kt
index eaafca90a1..2a04b71ed1 100644
--- a/readium/shared/src/main/java/org/readium/r2/shared/Deprecated.kt
+++ b/readium/shared/src/main/java/org/readium/r2/shared/Deprecated.kt
@@ -8,6 +8,7 @@
*/
@file:Suppress("RemoveRedundantQualifierName")
+@file:OptIn(InternalReadiumApi::class)
package org.readium.r2.shared
diff --git a/readium/shared/src/main/java/org/readium/r2/shared/extensions/ByteArray.kt b/readium/shared/src/main/java/org/readium/r2/shared/extensions/ByteArray.kt
index 559efc460b..8a57fd17a7 100644
--- a/readium/shared/src/main/java/org/readium/r2/shared/extensions/ByteArray.kt
+++ b/readium/shared/src/main/java/org/readium/r2/shared/extensions/ByteArray.kt
@@ -7,6 +7,8 @@
* LICENSE file present in the project repository where this source code is maintained.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.shared.extensions
import java.io.ByteArrayOutputStream
diff --git a/readium/shared/src/main/java/org/readium/r2/shared/extensions/ContentResolver.kt b/readium/shared/src/main/java/org/readium/r2/shared/extensions/ContentResolver.kt
index 61d23f93a5..b202158fcd 100644
--- a/readium/shared/src/main/java/org/readium/r2/shared/extensions/ContentResolver.kt
+++ b/readium/shared/src/main/java/org/readium/r2/shared/extensions/ContentResolver.kt
@@ -7,10 +7,13 @@
* LICENSE file present in the project repository where this source code is maintained.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.shared.extensions
import android.content.ContentResolver
import android.net.Uri
+import org.readium.r2.shared.InternalReadiumApi
internal fun ContentResolver.queryProjection(uri: Uri, projection: String): String? =
tryOrLog {
diff --git a/readium/shared/src/main/java/org/readium/r2/shared/extensions/InputStream.kt b/readium/shared/src/main/java/org/readium/r2/shared/extensions/InputStream.kt
index 2d1e1441be..d60066edd6 100644
--- a/readium/shared/src/main/java/org/readium/r2/shared/extensions/InputStream.kt
+++ b/readium/shared/src/main/java/org/readium/r2/shared/extensions/InputStream.kt
@@ -11,6 +11,8 @@
*
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.shared.extensions
import java.io.ByteArrayOutputStream
@@ -19,6 +21,7 @@ import java.io.OutputStream
import java.util.*
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
+import org.readium.r2.shared.InternalReadiumApi
/**
* Copies this stream to the given output stream, returning the number of bytes copied
diff --git a/readium/shared/src/main/java/org/readium/r2/shared/extensions/JSON.kt b/readium/shared/src/main/java/org/readium/r2/shared/extensions/JSON.kt
index 9d811c538e..3fc4de4ce3 100644
--- a/readium/shared/src/main/java/org/readium/r2/shared/extensions/JSON.kt
+++ b/readium/shared/src/main/java/org/readium/r2/shared/extensions/JSON.kt
@@ -7,6 +7,8 @@
* LICENSE file present in the project repository where this source code is maintained.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.shared.extensions
import android.os.Parcel
diff --git a/readium/shared/src/main/java/org/readium/r2/shared/opds/Acquisition.kt b/readium/shared/src/main/java/org/readium/r2/shared/opds/Acquisition.kt
index 0ced3d2727..dd25cd8585 100644
--- a/readium/shared/src/main/java/org/readium/r2/shared/opds/Acquisition.kt
+++ b/readium/shared/src/main/java/org/readium/r2/shared/opds/Acquisition.kt
@@ -7,12 +7,15 @@
* LICENSE file present in the project repository where this source code is maintained.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.shared.opds
import android.os.Parcelable
import kotlinx.parcelize.Parcelize
import org.json.JSONArray
import org.json.JSONObject
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.JSONable
import org.readium.r2.shared.extensions.optNullableString
import org.readium.r2.shared.extensions.parseObjects
diff --git a/readium/shared/src/main/java/org/readium/r2/shared/opds/Availability.kt b/readium/shared/src/main/java/org/readium/r2/shared/opds/Availability.kt
index c41c00b15b..3d16030147 100644
--- a/readium/shared/src/main/java/org/readium/r2/shared/opds/Availability.kt
+++ b/readium/shared/src/main/java/org/readium/r2/shared/opds/Availability.kt
@@ -7,11 +7,14 @@
* LICENSE file present in the project repository where this source code is maintained.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.shared.opds
import android.os.Parcelable
import kotlinx.parcelize.Parcelize
import org.json.JSONObject
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.JSONable
import org.readium.r2.shared.extensions.optNullableString
import org.readium.r2.shared.util.Instant
diff --git a/readium/shared/src/main/java/org/readium/r2/shared/opds/Copies.kt b/readium/shared/src/main/java/org/readium/r2/shared/opds/Copies.kt
index c1a318d0d8..dd196f870f 100644
--- a/readium/shared/src/main/java/org/readium/r2/shared/opds/Copies.kt
+++ b/readium/shared/src/main/java/org/readium/r2/shared/opds/Copies.kt
@@ -7,11 +7,14 @@
* LICENSE file present in the project repository where this source code is maintained.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.shared.opds
import android.os.Parcelable
import kotlinx.parcelize.Parcelize
import org.json.JSONObject
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.JSONable
import org.readium.r2.shared.extensions.optPositiveInt
diff --git a/readium/shared/src/main/java/org/readium/r2/shared/opds/Holds.kt b/readium/shared/src/main/java/org/readium/r2/shared/opds/Holds.kt
index 4bf60ce4a9..b5e208c003 100644
--- a/readium/shared/src/main/java/org/readium/r2/shared/opds/Holds.kt
+++ b/readium/shared/src/main/java/org/readium/r2/shared/opds/Holds.kt
@@ -7,11 +7,14 @@
* LICENSE file present in the project repository where this source code is maintained.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.shared.opds
import android.os.Parcelable
import kotlinx.parcelize.Parcelize
import org.json.JSONObject
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.JSONable
import org.readium.r2.shared.extensions.optPositiveInt
diff --git a/readium/shared/src/main/java/org/readium/r2/shared/opds/Price.kt b/readium/shared/src/main/java/org/readium/r2/shared/opds/Price.kt
index 1d873a1cea..b913e7f943 100644
--- a/readium/shared/src/main/java/org/readium/r2/shared/opds/Price.kt
+++ b/readium/shared/src/main/java/org/readium/r2/shared/opds/Price.kt
@@ -7,11 +7,14 @@
* LICENSE file present in the project repository where this source code is maintained.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.shared.opds
import android.os.Parcelable
import kotlinx.parcelize.Parcelize
import org.json.JSONObject
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.JSONable
import org.readium.r2.shared.extensions.optNullableString
import org.readium.r2.shared.extensions.optPositiveDouble
diff --git a/readium/shared/src/main/java/org/readium/r2/shared/publication/Accessibility.kt b/readium/shared/src/main/java/org/readium/r2/shared/publication/Accessibility.kt
index 41fe0986dc..06783cb3a9 100644
--- a/readium/shared/src/main/java/org/readium/r2/shared/publication/Accessibility.kt
+++ b/readium/shared/src/main/java/org/readium/r2/shared/publication/Accessibility.kt
@@ -4,6 +4,8 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.shared.publication
import android.os.Parcelable
@@ -12,6 +14,7 @@ import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import org.json.JSONArray
import org.json.JSONObject
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.JSONable
import org.readium.r2.shared.extensions.*
import org.readium.r2.shared.publication.Accessibility.AccessMode.Companion.toJSONArray
diff --git a/readium/shared/src/main/java/org/readium/r2/shared/publication/Contributor.kt b/readium/shared/src/main/java/org/readium/r2/shared/publication/Contributor.kt
index dfa3d7c02b..0d0feda72a 100644
--- a/readium/shared/src/main/java/org/readium/r2/shared/publication/Contributor.kt
+++ b/readium/shared/src/main/java/org/readium/r2/shared/publication/Contributor.kt
@@ -7,12 +7,15 @@
* LICENSE file present in the project repository where this source code is maintained.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.shared.publication
import android.os.Parcelable
import kotlinx.parcelize.Parcelize
import org.json.JSONArray
import org.json.JSONObject
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.JSONable
import org.readium.r2.shared.extensions.optNullableDouble
import org.readium.r2.shared.extensions.optNullableString
diff --git a/readium/shared/src/main/java/org/readium/r2/shared/publication/Link.kt b/readium/shared/src/main/java/org/readium/r2/shared/publication/Link.kt
index 4460536f04..864cbc3c6b 100644
--- a/readium/shared/src/main/java/org/readium/r2/shared/publication/Link.kt
+++ b/readium/shared/src/main/java/org/readium/r2/shared/publication/Link.kt
@@ -7,6 +7,8 @@
* LICENSE file present in the project repository where this source code is maintained.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.shared.publication
import android.os.Parcelable
@@ -14,6 +16,7 @@ import kotlinx.parcelize.IgnoredOnParcel
import kotlinx.parcelize.Parcelize
import org.json.JSONArray
import org.json.JSONObject
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.JSONable
import org.readium.r2.shared.extensions.optNullableString
import org.readium.r2.shared.extensions.optPositiveDouble
diff --git a/readium/shared/src/main/java/org/readium/r2/shared/publication/LocalizedString.kt b/readium/shared/src/main/java/org/readium/r2/shared/publication/LocalizedString.kt
index bee448bab2..30e025cb09 100644
--- a/readium/shared/src/main/java/org/readium/r2/shared/publication/LocalizedString.kt
+++ b/readium/shared/src/main/java/org/readium/r2/shared/publication/LocalizedString.kt
@@ -7,12 +7,15 @@
* LICENSE file present in the project repository where this source code is maintained.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.shared.publication
import android.os.Parcelable
import java.util.*
import kotlinx.parcelize.Parcelize
import org.json.JSONObject
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.JSONable
import org.readium.r2.shared.extensions.optNullableString
import org.readium.r2.shared.util.logging.WarningLogger
diff --git a/readium/shared/src/main/java/org/readium/r2/shared/publication/Locator.kt b/readium/shared/src/main/java/org/readium/r2/shared/publication/Locator.kt
index 4a4b2c05b5..22f480b65e 100644
--- a/readium/shared/src/main/java/org/readium/r2/shared/publication/Locator.kt
+++ b/readium/shared/src/main/java/org/readium/r2/shared/publication/Locator.kt
@@ -7,6 +7,8 @@
* LICENSE file present in the project repository where this source code is maintained.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.shared.publication
import android.os.Parcelable
@@ -15,6 +17,7 @@ import kotlinx.parcelize.WriteWith
import org.json.JSONArray
import org.json.JSONObject
import org.readium.r2.shared.DelicateReadiumApi
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.JSONable
import org.readium.r2.shared.extensions.*
import org.readium.r2.shared.toJSON
diff --git a/readium/shared/src/main/java/org/readium/r2/shared/publication/Manifest.kt b/readium/shared/src/main/java/org/readium/r2/shared/publication/Manifest.kt
index ccadeeb927..96afbd08f2 100644
--- a/readium/shared/src/main/java/org/readium/r2/shared/publication/Manifest.kt
+++ b/readium/shared/src/main/java/org/readium/r2/shared/publication/Manifest.kt
@@ -7,10 +7,13 @@
* LICENSE file present in the project repository where this source code is maintained.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.shared.publication
import org.json.JSONArray
import org.json.JSONObject
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.JSONable
import org.readium.r2.shared.extensions.optStringsFromArrayOrSingle
import org.readium.r2.shared.extensions.putIfNotEmpty
diff --git a/readium/shared/src/main/java/org/readium/r2/shared/publication/Metadata.kt b/readium/shared/src/main/java/org/readium/r2/shared/publication/Metadata.kt
index e297726848..7d86ab8604 100644
--- a/readium/shared/src/main/java/org/readium/r2/shared/publication/Metadata.kt
+++ b/readium/shared/src/main/java/org/readium/r2/shared/publication/Metadata.kt
@@ -4,6 +4,8 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.shared.publication
import android.os.Parcelable
@@ -11,6 +13,7 @@ import kotlinx.parcelize.IgnoredOnParcel
import kotlinx.parcelize.Parcelize
import kotlinx.parcelize.WriteWith
import org.json.JSONObject
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.JSONable
import org.readium.r2.shared.extensions.JSONParceler
import org.readium.r2.shared.extensions.optPositiveDouble
diff --git a/readium/shared/src/main/java/org/readium/r2/shared/publication/Properties.kt b/readium/shared/src/main/java/org/readium/r2/shared/publication/Properties.kt
index 8386db5121..1c51b75e64 100644
--- a/readium/shared/src/main/java/org/readium/r2/shared/publication/Properties.kt
+++ b/readium/shared/src/main/java/org/readium/r2/shared/publication/Properties.kt
@@ -7,12 +7,15 @@
* LICENSE file present in the project repository where this source code is maintained.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.shared.publication
import android.os.Parcelable
import kotlinx.parcelize.Parcelize
import kotlinx.parcelize.WriteWith
import org.json.JSONObject
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.JSONable
import org.readium.r2.shared.extensions.JSONParceler
import org.readium.r2.shared.extensions.toMap
diff --git a/readium/shared/src/main/java/org/readium/r2/shared/publication/PublicationCollection.kt b/readium/shared/src/main/java/org/readium/r2/shared/publication/PublicationCollection.kt
index 201e5ee6ee..c6ae0fff9b 100644
--- a/readium/shared/src/main/java/org/readium/r2/shared/publication/PublicationCollection.kt
+++ b/readium/shared/src/main/java/org/readium/r2/shared/publication/PublicationCollection.kt
@@ -7,6 +7,8 @@
* LICENSE file present in the project repository where this source code is maintained.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.shared.publication
import android.os.Parcelable
@@ -14,6 +16,7 @@ import kotlinx.parcelize.Parcelize
import kotlinx.parcelize.WriteWith
import org.json.JSONArray
import org.json.JSONObject
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.JSONable
import org.readium.r2.shared.extensions.JSONParceler
import org.readium.r2.shared.extensions.mapNotNull
diff --git a/readium/shared/src/main/java/org/readium/r2/shared/publication/PublicationServicesHolder.kt b/readium/shared/src/main/java/org/readium/r2/shared/publication/PublicationServicesHolder.kt
index b412694df5..385650225a 100644
--- a/readium/shared/src/main/java/org/readium/r2/shared/publication/PublicationServicesHolder.kt
+++ b/readium/shared/src/main/java/org/readium/r2/shared/publication/PublicationServicesHolder.kt
@@ -4,9 +4,12 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.shared.publication
import kotlin.reflect.KClass
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.extensions.tryOrLog
import org.readium.r2.shared.util.SuspendingCloseable
diff --git a/readium/shared/src/main/java/org/readium/r2/shared/publication/ReadingProgression.kt b/readium/shared/src/main/java/org/readium/r2/shared/publication/ReadingProgression.kt
index d7e263e9ce..231c18dc7d 100644
--- a/readium/shared/src/main/java/org/readium/r2/shared/publication/ReadingProgression.kt
+++ b/readium/shared/src/main/java/org/readium/r2/shared/publication/ReadingProgression.kt
@@ -7,6 +7,8 @@
* LICENSE file present in the project repository where this source code is maintained.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.shared.publication
import android.os.Parcelable
@@ -14,6 +16,7 @@ import java.util.*
import kotlinx.parcelize.Parcelize
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.util.MapCompanion
@Serializable
diff --git a/readium/shared/src/main/java/org/readium/r2/shared/publication/Subject.kt b/readium/shared/src/main/java/org/readium/r2/shared/publication/Subject.kt
index 7159e09662..b2c33376a6 100644
--- a/readium/shared/src/main/java/org/readium/r2/shared/publication/Subject.kt
+++ b/readium/shared/src/main/java/org/readium/r2/shared/publication/Subject.kt
@@ -7,12 +7,15 @@
* LICENSE file present in the project repository where this source code is maintained.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.shared.publication
import android.os.Parcelable
import kotlinx.parcelize.Parcelize
import org.json.JSONArray
import org.json.JSONObject
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.JSONable
import org.readium.r2.shared.extensions.optNullableString
import org.readium.r2.shared.extensions.parseObjects
diff --git a/readium/shared/src/main/java/org/readium/r2/shared/publication/encryption/Encryption.kt b/readium/shared/src/main/java/org/readium/r2/shared/publication/encryption/Encryption.kt
index c1f2064432..01cec3e731 100644
--- a/readium/shared/src/main/java/org/readium/r2/shared/publication/encryption/Encryption.kt
+++ b/readium/shared/src/main/java/org/readium/r2/shared/publication/encryption/Encryption.kt
@@ -7,11 +7,14 @@
* LICENSE file present in the project repository where this source code is maintained.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.shared.publication.encryption
import android.os.Parcelable
import kotlinx.parcelize.Parcelize
import org.json.JSONObject
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.JSONable
import org.readium.r2.shared.extensions.optNullableLong
import org.readium.r2.shared.extensions.optNullableString
diff --git a/readium/shared/src/main/java/org/readium/r2/shared/publication/epub/EpubLayout.kt b/readium/shared/src/main/java/org/readium/r2/shared/publication/epub/EpubLayout.kt
index cebeeffabe..6a03479d59 100644
--- a/readium/shared/src/main/java/org/readium/r2/shared/publication/epub/EpubLayout.kt
+++ b/readium/shared/src/main/java/org/readium/r2/shared/publication/epub/EpubLayout.kt
@@ -7,10 +7,13 @@
* LICENSE file present in the project repository where this source code is maintained.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.shared.publication.epub
import android.os.Parcelable
import kotlinx.parcelize.Parcelize
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.util.MapCompanion
/**
diff --git a/readium/shared/src/main/java/org/readium/r2/shared/publication/html/DomRange.kt b/readium/shared/src/main/java/org/readium/r2/shared/publication/html/DomRange.kt
index 889b001272..3336744526 100644
--- a/readium/shared/src/main/java/org/readium/r2/shared/publication/html/DomRange.kt
+++ b/readium/shared/src/main/java/org/readium/r2/shared/publication/html/DomRange.kt
@@ -7,11 +7,14 @@
* LICENSE file present in the project repository where this source code is maintained.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.shared.publication.html
import android.os.Parcelable
import kotlinx.parcelize.Parcelize
import org.json.JSONObject
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.JSONable
import org.readium.r2.shared.extensions.optNullableString
import org.readium.r2.shared.extensions.optPositiveInt
diff --git a/readium/shared/src/main/java/org/readium/r2/shared/publication/presentation/Presentation.kt b/readium/shared/src/main/java/org/readium/r2/shared/publication/presentation/Presentation.kt
index c201993dd7..382516e038 100644
--- a/readium/shared/src/main/java/org/readium/r2/shared/publication/presentation/Presentation.kt
+++ b/readium/shared/src/main/java/org/readium/r2/shared/publication/presentation/Presentation.kt
@@ -6,6 +6,8 @@
* Use of this source code is governed by a BSD-style license which is detailed in the
* LICENSE file present in the project repository where this source code is maintained.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.shared.publication.presentation
import android.os.Parcelable
@@ -13,6 +15,7 @@ import kotlinx.parcelize.Parcelize
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import org.json.JSONObject
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.JSONable
import org.readium.r2.shared.extensions.optNullableBoolean
import org.readium.r2.shared.publication.Properties
diff --git a/readium/shared/src/main/java/org/readium/r2/shared/publication/services/content/iterators/HtmlResourceContentIterator.kt b/readium/shared/src/main/java/org/readium/r2/shared/publication/services/content/iterators/HtmlResourceContentIterator.kt
index 49e956b1fa..b2c53cad58 100644
--- a/readium/shared/src/main/java/org/readium/r2/shared/publication/services/content/iterators/HtmlResourceContentIterator.kt
+++ b/readium/shared/src/main/java/org/readium/r2/shared/publication/services/content/iterators/HtmlResourceContentIterator.kt
@@ -4,6 +4,8 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.shared.publication.services.content.iterators
import kotlinx.coroutines.Dispatchers
@@ -16,6 +18,7 @@ import org.jsoup.parser.Parser
import org.jsoup.select.NodeTraversor
import org.jsoup.select.NodeVisitor
import org.readium.r2.shared.ExperimentalReadiumApi
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.extensions.tryOrLog
import org.readium.r2.shared.extensions.tryOrNull
import org.readium.r2.shared.publication.Link
diff --git a/readium/shared/src/main/java/org/readium/r2/shared/util/Instant.kt b/readium/shared/src/main/java/org/readium/r2/shared/util/Instant.kt
index 0ad829d08b..4a211da223 100644
--- a/readium/shared/src/main/java/org/readium/r2/shared/util/Instant.kt
+++ b/readium/shared/src/main/java/org/readium/r2/shared/util/Instant.kt
@@ -1,3 +1,5 @@
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.shared.util
import android.os.Parcel
diff --git a/readium/shared/src/main/java/org/readium/r2/shared/util/Url.kt b/readium/shared/src/main/java/org/readium/r2/shared/util/Url.kt
index 0452446a9b..d810da031e 100644
--- a/readium/shared/src/main/java/org/readium/r2/shared/util/Url.kt
+++ b/readium/shared/src/main/java/org/readium/r2/shared/util/Url.kt
@@ -4,6 +4,8 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.shared.util
import android.net.Uri
diff --git a/readium/shared/src/main/java/org/readium/r2/shared/util/archive/ArchiveProperties.kt b/readium/shared/src/main/java/org/readium/r2/shared/util/archive/ArchiveProperties.kt
index c45fb03b31..da6c735bd8 100644
--- a/readium/shared/src/main/java/org/readium/r2/shared/util/archive/ArchiveProperties.kt
+++ b/readium/shared/src/main/java/org/readium/r2/shared/util/archive/ArchiveProperties.kt
@@ -4,9 +4,12 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.shared.util.archive
import org.json.JSONObject
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.JSONable
import org.readium.r2.shared.extensions.optNullableBoolean
import org.readium.r2.shared.extensions.optNullableLong
diff --git a/readium/shared/src/main/java/org/readium/r2/shared/util/cache/Cache.kt b/readium/shared/src/main/java/org/readium/r2/shared/util/cache/Cache.kt
index 09b96a11b6..cf62132fa6 100644
--- a/readium/shared/src/main/java/org/readium/r2/shared/util/cache/Cache.kt
+++ b/readium/shared/src/main/java/org/readium/r2/shared/util/cache/Cache.kt
@@ -4,6 +4,8 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.shared.util.cache
import kotlinx.coroutines.DelicateCoroutinesApi
diff --git a/readium/shared/src/main/java/org/readium/r2/shared/util/content/ContentResource.kt b/readium/shared/src/main/java/org/readium/r2/shared/util/content/ContentResource.kt
index 5bc8e04828..6919dc028d 100644
--- a/readium/shared/src/main/java/org/readium/r2/shared/util/content/ContentResource.kt
+++ b/readium/shared/src/main/java/org/readium/r2/shared/util/content/ContentResource.kt
@@ -4,6 +4,8 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.shared.util.content
import android.content.ContentResolver
@@ -15,6 +17,7 @@ import java.io.InputStream
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.runBlocking
import kotlinx.coroutines.withContext
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.extensions.*
import org.readium.r2.shared.util.AbsoluteUrl
import org.readium.r2.shared.util.DebugError
diff --git a/readium/shared/src/main/java/org/readium/r2/shared/util/data/Buffering.kt b/readium/shared/src/main/java/org/readium/r2/shared/util/data/Buffering.kt
index e38f64e029..ccb834617a 100644
--- a/readium/shared/src/main/java/org/readium/r2/shared/util/data/Buffering.kt
+++ b/readium/shared/src/main/java/org/readium/r2/shared/util/data/Buffering.kt
@@ -4,8 +4,11 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.shared.util.data
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.extensions.coerceIn
import org.readium.r2.shared.extensions.contains
import org.readium.r2.shared.extensions.requireLengthFitInt
diff --git a/readium/shared/src/main/java/org/readium/r2/shared/util/data/Decoding.kt b/readium/shared/src/main/java/org/readium/r2/shared/util/data/Decoding.kt
index c2d0ddb180..04ee329a08 100644
--- a/readium/shared/src/main/java/org/readium/r2/shared/util/data/Decoding.kt
+++ b/readium/shared/src/main/java/org/readium/r2/shared/util/data/Decoding.kt
@@ -4,6 +4,8 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.shared.util.data
import android.graphics.Bitmap
diff --git a/readium/shared/src/main/java/org/readium/r2/shared/util/file/FileResource.kt b/readium/shared/src/main/java/org/readium/r2/shared/util/file/FileResource.kt
index 0b982d655d..71363a6171 100644
--- a/readium/shared/src/main/java/org/readium/r2/shared/util/file/FileResource.kt
+++ b/readium/shared/src/main/java/org/readium/r2/shared/util/file/FileResource.kt
@@ -4,6 +4,8 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.shared.util.file
import java.io.File
@@ -13,6 +15,7 @@ import java.io.RandomAccessFile
import java.nio.channels.Channels
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.extensions.*
import org.readium.r2.shared.util.AbsoluteUrl
import org.readium.r2.shared.util.DebugError
diff --git a/readium/shared/src/main/java/org/readium/r2/shared/util/format/Sniffers.kt b/readium/shared/src/main/java/org/readium/r2/shared/util/format/Sniffers.kt
index d063eaeffa..d9571c3127 100644
--- a/readium/shared/src/main/java/org/readium/r2/shared/util/format/Sniffers.kt
+++ b/readium/shared/src/main/java/org/readium/r2/shared/util/format/Sniffers.kt
@@ -4,10 +4,13 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.shared.util.format
import java.util.Locale
import org.json.JSONObject
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.extensions.tryOrNull
import org.readium.r2.shared.publication.Link
import org.readium.r2.shared.publication.Manifest
diff --git a/readium/shared/src/main/java/org/readium/r2/shared/util/http/HttpError.kt b/readium/shared/src/main/java/org/readium/r2/shared/util/http/HttpError.kt
index a40c1733f5..eca3d119fa 100644
--- a/readium/shared/src/main/java/org/readium/r2/shared/util/http/HttpError.kt
+++ b/readium/shared/src/main/java/org/readium/r2/shared/util/http/HttpError.kt
@@ -4,9 +4,12 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.shared.util.http
import org.json.JSONObject
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.extensions.tryOrLog
import org.readium.r2.shared.util.Error
import org.readium.r2.shared.util.ThrowableError
diff --git a/readium/shared/src/main/java/org/readium/r2/shared/util/http/HttpResource.kt b/readium/shared/src/main/java/org/readium/r2/shared/util/http/HttpResource.kt
index 4f71d06c94..7761c657b7 100644
--- a/readium/shared/src/main/java/org/readium/r2/shared/util/http/HttpResource.kt
+++ b/readium/shared/src/main/java/org/readium/r2/shared/util/http/HttpResource.kt
@@ -4,6 +4,8 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.shared.util.http
import java.io.IOException
@@ -11,6 +13,7 @@ import java.io.InputStream
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import org.readium.r2.shared.ExperimentalReadiumApi
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.extensions.read
import org.readium.r2.shared.extensions.tryOrLog
import org.readium.r2.shared.util.AbsoluteUrl
diff --git a/readium/shared/src/main/java/org/readium/r2/shared/util/http/HttpResponse.kt b/readium/shared/src/main/java/org/readium/r2/shared/util/http/HttpResponse.kt
index a13c03ec12..04b4046f6b 100644
--- a/readium/shared/src/main/java/org/readium/r2/shared/util/http/HttpResponse.kt
+++ b/readium/shared/src/main/java/org/readium/r2/shared/util/http/HttpResponse.kt
@@ -4,8 +4,11 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.shared.util.http
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.util.AbsoluteUrl
import org.readium.r2.shared.util.mediatype.MediaType
diff --git a/readium/shared/src/main/java/org/readium/r2/shared/util/http/ProblemDetails.kt b/readium/shared/src/main/java/org/readium/r2/shared/util/http/ProblemDetails.kt
index 36a219c4c8..da7f8fc90d 100644
--- a/readium/shared/src/main/java/org/readium/r2/shared/util/http/ProblemDetails.kt
+++ b/readium/shared/src/main/java/org/readium/r2/shared/util/http/ProblemDetails.kt
@@ -4,11 +4,14 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.shared.util.http
import android.os.Parcelable
import kotlinx.parcelize.Parcelize
import org.json.JSONObject
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.extensions.optNullableInt
import org.readium.r2.shared.extensions.optNullableString
import org.readium.r2.shared.util.logging.WarningLogger
diff --git a/readium/shared/src/main/java/org/readium/r2/shared/util/pdf/PdfDocument.kt b/readium/shared/src/main/java/org/readium/r2/shared/util/pdf/PdfDocument.kt
index fdd56a1b48..03f0bad518 100644
--- a/readium/shared/src/main/java/org/readium/r2/shared/util/pdf/PdfDocument.kt
+++ b/readium/shared/src/main/java/org/readium/r2/shared/util/pdf/PdfDocument.kt
@@ -7,12 +7,15 @@
* LICENSE file present in the project repository where this source code is maintained.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.shared.util.pdf
import android.content.Context
import android.graphics.Bitmap
import kotlin.reflect.KClass
import org.readium.r2.shared.ExperimentalReadiumApi
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.publication.Link
import org.readium.r2.shared.publication.Publication
import org.readium.r2.shared.publication.PublicationServicesHolder
diff --git a/readium/shared/src/main/java/org/readium/r2/shared/util/resource/InMemoryResource.kt b/readium/shared/src/main/java/org/readium/r2/shared/util/resource/InMemoryResource.kt
index e85e2d379b..28797abd4a 100644
--- a/readium/shared/src/main/java/org/readium/r2/shared/util/resource/InMemoryResource.kt
+++ b/readium/shared/src/main/java/org/readium/r2/shared/util/resource/InMemoryResource.kt
@@ -4,9 +4,12 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.shared.util.resource
import kotlinx.coroutines.runBlocking
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.extensions.coerceFirstNonNegative
import org.readium.r2.shared.extensions.read
import org.readium.r2.shared.extensions.requireLengthFitInt
diff --git a/readium/shared/src/main/java/org/readium/r2/shared/util/resource/TransformingResource.kt b/readium/shared/src/main/java/org/readium/r2/shared/util/resource/TransformingResource.kt
index bf2172aa60..0770fc5095 100644
--- a/readium/shared/src/main/java/org/readium/r2/shared/util/resource/TransformingResource.kt
+++ b/readium/shared/src/main/java/org/readium/r2/shared/util/resource/TransformingResource.kt
@@ -4,8 +4,11 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.shared.util.resource
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.extensions.coerceIn
import org.readium.r2.shared.extensions.requireLengthFitInt
import org.readium.r2.shared.util.AbsoluteUrl
diff --git a/readium/shared/src/main/java/org/readium/r2/shared/util/zip/FileZipContainer.kt b/readium/shared/src/main/java/org/readium/r2/shared/util/zip/FileZipContainer.kt
index 7b175ebad5..82f34d7e54 100644
--- a/readium/shared/src/main/java/org/readium/r2/shared/util/zip/FileZipContainer.kt
+++ b/readium/shared/src/main/java/org/readium/r2/shared/util/zip/FileZipContainer.kt
@@ -4,6 +4,8 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.shared.util.zip
import java.io.File
@@ -13,6 +15,7 @@ import java.util.zip.ZipException
import java.util.zip.ZipFile
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.extensions.readFully
import org.readium.r2.shared.extensions.tryOrLog
import org.readium.r2.shared.util.AbsoluteUrl
diff --git a/readium/shared/src/main/java/org/readium/r2/shared/util/zip/StreamingZipArchiveProvider.kt b/readium/shared/src/main/java/org/readium/r2/shared/util/zip/StreamingZipArchiveProvider.kt
index 8bacbd26a5..b390d50665 100644
--- a/readium/shared/src/main/java/org/readium/r2/shared/util/zip/StreamingZipArchiveProvider.kt
+++ b/readium/shared/src/main/java/org/readium/r2/shared/util/zip/StreamingZipArchiveProvider.kt
@@ -4,12 +4,15 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.shared.util.zip
import java.io.File
import java.io.IOException
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.extensions.findInstance
import org.readium.r2.shared.util.AbsoluteUrl
import org.readium.r2.shared.util.Try
diff --git a/readium/shared/src/main/java/org/readium/r2/shared/util/zip/StreamingZipContainer.kt b/readium/shared/src/main/java/org/readium/r2/shared/util/zip/StreamingZipContainer.kt
index 584183d606..87a4ec28ea 100644
--- a/readium/shared/src/main/java/org/readium/r2/shared/util/zip/StreamingZipContainer.kt
+++ b/readium/shared/src/main/java/org/readium/r2/shared/util/zip/StreamingZipContainer.kt
@@ -4,10 +4,13 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.shared.util.zip
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.extensions.findInstance
import org.readium.r2.shared.extensions.readFully
import org.readium.r2.shared.extensions.tryOrLog
diff --git a/readium/shared/src/test/java/org/readium/r2/shared/extensions/JSONTest.kt b/readium/shared/src/test/java/org/readium/r2/shared/extensions/JSONTest.kt
index 86b0a59eed..88e3425ef4 100644
--- a/readium/shared/src/test/java/org/readium/r2/shared/extensions/JSONTest.kt
+++ b/readium/shared/src/test/java/org/readium/r2/shared/extensions/JSONTest.kt
@@ -1,3 +1,5 @@
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.shared.extensions
import org.json.JSONArray
@@ -6,6 +8,7 @@ import org.junit.Assert.assertEquals
import org.junit.Assert.assertNull
import org.junit.Test
import org.junit.runner.RunWith
+import org.readium.r2.shared.InternalReadiumApi
import org.robolectric.RobolectricTestRunner
@RunWith(RobolectricTestRunner::class)
diff --git a/readium/shared/src/test/java/org/readium/r2/shared/extensions/LongRangeTest.kt b/readium/shared/src/test/java/org/readium/r2/shared/extensions/LongRangeTest.kt
index 852fcfc59b..af22e2c490 100644
--- a/readium/shared/src/test/java/org/readium/r2/shared/extensions/LongRangeTest.kt
+++ b/readium/shared/src/test/java/org/readium/r2/shared/extensions/LongRangeTest.kt
@@ -1,7 +1,10 @@
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.shared.extensions
import kotlin.test.assertEquals
import org.junit.Test
+import org.readium.r2.shared.InternalReadiumApi
class LongRangeTest {
diff --git a/readium/shared/src/test/java/org/readium/r2/shared/extensions/URLTest.kt b/readium/shared/src/test/java/org/readium/r2/shared/extensions/URLTest.kt
index 1c17160783..4f03091079 100644
--- a/readium/shared/src/test/java/org/readium/r2/shared/extensions/URLTest.kt
+++ b/readium/shared/src/test/java/org/readium/r2/shared/extensions/URLTest.kt
@@ -7,11 +7,14 @@
* LICENSE file present in the project repository where this source code is maintained.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.shared.extensions
import java.net.URL
import org.junit.Assert.assertEquals
import org.junit.Test
+import org.readium.r2.shared.InternalReadiumApi
class URLTest {
diff --git a/readium/shared/src/test/java/org/readium/r2/shared/publication/encryption/EncryptionTest.kt b/readium/shared/src/test/java/org/readium/r2/shared/publication/encryption/EncryptionTest.kt
index 0117c028b7..3bcfd41cd8 100644
--- a/readium/shared/src/test/java/org/readium/r2/shared/publication/encryption/EncryptionTest.kt
+++ b/readium/shared/src/test/java/org/readium/r2/shared/publication/encryption/EncryptionTest.kt
@@ -7,6 +7,8 @@
* LICENSE file present in the project repository where this source code is maintained.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.shared.publication.encryption
import org.json.JSONObject
@@ -14,6 +16,7 @@ import org.junit.Assert.assertEquals
import org.junit.Assert.assertNull
import org.junit.Test
import org.junit.runner.RunWith
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.assertJSONEquals
import org.readium.r2.shared.extensions.toMap
import org.robolectric.RobolectricTestRunner
diff --git a/readium/shared/src/test/java/org/readium/r2/shared/publication/epub/EncryptionParserTest.kt b/readium/shared/src/test/java/org/readium/r2/shared/publication/epub/EncryptionParserTest.kt
index cae1bba7d5..84ecd6916f 100644
--- a/readium/shared/src/test/java/org/readium/r2/shared/publication/epub/EncryptionParserTest.kt
+++ b/readium/shared/src/test/java/org/readium/r2/shared/publication/epub/EncryptionParserTest.kt
@@ -7,12 +7,15 @@
* LICENSE file present in the project repository where this source code is maintained.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.shared.publication.epub
import org.assertj.core.api.Assertions.assertThat
import org.assertj.core.api.Assertions.entry
import org.junit.Test
import org.junit.runner.RunWith
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.publication.encryption.Encryption
import org.readium.r2.shared.util.Url
import org.readium.r2.shared.util.xml.XmlParser
diff --git a/readium/shared/src/test/java/org/readium/r2/shared/util/UrlTest.kt b/readium/shared/src/test/java/org/readium/r2/shared/util/UrlTest.kt
index ed214fba32..28aa142b0d 100644
--- a/readium/shared/src/test/java/org/readium/r2/shared/util/UrlTest.kt
+++ b/readium/shared/src/test/java/org/readium/r2/shared/util/UrlTest.kt
@@ -1,3 +1,5 @@
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.shared.util
import android.net.Uri
@@ -11,6 +13,7 @@ import org.junit.Assert.assertNull
import org.junit.Test
import org.junit.runner.RunWith
import org.readium.r2.shared.DelicateReadiumApi
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.util.Url.Query
import org.readium.r2.shared.util.Url.QueryParameter
import org.robolectric.RobolectricTestRunner
diff --git a/readium/shared/src/test/java/org/readium/r2/shared/util/xml/XmlParserTest.kt b/readium/shared/src/test/java/org/readium/r2/shared/util/xml/XmlParserTest.kt
index 5d336813ca..e18c6b9d31 100644
--- a/readium/shared/src/test/java/org/readium/r2/shared/util/xml/XmlParserTest.kt
+++ b/readium/shared/src/test/java/org/readium/r2/shared/util/xml/XmlParserTest.kt
@@ -7,6 +7,8 @@
* LICENSE file present in the project repository where this source code is maintained.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.shared.util.xml
import java.io.ByteArrayInputStream
@@ -14,6 +16,7 @@ import javax.xml.XMLConstants
import kotlin.test.assertEquals
import org.junit.Test
import org.junit.runner.RunWith
+import org.readium.r2.shared.InternalReadiumApi
import org.robolectric.RobolectricTestRunner
import org.xmlpull.v1.XmlPullParserException
diff --git a/readium/streamer/src/main/java/org/readium/r2/streamer/extensions/StringExt.kt b/readium/streamer/src/main/java/org/readium/r2/streamer/extensions/StringExt.kt
index 2fbc212831..21ae62e966 100644
--- a/readium/streamer/src/main/java/org/readium/r2/streamer/extensions/StringExt.kt
+++ b/readium/streamer/src/main/java/org/readium/r2/streamer/extensions/StringExt.kt
@@ -1,7 +1,10 @@
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.streamer.extensions
import com.mcxiaoke.koi.HASH
import com.mcxiaoke.koi.ext.toHexBytes
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.extensions.tryOrNull
/**
diff --git a/readium/streamer/src/main/java/org/readium/r2/streamer/parser/epub/EpubParser.kt b/readium/streamer/src/main/java/org/readium/r2/streamer/parser/epub/EpubParser.kt
index 7dcd219a8c..227555a601 100644
--- a/readium/streamer/src/main/java/org/readium/r2/streamer/parser/epub/EpubParser.kt
+++ b/readium/streamer/src/main/java/org/readium/r2/streamer/parser/epub/EpubParser.kt
@@ -4,9 +4,12 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.streamer.parser.epub
import org.readium.r2.shared.ExperimentalReadiumApi
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.publication.Link
import org.readium.r2.shared.publication.Publication
import org.readium.r2.shared.publication.encryption.Encryption
diff --git a/readium/streamer/src/main/java/org/readium/r2/streamer/parser/epub/MetadataAdapter.kt b/readium/streamer/src/main/java/org/readium/r2/streamer/parser/epub/MetadataAdapter.kt
index 00dd0f9f85..a69d8f20ee 100644
--- a/readium/streamer/src/main/java/org/readium/r2/streamer/parser/epub/MetadataAdapter.kt
+++ b/readium/streamer/src/main/java/org/readium/r2/streamer/parser/epub/MetadataAdapter.kt
@@ -4,8 +4,11 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.streamer.parser.epub
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.extensions.toMap
import org.readium.r2.shared.publication.*
import org.readium.r2.shared.publication.Collection
diff --git a/readium/streamer/src/main/java/org/readium/r2/streamer/parser/epub/MetadataParser.kt b/readium/streamer/src/main/java/org/readium/r2/streamer/parser/epub/MetadataParser.kt
index a42a1865ea..7b8e85491f 100644
--- a/readium/streamer/src/main/java/org/readium/r2/streamer/parser/epub/MetadataParser.kt
+++ b/readium/streamer/src/main/java/org/readium/r2/streamer/parser/epub/MetadataParser.kt
@@ -4,8 +4,11 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.streamer.parser.epub
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.publication.Href
import org.readium.r2.shared.util.Url
import org.readium.r2.shared.util.fromEpubHref
diff --git a/readium/streamer/src/main/java/org/readium/r2/streamer/parser/epub/NavigationDocumentParser.kt b/readium/streamer/src/main/java/org/readium/r2/streamer/parser/epub/NavigationDocumentParser.kt
index 6bfb25050a..6fb724e5b3 100644
--- a/readium/streamer/src/main/java/org/readium/r2/streamer/parser/epub/NavigationDocumentParser.kt
+++ b/readium/streamer/src/main/java/org/readium/r2/streamer/parser/epub/NavigationDocumentParser.kt
@@ -4,8 +4,11 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.streamer.parser.epub
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.publication.Link
import org.readium.r2.shared.util.Url
import org.readium.r2.shared.util.fromEpubHref
diff --git a/readium/streamer/src/main/java/org/readium/r2/streamer/parser/epub/NcxParser.kt b/readium/streamer/src/main/java/org/readium/r2/streamer/parser/epub/NcxParser.kt
index d71e3232a2..0ea495c5ac 100644
--- a/readium/streamer/src/main/java/org/readium/r2/streamer/parser/epub/NcxParser.kt
+++ b/readium/streamer/src/main/java/org/readium/r2/streamer/parser/epub/NcxParser.kt
@@ -4,8 +4,11 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.streamer.parser.epub
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.publication.Link
import org.readium.r2.shared.util.Url
import org.readium.r2.shared.util.fromEpubHref
diff --git a/readium/streamer/src/main/java/org/readium/r2/streamer/parser/epub/PackageDocument.kt b/readium/streamer/src/main/java/org/readium/r2/streamer/parser/epub/PackageDocument.kt
index 3dac8a7cb1..d036e6fc7a 100644
--- a/readium/streamer/src/main/java/org/readium/r2/streamer/parser/epub/PackageDocument.kt
+++ b/readium/streamer/src/main/java/org/readium/r2/streamer/parser/epub/PackageDocument.kt
@@ -4,8 +4,11 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.streamer.parser.epub
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.publication.ReadingProgression
import org.readium.r2.shared.util.Url
import org.readium.r2.shared.util.fromEpubHref
diff --git a/readium/streamer/src/main/java/org/readium/r2/streamer/parser/epub/ResourceAdapter.kt b/readium/streamer/src/main/java/org/readium/r2/streamer/parser/epub/ResourceAdapter.kt
index 53efbea449..91b4120388 100644
--- a/readium/streamer/src/main/java/org/readium/r2/streamer/parser/epub/ResourceAdapter.kt
+++ b/readium/streamer/src/main/java/org/readium/r2/streamer/parser/epub/ResourceAdapter.kt
@@ -4,8 +4,11 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.streamer.parser.epub
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.extensions.toMap
import org.readium.r2.shared.publication.Href
import org.readium.r2.shared.publication.Link
diff --git a/readium/streamer/src/main/java/org/readium/r2/streamer/parser/epub/SmilParser.kt b/readium/streamer/src/main/java/org/readium/r2/streamer/parser/epub/SmilParser.kt
index d5022197f4..47aa5314d4 100644
--- a/readium/streamer/src/main/java/org/readium/r2/streamer/parser/epub/SmilParser.kt
+++ b/readium/streamer/src/main/java/org/readium/r2/streamer/parser/epub/SmilParser.kt
@@ -4,8 +4,11 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.streamer.parser.epub
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.MediaOverlayNode
import org.readium.r2.shared.MediaOverlays
import org.readium.r2.shared.util.Url
diff --git a/readium/streamer/src/main/java/org/readium/r2/streamer/parser/pdf/PdfParser.kt b/readium/streamer/src/main/java/org/readium/r2/streamer/parser/pdf/PdfParser.kt
index f9d8910964..65ca51904c 100644
--- a/readium/streamer/src/main/java/org/readium/r2/streamer/parser/pdf/PdfParser.kt
+++ b/readium/streamer/src/main/java/org/readium/r2/streamer/parser/pdf/PdfParser.kt
@@ -4,10 +4,13 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.streamer.parser.pdf
import android.content.Context
import org.readium.r2.shared.ExperimentalReadiumApi
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.publication.*
import org.readium.r2.shared.publication.services.InMemoryCacheService
import org.readium.r2.shared.publication.services.InMemoryCoverService
diff --git a/readium/streamer/src/main/java/org/readium/r2/streamer/parser/readium/ReadiumWebPubParser.kt b/readium/streamer/src/main/java/org/readium/r2/streamer/parser/readium/ReadiumWebPubParser.kt
index 809593f2a6..605b2e46ec 100644
--- a/readium/streamer/src/main/java/org/readium/r2/streamer/parser/readium/ReadiumWebPubParser.kt
+++ b/readium/streamer/src/main/java/org/readium/r2/streamer/parser/readium/ReadiumWebPubParser.kt
@@ -4,9 +4,12 @@
* available in the top-level LICENSE file of the project.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.streamer.parser.readium
import android.content.Context
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.publication.Manifest
import org.readium.r2.shared.publication.Publication
import org.readium.r2.shared.publication.services.InMemoryCacheService
diff --git a/readium/streamer/src/test/java/org/readium/r2/streamer/parser/epub/NavigationDocumentParserTest.kt b/readium/streamer/src/test/java/org/readium/r2/streamer/parser/epub/NavigationDocumentParserTest.kt
index ee468858af..24bde97940 100644
--- a/readium/streamer/src/test/java/org/readium/r2/streamer/parser/epub/NavigationDocumentParserTest.kt
+++ b/readium/streamer/src/test/java/org/readium/r2/streamer/parser/epub/NavigationDocumentParserTest.kt
@@ -7,12 +7,15 @@
* LICENSE file present in the project repository where this source code is maintained.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.streamer.parser.epub
import org.assertj.core.api.Assertions.assertThat
import org.junit.Assert.assertNotNull
import org.junit.Test
import org.junit.runner.RunWith
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.publication.Href
import org.readium.r2.shared.publication.Link
import org.readium.r2.shared.util.Url
diff --git a/readium/streamer/src/test/java/org/readium/r2/streamer/parser/epub/NcxParserTest.kt b/readium/streamer/src/test/java/org/readium/r2/streamer/parser/epub/NcxParserTest.kt
index d090a33f63..9cc8f028b0 100644
--- a/readium/streamer/src/test/java/org/readium/r2/streamer/parser/epub/NcxParserTest.kt
+++ b/readium/streamer/src/test/java/org/readium/r2/streamer/parser/epub/NcxParserTest.kt
@@ -7,12 +7,15 @@
* LICENSE file present in the project repository where this source code is maintained.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.streamer.parser.epub
import org.assertj.core.api.Assertions
import org.junit.Assert.assertNotNull
import org.junit.Test
import org.junit.runner.RunWith
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.publication.Href
import org.readium.r2.shared.publication.Link
import org.readium.r2.shared.util.Url
diff --git a/readium/streamer/src/test/java/org/readium/r2/streamer/parser/epub/PackageDocumentTest.kt b/readium/streamer/src/test/java/org/readium/r2/streamer/parser/epub/PackageDocumentTest.kt
index 3c5eeef5b8..3c766d433d 100644
--- a/readium/streamer/src/test/java/org/readium/r2/streamer/parser/epub/PackageDocumentTest.kt
+++ b/readium/streamer/src/test/java/org/readium/r2/streamer/parser/epub/PackageDocumentTest.kt
@@ -7,11 +7,14 @@
* LICENSE file present in the project repository where this source code is maintained.
*/
+@file:OptIn(InternalReadiumApi::class)
+
package org.readium.r2.streamer.parser.epub
import org.assertj.core.api.Assertions.assertThat
import org.junit.Test
import org.junit.runner.RunWith
+import org.readium.r2.shared.InternalReadiumApi
import org.readium.r2.shared.publication.Href
import org.readium.r2.shared.publication.Link
import org.readium.r2.shared.publication.Manifest
diff --git a/test-app/src/main/java/org/readium/r2/testapp/reader/VisualReaderFragment.kt b/test-app/src/main/java/org/readium/r2/testapp/reader/VisualReaderFragment.kt
index a270d026a6..6b5f454fc0 100644
--- a/test-app/src/main/java/org/readium/r2/testapp/reader/VisualReaderFragment.kt
+++ b/test-app/src/main/java/org/readium/r2/testapp/reader/VisualReaderFragment.kt
@@ -222,7 +222,7 @@ abstract class VisualReaderFragment : BaseReaderFragment() {
viewLifecycleOwner.lifecycleScope.launch {
setupHighlights(viewLifecycleOwner.lifecycleScope)
setupSearch(viewLifecycleOwner.lifecycleScope)
- setupTts(viewLifecycleOwner.lifecycleScope)
+ setupTts()
}
}
@@ -245,7 +245,7 @@ abstract class VisualReaderFragment : BaseReaderFragment() {
/**
* Setup text-to-speech observers, if available.
*/
- private suspend fun setupTts(scope: CoroutineScope) {
+ private suspend fun setupTts() {
model.tts?.apply {
events
.observeWhenStarted(viewLifecycleOwner) { event ->
diff --git a/test-app/src/main/java/org/readium/r2/testapp/reader/preferences/UserPreferences.kt b/test-app/src/main/java/org/readium/r2/testapp/reader/preferences/UserPreferences.kt
index e20dcf2661..cc699995fa 100644
--- a/test-app/src/main/java/org/readium/r2/testapp/reader/preferences/UserPreferences.kt
+++ b/test-app/src/main/java/org/readium/r2/testapp/reader/preferences/UserPreferences.kt
@@ -595,7 +595,7 @@ private fun ReflowableUserPreferences(
@Composable
private fun Divider() {
- Divider(modifier = Modifier.padding(vertical = 16.dp))
+ HorizontalDivider(modifier = Modifier.padding(vertical = 16.dp))
}
@Composable
diff --git a/test-app/src/main/java/org/readium/r2/testapp/shared/views/Group.kt b/test-app/src/main/java/org/readium/r2/testapp/shared/views/Group.kt
index 968681bb84..2724920c4f 100644
--- a/test-app/src/main/java/org/readium/r2/testapp/shared/views/Group.kt
+++ b/test-app/src/main/java/org/readium/r2/testapp/shared/views/Group.kt
@@ -15,7 +15,7 @@ import org.readium.r2.testapp.utils.compose.LocalContentEmphasis
* Sets the emphasis (alpha) of a group of [Composable] views.
*/
@Composable
-fun Group(lowEmphasis: Boolean = false, enabled: Boolean = true, content: @Composable () -> Unit) {
+fun Group(enabled: Boolean = true, content: @Composable () -> Unit) {
val emphasis = when {
!enabled -> Emphasis.Disabled
else -> Emphasis.Medium