private boolean canScrollToPreviousPage() {
   return mConfiguration.isRtl()
       ? getPreviousPageIndex() <= mConfiguration.firstPageIndex()
       : getPreviousPageIndex() >= mConfiguration.firstPageIndex();
 }
 private int getPreviousPageIndex() {
   return mViewPager.getCurrentItem() + (mConfiguration.isRtl() ? 1 : -1);
 }
 private boolean canScrollToNextPage() {
   return mConfiguration.isRtl()
       ? getNextPageIndex() >= mConfiguration.lastViewablePageIndex()
       : getNextPageIndex() <= mConfiguration.lastViewablePageIndex();
 }
 private int getNextPageIndex() {
   return mViewPager.getCurrentItem() + (mConfiguration.isRtl() ? -1 : 1);
 }