@Override
        public void onChanged() {
            PagerAdapter adapter = mPager.getAdapter();
            int count = 0;
            if(adapter instanceof InfinitePagerAdapter){
                count = ((InfinitePagerAdapter)adapter).getRealCount();
            }else{
                count = adapter.getCount();
            }
            if(count > mItemCount){
                for(int i =0 ; i< count - mItemCount;i++){
                    ImageView indicator = new ImageView(mContext);
                    indicator.setImageDrawable(mUnselectedDrawable);
                    indicator.setPadding((int)mUnSelectedPadding_Left,
                            (int)mUnSelectedPadding_Top,
                            (int)mUnSelectedPadding_Right,
                            (int)mUnSelectedPadding_Bottom);
                    addView(indicator);
                    mIndicators.add(indicator);
                }
            }else if(count < mItemCount){
                for(int i = 0; i < mItemCount - count;i++){
                    removeView(mIndicators.get(0));
                    mIndicators.remove(0);
                }
            }
            mItemCount = count;
            mPager.setCurrentItem(mItemCount*20 + mPager.getCurrentItem());
        }
since we used a adapter wrapper, so we can't getCount directly from wrapper.
@return
library/src/main/java/com/daimajia/slider/library/Indicators/PagerIndicator.java