|
@@ -1,6 +1,18 @@
|
|
|
package net.typeblog.lpac_jni
|
|
package net.typeblog.lpac_jni
|
|
|
|
|
|
|
|
interface ProfileDownloadCallback {
|
|
interface ProfileDownloadCallback {
|
|
|
|
|
+ companion object {
|
|
|
|
|
+ fun lookupStateFromProgress(progress: Int): DownloadState =
|
|
|
|
|
+ when (progress) {
|
|
|
|
|
+ 0 -> DownloadState.Preparing
|
|
|
|
|
+ 20 -> DownloadState.Connecting
|
|
|
|
|
+ 40 -> DownloadState.Authenticating
|
|
|
|
|
+ 60 -> DownloadState.Downloading
|
|
|
|
|
+ 80 -> DownloadState.Finalizing
|
|
|
|
|
+ else -> throw IllegalArgumentException("Unknown state")
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
enum class DownloadState(val progress: Int) {
|
|
enum class DownloadState(val progress: Int) {
|
|
|
Preparing(0),
|
|
Preparing(0),
|
|
|
Connecting(20), // Before {server,client} authentication
|
|
Connecting(20), // Before {server,client} authentication
|