Created
November 13, 2021 08:53
-
-
Save seoft/c53d58169942f4774c72aa6ad188c07e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
binding.recyclerView.addOnScrollListener(object : RecyclerView.OnScrollListener() { | |
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) { | |
super.onScrolled(recyclerView, dx, dy) | |
if (dy > 0 && | |
layoutManager.findLastVisibleItemPosition() > | |
viewModel.uiModelsValue.size - INTERVAL_LOAD_MORE | |
) { | |
viewModel.loadMoreUiModels() | |
} | |
} | |
}) | |
viewModel.uiModels.observe(this) { | |
// 각각 다른 방식으로 처리 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment