Skip to content

Add PageIndicatorView2 to use with ViewPager2#116

Open
adrielcafe wants to merge 2 commits intoromandanylyk:masterfrom
adrielcafe:viewpager2
Open

Add PageIndicatorView2 to use with ViewPager2#116
adrielcafe wants to merge 2 commits intoromandanylyk:masterfrom
adrielcafe:viewpager2

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.

6 participants