pull/37/head
parent
19cb9bd1fe
commit
0a6685c55d
@ -1,8 +1,28 @@ |
|||||||
package io.legado.app.ui.rss.read |
package io.legado.app.ui.rss.read |
||||||
|
|
||||||
import android.app.Application |
import android.app.Application |
||||||
|
import android.content.Intent |
||||||
|
import androidx.lifecycle.MutableLiveData |
||||||
|
import io.legado.app.App |
||||||
import io.legado.app.base.BaseViewModel |
import io.legado.app.base.BaseViewModel |
||||||
|
|
||||||
class ReadRssViewModel(application: Application) : BaseViewModel(application) { |
class ReadRssViewModel(application: Application) : BaseViewModel(application) { |
||||||
|
|
||||||
|
val contentLiveData = MutableLiveData<String>() |
||||||
|
val urlLiveData = MutableLiveData<String>() |
||||||
|
|
||||||
|
fun initData(intent: Intent) { |
||||||
|
execute { |
||||||
|
intent.getStringExtra("guid")?.let { |
||||||
|
val rssArticle = App.db.rssArtivleDao().get(it) |
||||||
|
if (rssArticle != null) { |
||||||
|
if (!rssArticle.description.isNullOrBlank()) { |
||||||
|
contentLiveData.postValue(rssArticle.description) |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
} |
} |
Loading…
Reference in new issue