Skip to content

Commit 25f82b0

Browse files
committed
Update dependencies
1 parent 71074ea commit 25f82b0

File tree

13 files changed

+96
-117
lines changed

13 files changed

+96
-117
lines changed

buildSrc/src/main/kotlin/readium.library-conventions.gradle.kts

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import com.vanniktech.maven.publish.SonatypeHost
2+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
23

34
plugins {
45
// FIXME: For now, we cannot use the versions catalog in precompiled scripts: https://github.com/gradle/gradle/issues/15383
@@ -21,16 +22,11 @@ android {
2122
}
2223

2324
compileOptions {
24-
sourceCompatibility = JavaVersion.VERSION_1_8
25-
targetCompatibility = JavaVersion.VERSION_1_8
25+
sourceCompatibility = JavaVersion.VERSION_11
26+
targetCompatibility = JavaVersion.VERSION_11
2627
isCoreLibraryDesugaringEnabled = true
2728
}
2829

29-
kotlinOptions {
30-
jvmTarget = JavaVersion.VERSION_1_8.toString()
31-
allWarningsAsErrors = true
32-
}
33-
3430
testOptions {
3531
unitTests.isIncludeAndroidResources = true
3632
}
@@ -50,10 +46,17 @@ android {
5046

5147
kotlin {
5248
explicitApi()
49+
50+
compilerOptions {
51+
freeCompilerArgs.add("-Xannotation-default-target=param-property")
52+
jvmTarget = JvmTarget.JVM_11
53+
// allWarningsAsErrors = true
54+
}
5355
}
5456

5557
dependencies {
56-
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.0.4")
58+
//noinspection UseTomlInstead
59+
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.5")
5760
}
5861

5962
mavenPublishing {

demos/navigator/build.gradle.kts

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
2+
13
plugins {
24
id("com.android.application")
35
kotlin("android")
@@ -10,7 +12,7 @@ android {
1012
compileSdk = (property("android.compileSdk") as String).toInt()
1113

1214
defaultConfig {
13-
minSdk = 23
15+
minSdk = (property("android.minSdk") as String).toInt()
1416
targetSdk = (property("android.targetSdk") as String).toInt()
1517

1618
applicationId = "org.readium.navigator.demo"
@@ -22,14 +24,11 @@ android {
2224
}
2325

2426
compileOptions {
25-
sourceCompatibility = JavaVersion.VERSION_1_8
26-
targetCompatibility = JavaVersion.VERSION_1_8
27+
sourceCompatibility = JavaVersion.VERSION_11
28+
targetCompatibility = JavaVersion.VERSION_11
2729
isCoreLibraryDesugaringEnabled = true
2830
}
29-
kotlinOptions {
30-
jvmTarget = JavaVersion.VERSION_1_8.toString()
31-
freeCompilerArgs = freeCompilerArgs + "-opt-in=kotlin.RequiresOptIn"
32-
}
31+
3332
buildFeatures {
3433
viewBinding = true
3534
compose = true
@@ -59,6 +58,14 @@ android {
5958
namespace = "org.readium.demo.navigator"
6059
}
6160

61+
kotlin {
62+
63+
compilerOptions {
64+
jvmTarget = JvmTarget.JVM_11
65+
freeCompilerArgs.add("-opt-in=kotlin.RequiresOptIn")
66+
}
67+
}
68+
6269
dependencies {
6370
implementation(project(":readium:readium-shared"))
6471
implementation(project(":readium:readium-streamer"))

gradle/libs.versions.toml

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
11
[versions]
22

3-
kotlin = "2.1.21"
4-
agp = "8.10.1"
3+
kotlin = "2.2.20"
4+
agp = "8.13.0"
55
desugar_jdk_libs = "2.1.5"
66
gradle-maven-publish-plugin = "0.32.0"
77

8-
androidx-activity = "1.10.1"
8+
androidx-activity = "1.11.0"
99
androidx-annotation = "1.9.1"
10-
androidx-appcompat = "1.7.0"
11-
androidx-browser = "1.8.0"
10+
androidx-appcompat = "1.7.1"
11+
androidx-browser = "1.9.0"
1212
androidx-cardview = "1.0.0"
13-
androidx-compose-animation = "1.8.2"
14-
androidx-compose-foundation = "1.8.2"
15-
androidx-compose-material = "1.8.2"
13+
androidx-compose-animation = "1.9.2"
14+
androidx-compose-foundation = "1.9.2"
15+
androidx-compose-material = "1.9.2"
1616
androidx-compose-material-icons = "1.7.8"
17-
androidx-compose-material3 = "1.3.2"
18-
androidx-compose-runtime = "1.8.2"
19-
androidx-compose-ui = "1.8.2"
17+
androidx-compose-material3 = "1.4.0"
18+
androidx-compose-runtime = "1.9.2"
19+
androidx-compose-ui = "1.9.2"
2020
androidx-constraintlayout = "2.2.1"
21-
androidx-core = "1.16.0"
21+
androidx-core = "1.17.0"
2222
androidx-datastore = "1.1.7"
23-
androidx-fragment-ktx = "1.8.7"
23+
androidx-fragment-ktx = "1.8.9"
2424
androidx-legacy = "1.0.0"
25-
androidx-lifecycle = "2.9.0"
26-
androidx-media3 = "1.7.1"
27-
androidx-navigation = "2.9.0"
25+
androidx-lifecycle = "2.9.4"
26+
androidx-media3 = "1.8.0"
27+
androidx-navigation = "2.9.5"
2828
androidx-paging = "3.3.6"
2929
androidx-recyclerview = "1.4.0"
30-
androidx-room = "2.7.1"
30+
androidx-room = "2.8.1"
3131
androidx-viewpager2 = "1.1.0"
32-
androidx-webkit = "1.13.0"
32+
androidx-webkit = "1.14.0"
3333

34-
assertj = "3.27.3"
34+
assertj = "3.27.6"
3535

3636
dokka = "1.9.20"
3737

38-
google-material = "1.12.0"
38+
google-material = "1.13.0"
3939

4040
joda-time = "2.14.0"
4141
#Do not upgrade without fixing unit tests in HtmlResourceContentIteratorTest and regression testing
@@ -52,7 +52,7 @@ kotlinx-collections-immutable = "0.4.0"
5252

5353
# Make sure to align with the Kotlin version.
5454
# See https://github.com/google/ksp/releases
55-
ksp = "2.1.21-2.0.1"
55+
ksp = "2.2.20-2.0.3"
5656

5757
ktlint = "12.1.1"
5858

@@ -62,8 +62,8 @@ pdf-viewer = "3.2.8"
6262
picasso = "2.8"
6363
pspdfkit = "8.4.1"
6464

65-
robolectric = "4.14.1"
66-
mockk = "1.14.2"
65+
robolectric = "4.16"
66+
mockk = "1.14.6"
6767

6868
timber = "5.0.1"
6969

readium/navigator/src/main/java/org/readium/r2/navigator/pager/R2RTLViewPager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ public R2RTLViewPager(Context context, AttributeSet attrs) {
5959
@Override
6060
public void onRtlPropertiesChanged(int layoutDirection) {
6161
super.onRtlPropertiesChanged(layoutDirection);
62-
int viewCompatLayoutDirection = layoutDirection == View.LAYOUT_DIRECTION_RTL ? ViewCompat.LAYOUT_DIRECTION_RTL : ViewCompat.LAYOUT_DIRECTION_LTR;
62+
int viewCompatLayoutDirection = layoutDirection == View.LAYOUT_DIRECTION_RTL ? View.LAYOUT_DIRECTION_RTL : ViewCompat.LAYOUT_DIRECTION_LTR;
6363
if (direction == ReadingProgression.RTL) {
64-
viewCompatLayoutDirection = ViewCompat.LAYOUT_DIRECTION_RTL;
64+
viewCompatLayoutDirection = View.LAYOUT_DIRECTION_RTL;
6565
}
6666
if (viewCompatLayoutDirection != mLayoutDirection) {
6767
PagerAdapter adapter = super.getAdapter();

readium/navigators/media/tts/src/main/java/org/readium/navigator/media/tts/session/AudioFocusManager.kt

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import android.content.Context
2020
import android.media.AudioFocusRequest
2121
import android.media.AudioManager
2222
import android.media.AudioManager.OnAudioFocusChangeListener
23+
import android.os.Build
2324
import android.os.Handler
2425
import androidx.annotation.IntDef
2526
import androidx.annotation.RequiresApi
@@ -30,7 +31,6 @@ import androidx.media3.common.Player
3031
import androidx.media3.common.util.Log
3132
import androidx.media3.common.util.Util
3233
import java.util.Objects
33-
import org.readium.navigator.media.tts.session.AudioFocusManager.PlayerControl
3434

3535
@androidx.annotation.OptIn(androidx.media3.common.util.UnstableApi::class)
3636
/** Manages requesting and responding to changes in audio focus.
@@ -186,7 +186,7 @@ internal class AudioFocusManager(
186186
return PLAYER_COMMAND_PLAY_WHEN_READY
187187
}
188188
val requestResult =
189-
if (Util.SDK_INT >= 26) requestAudioFocusV26() else requestAudioFocusDefault()
189+
if (Build.VERSION.SDK_INT >= 26) requestAudioFocusV26() else requestAudioFocusDefault()
190190
return if (requestResult == AudioManager.AUDIOFOCUS_REQUEST_GRANTED) {
191191
setAudioFocusState(AUDIO_FOCUS_STATE_HAVE_FOCUS)
192192
PLAYER_COMMAND_PLAY_WHEN_READY
@@ -200,7 +200,7 @@ internal class AudioFocusManager(
200200
if (audioFocusState == AUDIO_FOCUS_STATE_NO_FOCUS) {
201201
return
202202
}
203-
if (Util.SDK_INT >= 26) {
203+
if (Build.VERSION.SDK_INT >= 26) {
204204
abandonAudioFocusV26()
205205
} else {
206206
abandonAudioFocusDefault()
@@ -407,11 +407,8 @@ internal class AudioFocusManager(
407407
->
408408
AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK
409409
C.USAGE_ASSISTANT ->
410-
if (Util.SDK_INT >= 19) {
411-
AUDIOFOCUS_GAIN_TRANSIENT_EXCLUSIVE
412-
} else {
413-
AUDIOFOCUS_GAIN_TRANSIENT
414-
}
410+
AUDIOFOCUS_GAIN_TRANSIENT_EXCLUSIVE
411+
415412
C.USAGE_ASSISTANCE_ACCESSIBILITY -> {
416413
if (audioAttributes.contentType == C.AUDIO_CONTENT_TYPE_SPEECH) {
417414
// Voice shouldn't be interrupted by other playback.

readium/navigators/media/tts/src/main/java/org/readium/navigator/media/tts/session/StreamVolumeManager.kt

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ import android.content.Context
2020
import android.content.Intent
2121
import android.content.IntentFilter
2222
import android.media.AudioManager
23+
import android.os.Build
2324
import android.os.Handler
2425
import androidx.media3.common.C
2526
import androidx.media3.common.util.Assertions
2627
import androidx.media3.common.util.Log
27-
import androidx.media3.common.util.Util
2828

2929
@androidx.annotation.OptIn(androidx.media3.common.util.UnstableApi::class)
3030
/** A manager that wraps [AudioManager] to control/listen audio stream volume. */
@@ -82,7 +82,7 @@ internal class StreamVolumeManager(context: Context, eventHandler: Handler, list
8282
* Gets the minimum volume for the current audio stream. It can be changed if [ ][.setStreamType] is called.
8383
*/
8484
val minVolume: Int
85-
get() = if (Util.SDK_INT >= 28) audioManager.getStreamMinVolume(streamType) else 0
85+
get() = if (Build.VERSION.SDK_INT >= 28) audioManager.getStreamMinVolume(streamType) else 0
8686

8787
/**
8888
* Gets the maximum volume for the current audio stream. It can be changed if [ ][.setStreamType] is called.
@@ -138,16 +138,11 @@ internal class StreamVolumeManager(context: Context, eventHandler: Handler, list
138138

139139
/** Sets the mute state of the current audio stream. */
140140
fun setMuted(muted: Boolean) {
141-
if (Util.SDK_INT >= 23) {
142-
audioManager.adjustStreamVolume(
143-
streamType,
144-
if (muted) AudioManager.ADJUST_MUTE else AudioManager.ADJUST_UNMUTE,
145-
VOLUME_FLAGS
146-
)
147-
} else {
148-
@Suppress("Deprecation")
149-
audioManager.setStreamMute(streamType, muted)
150-
}
141+
audioManager.adjustStreamVolume(
142+
streamType,
143+
if (muted) AudioManager.ADJUST_MUTE else AudioManager.ADJUST_UNMUTE,
144+
VOLUME_FLAGS
145+
)
151146
updateVolumeAndNotifyIfChanged()
152147
}
153148

@@ -210,11 +205,7 @@ internal class StreamVolumeManager(context: Context, eventHandler: Handler, list
210205
audioManager: AudioManager,
211206
streamType: @C.StreamType Int,
212207
): Boolean {
213-
return if (Util.SDK_INT >= 23) {
214-
audioManager.isStreamMute(streamType)
215-
} else {
216-
getVolumeFromManager(audioManager, streamType) == 0
217-
}
208+
return audioManager.isStreamMute(streamType)
218209
}
219210
}
220211
}

readium/navigators/media/tts/src/main/java/org/readium/navigator/media/tts/session/TtsSessionAdapter.kt

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ internal class TtsSessionAdapter<E : TtsEngine.Error>(
127127
.onEach { playbackParameters ->
128128
notifyListenersPlaybackParametersChanged(lastPlaybackParameters, playbackParameters)
129129
lastPlaybackParameters = playbackParameters
130-
}
130+
}.launchIn(coroutineScope)
131131
}
132132

133133
private var listeners: ListenerSet<Listener> =
@@ -347,11 +347,6 @@ internal class TtsSessionAdapter<E : TtsEngine.Error>(
347347
return previousMediaItemIndex != INDEX_UNSET
348348
}
349349

350-
@Deprecated("Deprecated in Java", ReplaceWith("TODO(\"Not yet implemented\")"))
351-
override fun seekToPreviousWindow() {
352-
seekToPreviousMediaItem()
353-
}
354-
355350
override fun seekToPreviousMediaItem() {
356351
val previousMediaItemIndex = previousMediaItemIndex
357352
if (previousMediaItemIndex != INDEX_UNSET) {
@@ -380,30 +375,10 @@ internal class TtsSessionAdapter<E : TtsEngine.Error>(
380375
}
381376
}
382377

383-
@Deprecated("Deprecated in Java", ReplaceWith("hasNextMediaItem()"))
384-
override fun hasNext(): Boolean {
385-
return hasNextMediaItem()
386-
}
387-
388-
@Deprecated("Deprecated in Java", ReplaceWith("hasNextMediaItem()"))
389-
override fun hasNextWindow(): Boolean {
390-
return hasNextMediaItem()
391-
}
392-
393378
override fun hasNextMediaItem(): Boolean {
394379
return nextMediaItemIndex != INDEX_UNSET
395380
}
396381

397-
@Deprecated("Deprecated in Java", ReplaceWith("seekToNextMediaItem()"))
398-
override fun next() {
399-
seekToNextMediaItem()
400-
}
401-
402-
@Deprecated("Deprecated in Java", ReplaceWith("seekToNextMediaItem()"))
403-
override fun seekToNextWindow() {
404-
seekToNextMediaItem()
405-
}
406-
407382
override fun seekToNextMediaItem() {
408383
val nextMediaItemIndex = nextMediaItemIndex
409384
if (nextMediaItemIndex != INDEX_UNSET) {

readium/navigators/web/internals/src/main/kotlin/org/readium/navigator/web/internals/gestures/Fling2DBehavior.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ internal class NullFling2DBehavior : Fling2DBehavior {
7373
}
7474
}
7575

76-
public fun FlingBehavior.toFling2DBehavior(orientation: Orientation) =
76+
public fun FlingBehavior.toFling2DBehavior(orientation: Orientation): Fling2DBehavior =
7777
object : Fling2DBehavior {
7878
override suspend fun Scroll2DScope.performFling(
7979
initialVelocity: Velocity,

readium/navigators/web/internals/src/main/kotlin/org/readium/navigator/web/internals/util/ComposeTypes.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public fun ReadingProgression.toLayoutDirection(): LayoutDirection =
2323
ReadingProgression.RTL -> LayoutDirection.Rtl
2424
}
2525

26-
public fun Axis.toOrientation() = when (this) {
26+
public fun Axis.toOrientation(): Orientation = when (this) {
2727
Axis.HORIZONTAL -> Orientation.Horizontal
2828
Axis.VERTICAL -> Orientation.Vertical
2929
}

readium/navigators/web/internals/src/main/kotlin/org/readium/navigator/web/internals/util/Geometry.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ package org.readium.navigator.web.internals.util
99
import androidx.compose.ui.unit.DpOffset
1010
import androidx.compose.ui.unit.DpRect
1111

12-
public fun DpRect.shift(offset: DpOffset) = DpRect(
12+
public fun DpRect.shift(offset: DpOffset): DpRect = DpRect(
1313
left = left + offset.x,
1414
right = right + offset.x,
1515
top = top + offset.y,

0 commit comments

Comments
 (0)