27 lines
593 B
Kotlin
27 lines
593 B
Kotlin
package ru.myitschool.lab23
|
|
|
|
import androidx.lifecycle.MutableLiveData
|
|
import androidx.lifecycle.ViewModel
|
|
|
|
class MainViewModel : ViewModel() {
|
|
val usdRate = MutableLiveData<String>()
|
|
val rateCheckInteractor = RateCheckInteractor()
|
|
|
|
fun onCreate() {
|
|
refreshRate()
|
|
}
|
|
|
|
fun onRefreshClicked() {
|
|
refreshRate()
|
|
}
|
|
|
|
private fun refreshRate() {
|
|
TODO("refresh rate is not implemented")
|
|
}
|
|
|
|
companion object {
|
|
const val TAG = "MainViewModel"
|
|
const val USD_RATE_URL = "https://www.freeforexapi.com/api/live?pairs=USDRUB"
|
|
}
|
|
}
|