pull/49/head
kunfei 5 years ago
parent b1548dd145
commit 9e08329f5a
  1. 2
      app/src/main/java/io/legado/app/ui/rss/article/RssArticlesActivity.kt
  2. 4
      app/src/main/java/io/legado/app/ui/rss/article/RssArticlesViewModel.kt

@ -39,8 +39,10 @@ class RssArticlesActivity : VMBaseActivity<RssArticlesViewModel>(R.layout.activi
title_bar.title = it title_bar.title = it
}) })
initView() initView()
viewModel.initData(intent) {
refresh_recycler_view.startLoading() refresh_recycler_view.startLoading()
} }
}
override fun onCompatCreateOptionsMenu(menu: Menu): Boolean { override fun onCompatCreateOptionsMenu(menu: Menu): Boolean {
menuInflater.inflate(R.menu.rss_articles, menu) menuInflater.inflate(R.menu.rss_articles, menu)

@ -20,7 +20,7 @@ class RssArticlesViewModel(application: Application) : BaseViewModel(application
var page = 1 var page = 1
var hasMore = true var hasMore = true
fun initData(intent: Intent) { fun initData(intent: Intent, finally: () -> Unit) {
execute { execute {
url = intent.getStringExtra("url") url = intent.getStringExtra("url")
url?.let { url -> url?.let { url ->
@ -31,6 +31,8 @@ class RssArticlesViewModel(application: Application) : BaseViewModel(application
rssSource = RssSource(sourceUrl = url) rssSource = RssSource(sourceUrl = url)
} }
} }
}.onFinally {
finally()
} }
} }

Loading…
Cancel
Save