VancedManager/app/src/main/java/com/vanced/manager/model/ProgressModel.kt

30 lines
648 B
Kotlin
Raw Normal View History

2020-09-06 10:33:04 +00:00
package com.vanced.manager.model
import androidx.lifecycle.MutableLiveData
2020-11-23 16:00:41 +00:00
import com.github.kittinunf.fuel.core.requests.CancellableRequest
2020-09-17 10:13:16 +00:00
2020-09-06 10:33:04 +00:00
open class ProgressModel {
val downloadProgress = MutableLiveData<Int>()
val downloadingFile = MutableLiveData<String>()
val installing = MutableLiveData<Boolean>()
2020-09-17 10:13:16 +00:00
2020-11-23 16:00:41 +00:00
var currentDownload: CancellableRequest? = null
2020-10-31 19:45:39 +00:00
fun reset() {
downloadProgress.value = 0
downloadingFile.value = ""
2020-10-31 19:45:39 +00:00
}
2020-11-23 16:00:41 +00:00
fun postReset() {
downloadProgress.postValue(0)
downloadingFile.postValue("")
}
2020-10-31 19:45:39 +00:00
init {
installing.value = false
2020-10-31 19:45:39 +00:00
reset()
2020-09-06 10:33:04 +00:00
}
}