Skip to content

Commit

Permalink
[feature] #306 - RecyclerView 최하단 도달 조건 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
hansh0101 committed Jun 22, 2022
1 parent 22c2ac9 commit 20835d9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/src/main/java/co/kr/bemyplan/ui/list/ListActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,10 @@ class ListActivity : AppCompatActivity() {
rvLinearContent.addOnScrollListener(object : RecyclerView.OnScrollListener() {
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
super.onScrolled(recyclerView, dx, dy)
if(dy > 0) {
if (dy > 0) {
if (!rvLinearContent.canScrollVertically(1) &&
(recyclerView.layoutManager as LinearLayoutManager).findLastVisibleItemPosition() == listAdapter.itemCount - 1) {
(recyclerView.layoutManager as LinearLayoutManager).findLastVisibleItemPosition() == listAdapter.itemCount - 1
) {
when (from) {
"new" -> {
viewModel.fetchMoreLatestList()
Expand Down

0 comments on commit 20835d9

Please sign in to comment.