pull/36/head
kunfei 5 years ago
parent f1e9345c47
commit 89512c0db8
  1. 5
      app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt
  2. 5
      app/src/main/java/io/legado/app/ui/rss/source/manage/RssSourceActivity.kt

@ -135,9 +135,8 @@ class BookSourceActivity : VMBaseActivity<BookSourceViewModel>(R.layout.activity
} }
bookSourceLiveDate?.observe(this, Observer { bookSourceLiveDate?.observe(this, Observer {
search_view.queryHint = getString(R.string.search_book_source_num, it.size) search_view.queryHint = getString(R.string.search_book_source_num, it.size)
val diffResult = DiffUtil.calculateDiff( val diffResult = DiffUtil
DiffCallBack(adapter.getItems(), it) .calculateDiff(DiffCallBack(adapter.getItems(), it))
)
adapter.setItemsNoNotify(it) adapter.setItemsNoNotify(it)
diffResult.dispatchUpdatesTo(adapter) diffResult.dispatchUpdatesTo(adapter)
}) })

@ -91,9 +91,8 @@ class RssSourceActivity : VMBaseActivity<RssSourceViewModel>(R.layout.activity_r
sourceLiveData?.removeObservers(this) sourceLiveData?.removeObservers(this)
sourceLiveData = App.db.rssSourceDao().liveAll() sourceLiveData = App.db.rssSourceDao().liveAll()
sourceLiveData?.observe(this, Observer { sourceLiveData?.observe(this, Observer {
val diffResult = DiffUtil.calculateDiff( val diffResult = DiffUtil
DiffCallBack(adapter.getItems(), it) .calculateDiff(DiffCallBack(adapter.getItems(), it))
)
adapter.setItemsNoNotify(it) adapter.setItemsNoNotify(it)
diffResult.dispatchUpdatesTo(adapter) diffResult.dispatchUpdatesTo(adapter)
}) })

Loading…
Cancel
Save