Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
bc4a8cc
Update versions
stevenzeck Jun 16, 2026
d6b49c4
Fix various deprecations
stevenzeck Jun 16, 2026
a565a7a
Use backing fields
stevenzeck Jun 17, 2026
8409135
Update to Room 3
stevenzeck Jul 6, 2026
590f36c
Update languageVersion in build.gradle files
stevenzeck Jul 23, 2026
135d418
Remove -Xannotation-default-target=param-property
stevenzeck Jul 23, 2026
e533c34
Revert AGP to 9.1.1
stevenzeck Jul 23, 2026
35b907c
Update Kotlin to 2.4.10
stevenzeck Jul 23, 2026
d6004da
Add comment about gradle version
stevenzeck Jul 23, 2026
c7bb57b
Replace java.util.UUID with kotlin.uuid.Uuid
stevenzeck Jul 23, 2026
45d3f5e
Merge branch 'develop' into sdk-dependency-updates
stevenzeck Jul 24, 2026
fe89090
Various updates
stevenzeck Aug 11, 2026
3f32136
Update maven publish plugin
stevenzeck Aug 11, 2026
d2f98a5
Fix tests
stevenzeck Aug 11, 2026
33b8ff8
Update kotlinc.xml
stevenzeck Aug 14, 2026
69ce1f9
Update libs.versions.toml
stevenzeck Aug 16, 2026
1d84c1c
Merge branch 'develop' into sdk-dependency-updates
stevenzeck Aug 25, 2026
0227781
Update minSdk to 24
stevenzeck Sep 1, 2026
ce775b1
Various updates
stevenzeck Sep 1, 2026
2475c45
Update WebKit
stevenzeck Sep 1, 2026
cb1b1b7
Update Kotlin and Gradle
stevenzeck Sep 8, 2026
a18ca9b
Update checks.yml
stevenzeck Sep 8, 2026
8f9a759
Merge branch 'develop' of github.com:readium/kotlin-toolkit into sdk-…
mickael-menu Sep 11, 2026
40fa327
Update README and CHANGELOG
mickael-menu Sep 11, 2026
e501277
Remove Room3 plugin from LCP
stevenzeck Sep 11, 2026
74c73d6
Remove ExplicitBackingFields back compilerOptions
stevenzeck Sep 11, 2026
3985630
Remove setDownloadFaviconsEnabled related code
stevenzeck Sep 11, 2026
ef6f3ca
Move sdk to robolectric.properties
stevenzeck Sep 11, 2026
8127e6f
Fixes
mickael-menu Sep 11, 2026
f844946
Merge branch 'sdk-dependency-updates' of github.com:stevenzeck/kotlin…
mickael-menu Sep 11, 2026
dc2da88
Apply batched suggestions from code review
mickael-menu Sep 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
push:
branches: [ main, develop ]
pull_request:
types: [ opened, synchronize, reopened, ready_for_review ]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
java-version: 17

- name: Publish to Maven Central
run: ./gradlew publishToMavenCentral --no-configuration-cache
run: ./gradlew publishToMavenCentral

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you change this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0.34.0 added support for configuration cache. I thought that was there because it wasn't compatible with publishToMavenCentral at the time. Can remove it if you want.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be, from: https://kotlinlang.org/docs/multiplatform/multiplatform-publish-libraries-to-maven.html#add-a-github-actions-workflow-to-your-project

Image

The linked issue is still marked as open, but the changelog you shared seems to contradict it. Let's try without and see if it works during the next release.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I read in that issue, it was because of publishing to the older Sonatype Nexus. Since they no longer publish there, the blocker from gradle/gradle#22779 no longer applied.

env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }}
Expand Down
3 changes: 2 additions & 1 deletion .idea/kotlinc.xml

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

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

## [Unreleased]

:warning: The minimum supported Android version is now API 24 (Android 7.0).

### Added

