diff --git a/app/src/main/java/io/legado/app/ui/main/explore/ExploreAdapter.kt b/app/src/main/java/io/legado/app/ui/main/explore/ExploreAdapter.kt index 367428952..adf920c52 100644 --- a/app/src/main/java/io/legado/app/ui/main/explore/ExploreAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/main/explore/ExploreAdapter.kt @@ -155,9 +155,10 @@ class ExploreAdapter(context: Context, private val scope: CoroutineScope, val ca when (it.itemId) { R.id.menu_edit -> callBack.editSource(source.bookSourceUrl) R.id.menu_top -> callBack.toTop(source) - R.id.menu_refresh -> { + R.id.menu_refresh -> Coroutine.async(scope) { ACache.get(context, "explore").remove(source.bookSourceUrl) - notifyItemChanged(position) + }.onSuccess { + callBack.refreshData() } R.id.menu_del -> Coroutine.async(scope) { appDb.bookSourceDao.delete(source) @@ -170,6 +171,7 @@ class ExploreAdapter(context: Context, private val scope: CoroutineScope, val ca } interface CallBack { + fun refreshData() fun scrollTo(pos: Int) fun openExplore(sourceUrl: String, title: String, exploreUrl: String?) fun editSource(sourceUrl: String) 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 8e78d53bb..d8988e842 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 @@ -150,6 +150,10 @@ class ExploreFragment : VMBaseFragment(R.layout.fragment_explo } } + override fun refreshData() { + initExploreData(searchView.query?.toString()) + } + override fun scrollTo(pos: Int) { (binding.rvFind.layoutManager as LinearLayoutManager).scrollToPositionWithOffset(pos, 0) }