From fb831f5df6115a6e05e863be1aae412932c9217e Mon Sep 17 00:00:00 2001 From: kunfei Date: Sun, 16 Feb 2020 18:17:32 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/legado/app/ui/main/explore/ExploreAdapter.kt | 4 +++- .../java/io/legado/app/ui/main/explore/ExploreFragment.kt | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) 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 2cf926d34..4d29a79c3 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 @@ -78,7 +78,9 @@ class ExploreAdapter(context: Context, private val scope: CoroutineScope, val ca if (exIndex != -1) { notifyItemChanged(position, false) } - callBack.scrollTo(position) + postDelayed({ + callBack.scrollTo(position) + }, 200) } ll_title.onLongClick { showMenu(ll_title, holder.layoutPosition) 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 de77f417c..78cdd141a 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 @@ -133,7 +133,7 @@ class ExploreFragment : VMBaseFragment(R.layout.fragment_find_ } override fun scrollTo(pos: Int) { - rv_find.smoothScrollToPosition(pos) + (rv_find.layoutManager as LinearLayoutManager).scrollToPositionWithOffset(pos, 0) } override fun openExplore(sourceUrl: String, title: String, exploreUrl: String) {