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)