Skip to content

Commit b13bc52

Browse files
authored
Minor fixes (readium#449)
1 parent b0967f7 commit b13bc52

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

readium/navigator/src/main/java/org/readium/r2/navigator/VisualNavigator.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import org.readium.r2.shared.publication.ReadingProgression as PublicationReadin
2424
public interface VisualNavigator : Navigator {
2525

2626
@Deprecated(
27-
"Moved to DirectionalNavigator",
27+
"Renamed to OverflowableNavigator.Overflow",
2828
level = DeprecationLevel.ERROR
2929
)
3030
@OptIn(ExperimentalReadiumApi::class)
@@ -126,7 +126,7 @@ public interface VisualNavigator : Navigator {
126126
* Moves to the next content portion (eg. page) in the reading progression direction.
127127
*/
128128
@Deprecated(
129-
"Moved to DirectionalNavigator",
129+
"Moved to OverflowableNavigator",
130130
level = DeprecationLevel.ERROR
131131
)
132132
public fun goForward(animated: Boolean = false, completion: () -> Unit = {}): Boolean
@@ -135,7 +135,7 @@ public interface VisualNavigator : Navigator {
135135
* Moves to the previous content portion (eg. page) in the reading progression direction.
136136
*/
137137
@Deprecated(
138-
"Moved to DirectionalNavigator",
138+
"Moved to OverflowableNavigator",
139139
level = DeprecationLevel.ERROR
140140
)
141141
public fun goBackward(animated: Boolean = false, completion: () -> Unit = {}): Boolean

readium/navigator/src/main/java/org/readium/r2/navigator/media/MediaSessionNavigator.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -208,15 +208,15 @@ public class MediaSessionNavigator(
208208
return go(locator, animated, completion)
209209
}
210210

211-
public fun goForward(animated: Boolean, completion: () -> Unit): Boolean {
211+
public fun goForward(animated: Boolean = true, completion: () -> Unit = {}): Boolean {
212212
if (!isActive) return false
213213

214214
seekRelative(skipForwardInterval)
215215
completion()
216216
return true
217217
}
218218

219-
public fun goBackward(animated: Boolean, completion: () -> Unit): Boolean {
219+
public fun goBackward(animated: Boolean = true, completion: () -> Unit = {}): Boolean {
220220
if (!isActive) return false
221221

222222
seekRelative(-skipBackwardInterval)

readium/shared/src/main/java/org/readium/r2/shared/util/downloads/foreground/ForegroundDownloadManager.kt

+11-2
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,17 @@ public class ForegroundDownloadManager(
5757
}
5858

5959
private suspend fun doRequest(request: DownloadManager.Request, id: DownloadManager.RequestId) {
60-
val destination = withContext(Dispatchers.IO) {
61-
File.createTempFile(UUID.randomUUID().toString(), null, downloadsDirectory)
60+
val destination: File
61+
try {
62+
destination = withContext(Dispatchers.IO) {
63+
File.createTempFile(UUID.randomUUID().toString(), null, downloadsDirectory)
64+
}
65+
} catch (exception: IOException) {
66+
val error = DownloadManager.DownloadError.FileSystem(FileSystemError.IO(exception))
67+
forEachListener(id) {
68+
onDownloadFailed(id, error)
69+
}
70+
return
6271
}
6372

6473
httpClient

0 commit comments

Comments
 (0)