From 4ef6d6b86224933c5ead88dfc12e8ea6522249f1 Mon Sep 17 00:00:00 2001
From: Steven Zeck <8315038+stevenzeck@users.noreply.github.com>
Date: Fri, 29 Nov 2024 13:23:19 -0600
Subject: [PATCH 1/2] Update Kotlin and KSP
---
.idea/kotlinc.xml | 2 +-
README.md | 2 +-
gradle/libs.versions.toml | 4 ++--
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml
index c224ad564b..bb4493707f 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 0f3255e4f0..bc639cb07c 100644
--- a/README.md
+++ b/README.md
@@ -10,7 +10,7 @@
| Readium | Android min SDK | Android compile SDK | Kotlin compiler (✻) | Gradle (✻) |
|-----------|-----------------|---------------------|---------------------|------------|
-| `develop` | 21 | 35 | 2.0.21 | 8.11 |
+| `develop` | 21 | 35 | 2.1.0 | 8.11 |
| 3.0.0 | 21 | 34 | 1.9.24 | 8.6.0 |
| 2.3.0 | 21 | 33 | 1.7.10 | 6.9.3 |
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index 725d83d2e6..209be02190 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -1,6 +1,6 @@
[versions]
-kotlin = "2.0.21"
+kotlin = "2.1.0"
agp = "8.7.2"
desugar_jdk_libs = "2.1.2"
gradle-maven-publish-plugin = "0.28.0"
@@ -47,7 +47,7 @@ kotlinx-serialization-json = "1.7.3"
# Make sure to align with the Kotlin version.
# See https://github.com/google/ksp/releases
-ksp = "2.0.21-1.0.28"
+ksp = "2.1.0-1.0.29"
ktlint = "12.1.1"
From 45aac69e82a3c2951d47a3b0d8c1e18de4910755 Mon Sep 17 00:00:00 2001
From: Steven Zeck <8315038+stevenzeck@users.noreply.github.com>
Date: Fri, 29 Nov 2024 13:23:30 -0600
Subject: [PATCH 2/2] Update media3
---
gradle/libs.versions.toml | 4 ++--
.../media/tts/session/AudioFocusManager.kt | 3 ++-
.../media/tts/session/TtsSessionAdapter.kt | 15 ---------------
3 files changed, 4 insertions(+), 18 deletions(-)
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index 209be02190..792e2dd92c 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -22,7 +22,7 @@ androidx-datastore = "1.1.1"
androidx-fragment-ktx = "1.8.5"
androidx-legacy = "1.0.0"
androidx-lifecycle = "2.8.7"
-androidx-media3 = "1.4.1"
+androidx-media3 = "1.5.0"
androidx-navigation = "2.8.4"
androidx-paging = "3.3.4"
androidx-recyclerview = "1.3.2"
@@ -87,7 +87,7 @@ androidx-datastore-preferences = { group = "androidx.datastore", name = "datasto
androidx-fragment-ktx = { group = "androidx.fragment", name = "fragment-ktx", version.ref = "androidx-fragment-ktx" }
androidx-legacy-ui = { group = "androidx.legacy", name = "legacy-support-core-ui", version.ref = "androidx-legacy" }
androidx-lifecycle-common = { group = "androidx.lifecycle", name = "lifecycle-common-java8", version.ref = "androidx-lifecycle" }
-androidx-media3-common = { group = "androidx.media3", name = "media3-common", version.ref = "androidx-media3" }
+androidx-media3-common = { group = "androidx.media3", name = "media3-common-ktx", version.ref = "androidx-media3" }
androidx-media3-session = { group = "androidx.media3", name = "media3-session", version.ref = "androidx-media3" }
androidx-media3-exoplayer = { group = "androidx.media3", name = "media3-exoplayer", version.ref = "androidx-media3" }
androidx-navigation-fragment = { group = "androidx.navigation", name = "navigation-fragment-ktx", version.ref = "androidx-navigation" }
diff --git a/readium/navigators/media/tts/src/main/java/org/readium/navigator/media/tts/session/AudioFocusManager.kt b/readium/navigators/media/tts/src/main/java/org/readium/navigator/media/tts/session/AudioFocusManager.kt
index 9c58fc2b26..b5be163103 100644
--- a/readium/navigators/media/tts/src/main/java/org/readium/navigator/media/tts/session/AudioFocusManager.kt
+++ b/readium/navigators/media/tts/src/main/java/org/readium/navigator/media/tts/session/AudioFocusManager.kt
@@ -29,6 +29,7 @@ import androidx.media3.common.C
import androidx.media3.common.Player
import androidx.media3.common.util.Log
import androidx.media3.common.util.Util
+import java.util.Objects
import org.readium.navigator.media.tts.session.AudioFocusManager.PlayerControl
@androidx.annotation.OptIn(androidx.media3.common.util.UnstableApi::class)
@@ -134,7 +135,7 @@ internal class AudioFocusManager(
* managed automatically.
*/
fun setAudioAttributes(audioAttributes: AudioAttributes?) {
- if (!Util.areEqual(this.audioAttributes, audioAttributes)) {
+ if (!Objects.equals(this.audioAttributes, audioAttributes)) {
this.audioAttributes = audioAttributes
focusGainToRequest = convertAudioAttributesToFocusGain(audioAttributes)
require(
diff --git a/readium/navigators/media/tts/src/main/java/org/readium/navigator/media/tts/session/TtsSessionAdapter.kt b/readium/navigators/media/tts/src/main/java/org/readium/navigator/media/tts/session/TtsSessionAdapter.kt
index cc43b6ca4a..bf82d849bf 100644
--- a/readium/navigators/media/tts/src/main/java/org/readium/navigator/media/tts/session/TtsSessionAdapter.kt
+++ b/readium/navigators/media/tts/src/main/java/org/readium/navigator/media/tts/session/TtsSessionAdapter.kt
@@ -343,25 +343,10 @@ internal class TtsSessionAdapter(
ttsPlayer.nextUtterance()
}
- @Deprecated("Deprecated in Java", ReplaceWith("hasPreviousMediaItem()"))
- override fun hasPrevious(): Boolean {
- return hasPreviousMediaItem()
- }
-
- @Deprecated("Deprecated in Java", ReplaceWith("hasPreviousMediaItem()"))
- override fun hasPreviousWindow(): Boolean {
- return hasPreviousMediaItem()
- }
-
override fun hasPreviousMediaItem(): Boolean {
return previousMediaItemIndex != INDEX_UNSET
}
- @Deprecated("Deprecated in Java", ReplaceWith("TODO(\"Not yet implemented\")"))
- override fun previous() {
- seekToPreviousMediaItem()
- }
-
@Deprecated("Deprecated in Java", ReplaceWith("TODO(\"Not yet implemented\")"))
override fun seekToPreviousWindow() {
seekToPreviousMediaItem()