android/views-widgets-samples
Multiple samples showing the best practices in views-widgets on Android. - android/views-widgets-samples
github.com
https://developer.android.com/guide/topics/ui/layout/recyclerview?hl=ko#java
RecyclerView로 목록 만들기 | Android 개발자 | Android Developers
RecyclerView를 사용하여 동적 콘텐츠의 목록과 그리드를 표시합니다.
developer.android.com
smoothScroller: stackoverflow.com/questions/52964701/how-to-make-auto-smooth-scroll-with-offset-recycler-view
How to make auto smooth scroll with offset Recycler View?
There is such issue, I have horizontal RecyclerView where each cell less than width of screen. So I found a solution here RecyclerVIew auto scroll to display all the elements as in News Feed et...
stackoverflow.com
SmoothScroller smoothScroller = new LinearSmoothScroller(recyclerView.getContext()) {
@Override protected int getVerticalSnapPreference() {
return LinearSmoothScroller.SNAP_TO_ANY;
}
@Override protected float calculateSpeedPerPixel(DisplayMetrics displayMetrics) {
return 120f / displayMetrics.densityDpi;
}
}; .
..
smoothScroller.setTargetPosition(position);
recyclerView.getLayoutManager().startSmoothScroll(smoothScroller);
수평, 수직 형태의 RecyclerView에 따라 getHorizontalSnapPreference(), getVerticalSnapPreference() 를 오버라이딩 하여 scroll시 Item의 margin 위치에 따라 시작, 끝 기준을 정하여 구현해주면 된다.
RecyclerView의 scrollToPosition나 smoothScrollToPosition 사용 시 Item사이의 margin이 있는 경우
RecyclerView의 scrollToPosition나 smoothScrollToPosition 을 사용할 경우 각각의 Item 사이의 margin이 존재하여 정확한 위치에 스크롤 되지 않고 Margin만큼 벌어져서 보여지게 되는 경우가 있다. val smoothS..
kimch3617.tistory.com
'개발 관련 이야기 > 안드로이드앱 개발' 카테고리의 다른 글
[안드로이드] 앱게시 - 디벨로퍼사이트 구글 공식사이트 (0) | 2020.05.09 |
---|---|
(2020신간) 안드로이드 앱개발 도서목록 (0) | 2020.05.09 |
[파이어베이스] 가격 정책,,, (0) | 2020.05.08 |
구글 플레이스토어에 앱등록하는 방법 (0) | 2020.05.08 |
Activity 수명 주기에 대한 이해 (0) | 2020.05.07 |