-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
79 changed files
with
1,338 additions
and
1,506 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ POM_SCM_CONNECTION=scm:git:git://github.com/ThePalaceProject/android-r2 | |
POM_SCM_DEV_CONNECTION=scm:git:ssh://[email protected]/ThePalaceProject/android-r2 | ||
POM_SCM_URL=http://github.com/ThePalaceProject/android-r2 | ||
POM_URL=http://github.com/ThePalaceProject/android-r2 | ||
VERSION_NAME=2.6.0-SNAPSHOT | ||
VERSION_NAME=3.0.0-SNAPSHOT | ||
VERSION_PREVIOUS=2.5.0 | ||
|
||
android.useAndroidX=true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
dependencies { | ||
implementation(libs.google.guava) | ||
implementation(libs.joda.time) | ||
implementation(libs.kotlin.stdlib) | ||
implementation(libs.r2.shared) | ||
implementation(libs.r2.streamer) | ||
implementation(libs.rxjava2) | ||
implementation(libs.slf4j) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 3 additions & 17 deletions
20
...simplified.r2.api/src/main/java/org/librarysimplified/r2/api/SR2ControllerProviderType.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,22 @@ | ||
package org.librarysimplified.r2.api | ||
|
||
import com.google.common.util.concurrent.ListenableFuture | ||
import java.util.concurrent.Callable | ||
import android.app.Application | ||
|
||
/** | ||
* A provider of R2 controllers. | ||
*/ | ||
|
||
interface SR2ControllerProviderType { | ||
|
||
/** | ||
* Create a new R2 controller on a thread provided by the given I/O executor. | ||
*/ | ||
|
||
fun create( | ||
configuration: SR2ControllerConfiguration, | ||
): ListenableFuture<SR2ControllerType> { | ||
return configuration.ioExecutor.submit( | ||
Callable { | ||
this.createHere(configuration) | ||
}, | ||
) | ||
} | ||
|
||
/** | ||
* Create a new controller on the current thread. | ||
* | ||
* Note that, as most implementations will perform I/O upon initialization, this method | ||
* should _not_ be called on the Android UI thread. | ||
*/ | ||
|
||
fun createHere( | ||
fun create( | ||
context: Application, | ||
configuration: SR2ControllerConfiguration, | ||
): SR2ControllerType | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
org.librarysimplified.r2.api/src/main/java/org/librarysimplified/r2/api/SR2Executors.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package org.librarysimplified.r2.api | ||
|
||
import org.slf4j.LoggerFactory | ||
import java.util.concurrent.Executor | ||
import java.util.concurrent.Executors | ||
|
||
object SR2Executors { | ||
|
||
private val logger = | ||
LoggerFactory.getLogger(SR2Executors::class.java) | ||
|
||
val ioExecutor: Executor = | ||
Executors.newSingleThreadExecutor { r -> | ||
val thread = Thread(r) | ||
thread.name = "org.librarysimplified.r2.io" | ||
thread.setUncaughtExceptionHandler { t, e -> | ||
logger.error("Uncaught exception: ", e) | ||
} | ||
thread | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
org.librarysimplified.r2.api/src/main/java/org/librarysimplified/r2/api/SR2TOCEntry.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.