pull/37/head
kunfei 5 years ago
parent 7bd59483d1
commit 1f3297d08d
  1. 2
      app/src/main/java/io/legado/app/ui/rss/read/ReadRssActivity.kt
  2. 4
      app/src/main/java/io/legado/app/ui/rss/read/ReadRssViewModel.kt

@ -38,7 +38,7 @@ class ReadRssActivity : VMBaseActivity<ReadRssViewModel>(R.layout.activity_rss_r
when (item.itemId) {
R.id.menu_rss_star -> viewModel.rssArticleLiveData.value?.let {
it.star = !it.star
viewModel.upRssArticle(it)
viewModel.upRssArticle(it) { upStarMenu() }
}
}
return super.onCompatOptionsItemSelected(item)

@ -67,9 +67,11 @@ class ReadRssViewModel(application: Application) : BaseViewModel(application) {
}
}
fun upRssArticle(rssArticle: RssArticle) {
fun upRssArticle(rssArticle: RssArticle, success: () -> Unit) {
execute {
App.db.rssArticleDao().update(rssArticle)
}.onSuccess {
success()
}
}
}
Loading…
Cancel
Save