Compare commits
1 commit
9cd866f464
...
038d924a99
Author | SHA1 | Date | |
---|---|---|---|
038d924a99 |
1 changed files with 8 additions and 9 deletions
|
@ -2,15 +2,14 @@ package net.typeblog.lpac_jni
|
||||||
|
|
||||||
interface ProfileDownloadCallback {
|
interface ProfileDownloadCallback {
|
||||||
companion object {
|
companion object {
|
||||||
fun lookupStateFromProgress(progress: Int): DownloadState =
|
fun lookupStateFromProgress(progress: Int): DownloadState = when (progress) {
|
||||||
when (progress) {
|
0 -> DownloadState.Preparing
|
||||||
0 -> DownloadState.Preparing
|
20 -> DownloadState.Connecting
|
||||||
20 -> DownloadState.Connecting
|
40 -> DownloadState.Authenticating
|
||||||
40 -> DownloadState.Authenticating
|
60 -> DownloadState.Downloading
|
||||||
60 -> DownloadState.Downloading
|
80 -> DownloadState.Finalizing
|
||||||
80 -> DownloadState.Finalizing
|
else -> throw IllegalArgumentException("Unknown state")
|
||||||
else -> throw IllegalArgumentException("Unknown state")
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
enum class DownloadState(val progress: Int) {
|
enum class DownloadState(val progress: Int) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue