diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
new file mode 100644
index 0000000000..3c174129e8
--- /dev/null
+++ b/.idea/codeStyles/Project.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml
new file mode 100644
index 0000000000..79ee123c2b
--- /dev/null
+++ b/.idea/codeStyles/codeStyleConfig.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/CHANGELOG.md b/CHANGELOG.md
index dc00f65a3d..8d2a3ed33e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -27,6 +27,8 @@ All notable changes to this project will be documented in this file. Take a look
### Fixed
+* Fix building with Kotlin 1.6.
+
#### Navigator
* Fixed turning pages of an EPUB reflowable resource with an odd number of columns. A virtual blank trailing column is appended to the resource when displayed as two columns.
diff --git a/readium/lcp/src/main/java/org/readium/r2/lcp/license/LicenseValidation.kt b/readium/lcp/src/main/java/org/readium/r2/lcp/license/LicenseValidation.kt
index 8c1db5ec60..ded1fef6e1 100644
--- a/readium/lcp/src/main/java/org/readium/r2/lcp/license/LicenseValidation.kt
+++ b/readium/lcp/src/main/java/org/readium/r2/lcp/license/LicenseValidation.kt
@@ -280,6 +280,7 @@ internal class LicenseValidation(
is State.registerDevice -> registerDevice(state.documents.license, state.link)
is State.valid -> notifyObservers(state.documents, null)
is State.failure -> notifyObservers(null, state.error)
+ State.cancelled -> notifyObservers(null, null)
}
}
} catch (error: Exception) {
@@ -315,6 +316,8 @@ internal class LicenseValidation(
private suspend fun fetchStatus(license: LicenseDocument) {
val url = license.url(LicenseDocument.Rel.status, preferredType = MediaType.LCP_STATUS_DOCUMENT).toString()
// Short timeout to avoid blocking the License, since the LSD is optional.
+ // FIXME: To remove after bumping to Kotlin 1.6
+ @Suppress("DEPRECATION")
val data = network.fetch(url, timeout = Duration.seconds(5))
.getOrElse { throw LcpException.Network(it) }
@@ -329,6 +332,8 @@ internal class LicenseValidation(
private suspend fun fetchLicense(status: StatusDocument) {
val url = status.url(StatusDocument.Rel.license, preferredType = MediaType.LCP_LICENSE_DOCUMENT).toString()
// Short timeout to avoid blocking the License, since it can be updated next time.
+ // FIXME: To remove after bumping to Kotlin 1.6
+ @Suppress("DEPRECATION")
val data = network.fetch(url, timeout = Duration.seconds(5))
.getOrElse { throw LcpException.Network(it) }
diff --git a/readium/shared/src/test/java/org/readium/r2/shared/fetcher/ArchiveFetcherTest.kt b/readium/shared/src/test/java/org/readium/r2/shared/fetcher/ArchiveFetcherTest.kt
index 6b5195f447..bac5887199 100644
--- a/readium/shared/src/test/java/org/readium/r2/shared/fetcher/ArchiveFetcherTest.kt
+++ b/readium/shared/src/test/java/org/readium/r2/shared/fetcher/ArchiveFetcherTest.kt
@@ -92,7 +92,7 @@ class ArchiveFetcherTest {
@Test
fun `Reading a missing entry returns NotFound`() {
val resource = fetcher.get(Link(href = "/unknown"))
- assertFailsWith { resource.lengthBlocking().getOrThrow() }
+ assertFailsWith { resource.readBlocking().getOrThrow() }
}
@Test
diff --git a/test-app/src/main/java/org/readium/r2/testapp/reader/BaseReaderFragment.kt b/test-app/src/main/java/org/readium/r2/testapp/reader/BaseReaderFragment.kt
index 24f71a859c..18d66699a3 100644
--- a/test-app/src/main/java/org/readium/r2/testapp/reader/BaseReaderFragment.kt
+++ b/test-app/src/main/java/org/readium/r2/testapp/reader/BaseReaderFragment.kt
@@ -155,7 +155,7 @@ abstract class BaseReaderFragment : Fragment() {
private var mode: ActionMode? = null
// Available tint colors for highlight and underline annotations.
- private val highlightTints = mapOf<@IdRes Int, @ColorInt Int>(
+ private val highlightTints = mapOf*@IdRes*/ Int, /*@ColorInt*/ Int>(
R.id.red to Color.rgb(247, 124, 124),
R.id.green to Color.rgb(173, 247, 123),
R.id.blue to Color.rgb(124, 198, 247),