use of android.database.DataSetObserver in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class DotsPageIndicator method setViewPager.
public void setViewPager(ViewPager viewPager) {
this.viewPager = viewPager;
viewPager.setOnPageChangeListener(this);
setPageCount(viewPager.getAdapter().getCount());
viewPager.getAdapter().registerDataSetObserver(new DataSetObserver() {
@Override
public void onChanged() {
setPageCount(DotsPageIndicator.this.viewPager.getAdapter().getCount());
}
});
setCurrentPageImmediate();
}
Aggregations