Add PageIndicatorView2 to use with ViewPager2#116
Add PageIndicatorView2 to use with ViewPager2#116adrielcafe wants to merge 2 commits intoromandanylyk:masterfrom
Conversation
|
@romandanylyk it will be cool to have this in the lib |
|
Merge this pls >>> |
|
👍 |
Ironthighs
left a comment
There was a problem hiding this comment.
Please account for using AdapterListUpdateCallback and adding back in the onPageSelected/onPageSelect usage.
| return; | ||
| } | ||
|
|
||
| setObserver = new RecyclerView.AdapterDataObserver() { |
There was a problem hiding this comment.
Should have other overrides to work with Android's AdapterListUpdateCallback.
override fun onItemRangeInserted(positionStart: Int, itemCount: Int) is important because without it, there are cases where the page indicator view won't display when it should. Same with implementing override fun onItemRangeChanged(positionStart: Int, itemCount: Int).
| startIdleRunnable(); | ||
| } | ||
|
|
||
| pageChangeCallback = new ViewPager2.OnPageChangeCallback() { |
There was a problem hiding this comment.
Missing important other override: fun onPageSelected(position: Int)
This override should call onPageSelect(position: Int) which is currently just going unused in this file.
Related to #115
I added a PageIndicatorView2 class that works well with ViewPager2.