Compare commits

..

1 commit

Author SHA1 Message Date
038d924a99
feat: discovery 2025-03-10 09:55:19 +08:00

View file

@ -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) {