Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- Machine Learning
- len()
- dendrogram
- IN
- Dictionary
- nan
- data
- 반복문
- 최댓값
- numpy
- append()
- DataFrame
- sklearn
- insert()
- list
- 분류 결과표
- function
- del
- DataAccess
- 덴드로그램
- wcss
- elbow method
- pandas
- count()
- string
- 최솟값
- hierarchical_clustering
- matplotlib
- Python
- analizer
Archives
- Today
- Total
개발공부
[Android] 리사이클러뷰 스크롤 위치 찾기, 페이징 처리 본문
recyclerView = findViewById(R.id.recyclerView);
recyclerView.setHasFixedSize(true);
recyclerView.setLayoutManager(new LinearLayoutManager(MainActivity.this));
// 리사이클러뷰가 맨 밑까지 갔는지 알 수 있는 방법.
recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrollStateChanged(@NonNull RecyclerView recyclerView, int newState) {
super.onScrollStateChanged(recyclerView, newState);
}
@Override
public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {
super.onScrolled(recyclerView, dx, dy);
// 리사이클러뷰 가장 마지막 index
int lastPosition = ((LinearLayoutManager) recyclerView.getLayoutManager())
.findLastCompletelyVisibleItemPosition();
// 받아온 리사이클러 뷰 카운트
int totalCount = recyclerView.getAdapter().getItemCount();
// 스크롤을 맨 끝까지 한 것!
if(lastPosition == totalCount -1){
// 이곳에 스크롤이 맨 끝에 왔을 경우
// 행동할 코드 입력
}
}
});
'Android' 카테고리의 다른 글
[Android] Retrofit2 라이브러리 사용을 위한 설정 방법 (0) | 2022.07.21 |
---|---|
[Android] 카메라 / 앨범 처리 (0) | 2022.07.21 |
[Android] 이미지 처리를 위한 Glide 라이브러리 사용법 (0) | 2022.07.20 |
[Android] ActionBar 뒤로가기(Back) 버튼 설정하기 (0) | 2022.07.19 |
[Android] Floating Action Button 사용하는 방법 (0) | 2022.07.19 |