File tree 3 files changed +16
-7
lines changed
navigator/src/main/java/org/readium/r2/navigator
shared/src/main/java/org/readium/r2/shared/util/downloads/foreground
3 files changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ import org.readium.r2.shared.publication.ReadingProgression as PublicationReadin
24
24
public interface VisualNavigator : Navigator {
25
25
26
26
@Deprecated(
27
- " Moved to DirectionalNavigator " ,
27
+ " Renamed to OverflowableNavigator.Overflow " ,
28
28
level = DeprecationLevel .ERROR
29
29
)
30
30
@OptIn(ExperimentalReadiumApi ::class )
@@ -126,7 +126,7 @@ public interface VisualNavigator : Navigator {
126
126
* Moves to the next content portion (eg. page) in the reading progression direction.
127
127
*/
128
128
@Deprecated(
129
- " Moved to DirectionalNavigator " ,
129
+ " Moved to OverflowableNavigator " ,
130
130
level = DeprecationLevel .ERROR
131
131
)
132
132
public fun goForward (animated : Boolean = false, completion : () -> Unit = {}): Boolean
@@ -135,7 +135,7 @@ public interface VisualNavigator : Navigator {
135
135
* Moves to the previous content portion (eg. page) in the reading progression direction.
136
136
*/
137
137
@Deprecated(
138
- " Moved to DirectionalNavigator " ,
138
+ " Moved to OverflowableNavigator " ,
139
139
level = DeprecationLevel .ERROR
140
140
)
141
141
public fun goBackward (animated : Boolean = false, completion : () -> Unit = {}): Boolean
Original file line number Diff line number Diff line change @@ -208,15 +208,15 @@ public class MediaSessionNavigator(
208
208
return go(locator, animated, completion)
209
209
}
210
210
211
- public fun goForward (animated : Boolean , completion : () -> Unit ): Boolean {
211
+ public fun goForward (animated : Boolean = true , completion : () -> Unit = {} ): Boolean {
212
212
if (! isActive) return false
213
213
214
214
seekRelative(skipForwardInterval)
215
215
completion()
216
216
return true
217
217
}
218
218
219
- public fun goBackward (animated : Boolean , completion : () -> Unit ): Boolean {
219
+ public fun goBackward (animated : Boolean = true , completion : () -> Unit = {} ): Boolean {
220
220
if (! isActive) return false
221
221
222
222
seekRelative(- skipBackwardInterval)
Original file line number Diff line number Diff line change @@ -57,8 +57,17 @@ public class ForegroundDownloadManager(
57
57
}
58
58
59
59
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
62
71
}
63
72
64
73
httpClient
You can’t perform that action at this time.
0 commit comments