code: private int getShouldDrawCount(){
          if(mPager.getAdapter() instanceof InfinitePagerAdapter){
              return ((InfinitePagerAdapter)mPager.getAdapter()).getRealCount();
          }else{
              return mPager.getAdapter().getCount();
          }
      }
docs: since we used a adapter wrapper, so we can't getCount directly from wrapper.
  @return