From e19ecbadc1a555e85abf2453b38fe20edf5c94e9 Mon Sep 17 00:00:00 2001 From: 10bits Date: Tue, 20 Oct 2020 21:28:25 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=8A=A0=E8=BD=BD=E6=9B=B4=E5=A4=9A?= =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E5=8A=A0=E8=BD=BD=E6=9B=B4=E5=A4=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/legado/app/ui/widget/recycler/LoadMoreView.kt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/widget/recycler/LoadMoreView.kt b/app/src/main/java/io/legado/app/ui/widget/recycler/LoadMoreView.kt index 01cb906cb..57df4f6e0 100644 --- a/app/src/main/java/io/legado/app/ui/widget/recycler/LoadMoreView.kt +++ b/app/src/main/java/io/legado/app/ui/widget/recycler/LoadMoreView.kt @@ -32,7 +32,13 @@ class LoadMoreView(context: Context) : FrameLayout(context) { fun stopLoad() { rotate_loading.hide() } - + + fun hasMore() { + hasMore = true + tv_text.invisible() + rotate_loading.show() + } + fun noMore(msg: String? = null) { hasMore = false rotate_loading.hide() @@ -44,4 +50,4 @@ class LoadMoreView(context: Context) : FrameLayout(context) { tv_text.visible() } -} \ No newline at end of file +} From d8a53629556adc38e1eb09375a7aa4a9cf694d33 Mon Sep 17 00:00:00 2001 From: 10bits Date: Tue, 20 Oct 2020 21:31:26 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=8F=91=E7=8E=B0?= =?UTF-8?q?=E4=B9=A6=E7=B1=8D=E4=B8=8D=E5=8F=AF=E4=BB=A5=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=E6=9B=B4=E5=A4=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/legado/app/ui/book/explore/ExploreShowActivity.kt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/ui/book/explore/ExploreShowActivity.kt b/app/src/main/java/io/legado/app/ui/book/explore/ExploreShowActivity.kt index a447bb9e1..5a6248869 100644 --- a/app/src/main/java/io/legado/app/ui/book/explore/ExploreShowActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/explore/ExploreShowActivity.kt @@ -38,6 +38,13 @@ class ExploreShowActivity : VMBaseActivity(R.layout.activi loadMoreView = LoadMoreView(this) adapter.addFooterView(loadMoreView) loadMoreView.startLoad() + loadMoreView.setOnClickListener { + if (!isLoading) { + isLoading = true + loadMoreView.hasMore() + scrollToBottom() + } + } recycler_view.addOnScrollListener(object : RecyclerView.OnScrollListener() { override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) { super.onScrolled(recyclerView, dx, dy) @@ -75,4 +82,4 @@ class ExploreShowActivity : VMBaseActivity(R.layout.activi Pair("author", book.author) ) } -} \ No newline at end of file +}