Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

adrielcafe
Copy link

Related to #115

I added a PageIndicatorView2 class that works well with ViewPager2.

@adrielcafe adrielcafe changed the title Viewpager2 Add PageIndicatorView2 to use with ViewPager2 May 16, 2019
@danielgomezrico
Copy link

@romandanylyk it will be cool to have this in the lib

@Areyana
Copy link

Areyana commented Feb 17, 2020

Merge this pls >>>

@robyka400
Copy link

👍

Copy link

@Ironthighs Ironthighs left a 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() {

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() {

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants