-
Notifications
You must be signed in to change notification settings - Fork 564
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add PageIndicatorView2 to use with ViewPager2 #116
base: master
Are you sure you want to change the base?
Conversation
@romandanylyk it will be cool to have this in the lib |
Merge this pls >>> |
👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.