From 4246bcd27d23ef7a4881065218481b8404da5459 Mon Sep 17 00:00:00 2001 From: gedoor Date: Wed, 26 Aug 2020 14:13:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/legado/app/ui/main/explore/ExploreFragment.kt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/main/explore/ExploreFragment.kt b/app/src/main/java/io/legado/app/ui/main/explore/ExploreFragment.kt index c8f93fc64..00e8c8da8 100644 --- a/app/src/main/java/io/legado/app/ui/main/explore/ExploreFragment.kt +++ b/app/src/main/java/io/legado/app/ui/main/explore/ExploreFragment.kt @@ -7,7 +7,6 @@ import android.view.SubMenu import android.view.View import androidx.appcompat.widget.SearchView import androidx.lifecycle.LiveData -import androidx.lifecycle.Observer import androidx.recyclerview.widget.DiffUtil import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView @@ -93,7 +92,7 @@ class ExploreFragment : VMBaseFragment(R.layout.fragment_find_ private fun initGroupData() { liveGroup?.removeObservers(viewLifecycleOwner) liveGroup = App.db.bookSourceDao().liveGroupExplore() - liveGroup?.observe(viewLifecycleOwner, Observer { + liveGroup?.observe(viewLifecycleOwner, { groups.clear() it.map { group -> groups.addAll(group.splitNotBlank(",", ";")) @@ -109,7 +108,7 @@ class ExploreFragment : VMBaseFragment(R.layout.fragment_find_ } else { App.db.bookSourceDao().liveExplore("%$key%") } - liveExplore?.observe(viewLifecycleOwner, Observer { + liveExplore?.observe(viewLifecycleOwner, { val diffResult = DiffUtil .calculateDiff(ExploreDiffCallBack(ArrayList(adapter.getItems()), it)) adapter.setItems(it)