Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Kotlin and media3 #597

Merged
merged 2 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .idea/kotlinc.xml

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

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |

Expand Down
8 changes: 4 additions & 4 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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"
Expand All @@ -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"

Expand Down Expand Up @@ -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" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,25 +343,10 @@ internal class TtsSessionAdapter<E : TtsEngine.Error>(
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()
Expand Down