fix: popup spam
This commit is contained in:
parent
913d74b285
commit
867a4f36b3
1 changed files with 44 additions and 44 deletions
|
@ -176,10 +176,10 @@ class CommentsFragment : Fragment() {
|
||||||
object : View.OnTouchListener {
|
object : View.OnTouchListener {
|
||||||
override fun onTouch(v: View?, event: MotionEvent?): Boolean {
|
override fun onTouch(v: View?, event: MotionEvent?): Boolean {
|
||||||
if (event?.action == MotionEvent.ACTION_UP) {
|
if (event?.action == MotionEvent.ACTION_UP) {
|
||||||
if (pagesLoaded < totalPages) {
|
|
||||||
if (!binding.commentsList.canScrollVertically(1) && !isFetching &&
|
if (!binding.commentsList.canScrollVertically(1) && !isFetching &&
|
||||||
(binding.commentsList.layoutManager as LinearLayoutManager).findLastVisibleItemPosition() == (binding.commentsList.adapter!!.itemCount - 1)
|
(binding.commentsList.layoutManager as LinearLayoutManager).findLastVisibleItemPosition() == (binding.commentsList.adapter!!.itemCount - 1)
|
||||||
) {
|
) {
|
||||||
|
if (pagesLoaded < totalPages) {
|
||||||
binding.commentBottomRefresh.visibility = View.VISIBLE
|
binding.commentBottomRefresh.visibility = View.VISIBLE
|
||||||
loadMoreComments()
|
loadMoreComments()
|
||||||
lifecycleScope.launch {
|
lifecycleScope.launch {
|
||||||
|
@ -188,11 +188,11 @@ class CommentsFragment : Fragment() {
|
||||||
binding.commentBottomRefresh.visibility = View.GONE
|
binding.commentBottomRefresh.visibility = View.GONE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
snackString("No more comments")
|
snackString("No more comments")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue