pull/32/head
parent
1bd522181e
commit
ea49ae88b7
@ -1,15 +1,22 @@ |
|||||||
package io.legado.app.ui.changesource |
package io.legado.app.ui.changesource |
||||||
|
|
||||||
import android.app.Application |
import android.app.Application |
||||||
|
import androidx.lifecycle.MutableLiveData |
||||||
|
import io.legado.app.App |
||||||
import io.legado.app.base.BaseViewModel |
import io.legado.app.base.BaseViewModel |
||||||
|
import io.legado.app.data.entities.SearchBook |
||||||
|
|
||||||
class ChangeSourceViewModel(application: Application) : BaseViewModel(application) { |
class ChangeSourceViewModel(application: Application) : BaseViewModel(application) { |
||||||
|
|
||||||
var name: String = "" |
var name: String = "" |
||||||
var author: String = "" |
var author: String = "" |
||||||
|
val searchBookData = MutableLiveData<List<SearchBook>>() |
||||||
|
|
||||||
fun startSearch() { |
fun startSearch() { |
||||||
|
execute { |
||||||
|
App.db.searchBookDao().getByNameAuthor(name, author).let { |
||||||
|
searchBookData.postValue(it) |
||||||
|
} |
||||||
|
} |
||||||
} |
} |
||||||
} |
} |
Loading…
Reference in new issue