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

31 lines
635 B
Kotlin
Raw Normal View History

2020-09-06 10:33:04 +00:00
package com.vanced.manager.model
import androidx.lifecycle.MutableLiveData
2021-01-16 14:36:46 +00:00
import okhttp3.ResponseBody
import retrofit2.Call
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
2021-01-16 14:36:46 +00:00
var currentDownload: Call<ResponseBody>? = 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 {
2021-01-17 13:15:57 +00:00
installing.postValue(false)
2020-10-31 19:45:39 +00:00
reset()
2020-09-06 10:33:04 +00:00
}
}