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 +} 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 +}