#### Navigator
Expand Down
2 changes: 1 addition & 1 deletion MAINTAINING.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ If the `Publish` workflow fails, you may need to publish to Maven Central manual
1. Make sure you have the secrets in `.envrc` and [direnv](https://direnv.net) installed.
2. Run:
```
./gradlew publishToMavenCentral --no-configuration-cache
./gradlew publishToMavenCentral
```
3. Sign in to https://central.sonatype.com/publishing/deployments
4. Publish manually the components
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Guides are available to help you make the most of the toolkit.

| Readium | Android min SDK | Android compile SDK | Kotlin compiler (✻) | Gradle (✻) |
|---------|-----------------|---------------------|---------------------|------------|
| `develop` | 23 | 36 | 2.3.20 | 9.1.0 |
| `develop` | 24 | 37 | 2.4.20 | 9.7.0 |
| 3.2.0 | 23 | 36 | 2.3.20 | 9.1.0 |
| 3.1.2 | 23 | 36 | 2.1.21 | 8.14.1 |
| 3.1.0 | 21 | 35 | 2.1.20 | 8.13 |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import com.vanniktech.maven.publish.SonatypeHost

plugins {
// FIXME: For now, we cannot use the versions catalog in precompiled scripts: https://github.com/gradle/gradle/issues/15383
id("com.android.library")
Expand Down Expand Up @@ -47,8 +45,7 @@ kotlin {
explicitApi()

compilerOptions {
freeCompilerArgs.add("-Xannotation-default-target=param-property")
languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_3
languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_4
allWarningsAsErrors = true
}
}
Expand Down Expand Up @@ -103,6 +100,6 @@ mavenPublishing {
}
}

publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)
publishToMavenCentral()
Comment thread
mickael-menu marked this conversation as resolved.
signAllPublications()
}
2 changes: 1 addition & 1 deletion demos/navigator/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ android {
kotlin {

compilerOptions {
languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_3
languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_4
freeCompilerArgs.add("-opt-in=kotlin.RequiresOptIn")
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import kotlinx.collections.immutable.toPersistentList
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.toList
import kotlinx.coroutines.flow.update
import org.readium.navigator.common.Decoration
import org.readium.navigator.common.DecorationLocation
Expand Down Expand Up @@ -90,14 +89,14 @@ sealed class HighlightsManager<D : DecorationLocation, G : GoLocation>(
tint = tint,
annotation = annotation
)
highlightsMutable.update { it.put(id, highlight) }
highlightsMutable.update { it.putting(id, highlight) }
return id
}

fun updateHighlightAnnotation(id: Long, annotation: String) {
val highlight = checkNotNull(highlightsMutable.value[id])
.copy(annotation = annotation)
highlightsMutable.update { it.put(id, highlight) }
highlightsMutable.update { it.putting(id, highlight) }
}

fun updateHighlightStyle(
Expand All @@ -108,11 +107,11 @@ sealed class HighlightsManager<D : DecorationLocation, G : GoLocation>(
val originalHighlight = checkNotNull(highlightsMutable.value[id])
val highlight = originalHighlight
.copy(style = style ?: originalHighlight.style, tint = tint ?: originalHighlight.tint)
highlightsMutable.update { it.put(id, highlight) }
highlightsMutable.update { it.putting(id, highlight) }
}

fun deleteHighlight(id: Long) {
highlightsMutable.update { it.remove(id) }
highlightsMutable.update { it.removing(id) }
}
}

Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
pom.groupId=org.readium.kotlin-toolkit
pom.version=3.3.0

android.minSdk=23
android.compileSdk=36
android.targetSdk=36
android.minSdk=24
android.compileSdk=37
android.targetSdk=37

# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
Expand Down
63 changes: 31 additions & 32 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,56 +1,56 @@
[versions]

# Keep compatibility with https://kotlinlang.org/docs/multiplatform/multiplatform-compatibility-guide.html#version-compatibility
kotlin = "2.3.20"
agp = "9.0.0"
kotlin = "2.4.20"
agp = "9.3.1"
Comment thread
mickael-menu marked this conversation as resolved.

desugar_jdk_libs = "2.1.5"
gradle-maven-publish-plugin = "0.32.0"
gradle-maven-publish-plugin = "0.37.0"

androidx-activity = "1.13.0"
androidx-annotation = "1.10.0"
androidx-appcompat = "1.7.1"
androidx-appcompat = "1.8.0"
androidx-browser = "1.10.0"
androidx-cardview = "1.0.0"

# Keep compatibility with https://kotlinlang.org/docs/multiplatform/compose-compatibility-and-versioning.html#jetpack-compose-artifacts-used
androidx-compose-animation = "1.10.5"
androidx-compose-foundation = "1.10.5"
androidx-compose-material = "1.10.5"
androidx-compose-runtime = "1.10.5"
androidx-compose-ui = "1.10.5"
androidx-compose-animation = "1.12.0"
androidx-compose-foundation = "1.12.0"
androidx-compose-material = "1.12.0"
androidx-compose-runtime = "1.12.0"
androidx-compose-ui = "1.12.0"

androidx-compose-material3 = "1.4.0"
androidx-constraintlayout = "2.2.1"
androidx-core = "1.18.0"
androidx-constraintlayout = "2.2.2"
androidx-core = "1.19.0"
androidx-datastore = "1.2.1"
androidx-fragment-ktx = "1.8.9"
androidx-fragment-ktx = "1.9.0"
androidx-legacy = "1.0.0"
androidx-lifecycle = "2.10.0"
androidx-media3 = "1.10.0"
androidx-navigation = "2.9.7"
androidx-paging = "3.4.2"
androidx-lifecycle = "2.11.0"
androidx-media3 = "1.11.0"
androidx-navigation = "2.10.0"
androidx-paging = "3.5.1"
androidx-recyclerview = "1.4.0"
androidx-room = "2.8.4"
androidx-room3 = "3.0.2"
androidx-viewpager2 = "1.1.0"
androidx-webkit = "1.15.0"
androidx-webkit = "1.17.0"

assertj = "3.27.7"

dokka = "2.2.0"

google-material = "1.13.0"
google-material = "1.14.0"

jsoup = "1.22.2"
jsoup = "1.23.2"
junit = "4.13.2"

kotlinx-coroutines = "1.10.2"
kotlinx-coroutines-test = "1.10.2"
kotlinx-datetime = "0.7.1"
kotlinx-serialization-json = "1.10.0"
kotlinx-collections-immutable = "0.4.0"
kotlinx-coroutines = "1.11.0"
kotlinx-coroutines-test = "1.11.0"
kotlinx-datetime = "0.8.0"
kotlinx-serialization-json = "1.11.0"
kotlinx-collections-immutable = "0.5.2"

ksp = "2.3.4"
ksp = "2.3.9"

ktlint = "14.2.0"

Expand All @@ -62,7 +62,7 @@ picasso = "2.8"
pspdfkit = "8.4.1"

robolectric = "4.16.1"
mockk = "1.14.9"
mockk = "1.14.11"

timber = "5.0.1"

Expand Down Expand Up @@ -95,9 +95,8 @@ androidx-navigation-fragment = { group = "androidx.navigation", name = "navigati
androidx-navigation-ui = { group = "androidx.navigation", name = "navigation-ui-ktx", version.ref = "androidx-navigation" }
androidx-paging = { group = "androidx.paging", name = "paging-runtime-ktx", version.ref = "androidx-paging" }
androidx-recyclerview = { group = "androidx.recyclerview", name = "recyclerview", version.ref = "androidx-recyclerview" }
androidx-room-runtime = { group = "androidx.room", name = "room-runtime", version.ref = "androidx-room" }
androidx-room-ktx = { group = "androidx.room", name = "room-ktx", version.ref = "androidx-room" }
androidx-room-compiler = { group = "androidx.room", name = "room-compiler", version.ref = "androidx-room" }
androidx-room3 = { group = "androidx.room3", name = "room3-runtime", version.ref = "androidx-room3" }
androidx-room3-compiler = { group = "androidx.room3", name = "room3-compiler", version.ref = "androidx-room3" }
androidx-viewpager2 = { group = "androidx.viewpager2", name = "viewpager2", version.ref = "androidx-viewpager2" }
androidx-webkit = { group = "androidx.webkit", name = "webkit", version.ref = "androidx-webkit" }

Expand Down Expand Up @@ -136,13 +135,13 @@ plugin-dokka = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version.ref

[plugins]

androidx-room3 = { id = "androidx.room3", version.ref = "androidx-room3" }
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
ktlint = { id = "org.jlleitschuh.gradle.ktlint", version.ref = "ktlint" }
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }

[bundles]

compose = ["androidx-compose-activity", "androidx-compose-animation", "androidx-compose-foundation", "androidx-compose-material", "androidx-compose-material3", "androidx-compose-runtime", "androidx-compose-ui", "androidx-compose-ui-tooling"]
media3 = ["androidx-media3-session", "androidx-media3-common", "androidx-media3-exoplayer"]
room = ["androidx-room-runtime", "androidx-room-ktx"]
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip
# Keep compatibility with https://kotlinlang.org/docs/multiplatform/multiplatform-compatibility-guide.html#version-compatibility
distributionUrl=https\://services.gradle.org/distributions/gradle-9.7.0-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ public class ExoPlayerEngine private constructor(
}

override fun onEvents(player: Player, events: Player.Events) {
_playback.value = exoPlayer.playback
playback.value = exoPlayer.playback
}
}

Expand All @@ -201,12 +201,6 @@ public class ExoPlayerEngine private constructor(
exoPlayer.addListener(Listener())
}

private val _settings: MutableStateFlow<ExoPlayerSettings> =
MutableStateFlow(settingsResolver.settings(initialPreferences))

private val _playback: MutableStateFlow<AudioEngine.Playback> =
MutableStateFlow(exoPlayer.playback)

private val sessionPlayer = object :
ForwardingPlayer(exoPlayer) {

Expand All @@ -228,18 +222,18 @@ public class ExoPlayerEngine private constructor(
val positionRefreshDelay = (1.0 / configuration.positionRefreshRate.value).seconds
while (isActive) {
delay(positionRefreshDelay)
_playback.value = exoPlayer.playback
playback.value = exoPlayer.playback
}
}

submitPreferences(initialPreferences)
}

override val playback: StateFlow<AudioEngine.Playback>
get() = _playback.asStateFlow()
field = MutableStateFlow(exoPlayer.playback)
Comment thread
mickael-menu marked this conversation as resolved.

override val settings: StateFlow<ExoPlayerSettings>
get() = _settings.asStateFlow()
field = MutableStateFlow(settingsResolver.settings(initialPreferences))

override fun play() {
exoPlayer.play()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public class PdfiumDocumentFragment internal constructor(

private lateinit var resetJob: SingleJob

private fun reset(pageIndex: Int = _pageIndex.value) {
private fun reset(pageIndex: Int = this.pageIndex.value) {
if (view == null) return
val context = context?.applicationContext ?: return

Expand Down Expand Up @@ -140,7 +140,7 @@ public class PdfiumDocumentFragment internal constructor(
}
}
.onPageChange { index, _ ->
_pageIndex.value = convertPageIndexFromView(index)
this@PdfiumDocumentFragment.pageIndex.value = convertPageIndexFromView(index)
}
.onTap { event ->
listener?.onTap(PointF(event.x, event.y)) ?: false
Expand All @@ -151,8 +151,8 @@ public class PdfiumDocumentFragment internal constructor(

private var pageCount = 0

private val _pageIndex = MutableStateFlow(initialPageIndex)
override val pageIndex: StateFlow<Int> = _pageIndex.asStateFlow()
override val pageIndex: StateFlow<Int>
field = MutableStateFlow(initialPageIndex)
Comment thread
mickael-menu marked this conversation as resolved.

override fun goToPageIndex(index: Int, animated: Boolean): Boolean {
if (!isValidPageIndex(index)) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sdk=30
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
package org.readium.adapter.pspdfkit.document

import com.pspdfkit.document.providers.DataProvider
import java.util.UUID
import kotlin.uuid.Uuid
import kotlinx.coroutines.runBlocking
import org.readium.r2.shared.util.data.ReadError
import org.readium.r2.shared.util.getOrElse
Expand Down Expand Up @@ -47,7 +47,7 @@ internal class ResourceDataProvider(
* shorter than 50 chars. This method must be implemented for caching to work properly.
*/
// FIXME: Check whether we need to use a persistent ID.
override fun getUid(): String = UUID.randomUUID().toString().take(50)
override fun getUid(): String = Uuid.random().toString().take(50)

override fun read(size: Long, offset: Long): ByteArray = runBlocking {
val range = offset until (offset + size)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,8 @@ public class PsPdfKitDocumentFragment internal constructor(
return config.build()
}

private val _pageIndex = MutableStateFlow(initialPageIndex)
override val pageIndex: StateFlow<Int> = _pageIndex.asStateFlow()
override val pageIndex: StateFlow<Int>
field = MutableStateFlow(initialPageIndex)
Comment thread
mickael-menu marked this conversation as resolved.

override fun goToPageIndex(index: Int, animated: Boolean): Boolean {
val fragment = pdfFragment ?: return false
Expand Down Expand Up @@ -263,7 +263,7 @@ public class PsPdfKitDocumentFragment internal constructor(

private inner class PsPdfKitListener : DocumentListener, OnPreparePopupToolbarListener {
override fun onPageChanged(document: PdfDocument, pageIndex: Int) {
_pageIndex.value = pageIndex
this@PsPdfKitDocumentFragment.pageIndex.value = pageIndex
}

override fun onDocumentClick(): Boolean {
Expand Down
Loading
Loading