private boolean handleBeforeSlideChanged(){
  Fragment currentFragment=mPagerAdapter.getItem(pager.getCurrentItem());
  LogHelper.d(TAG,String.format("User wants to move away from slide: %s. Checking if this should be allowed...",currentFragment));
  if (currentFragment instanceof ISlidePolicy) {
    ISlidePolicy slide=(ISlidePolicy)currentFragment;
    LogHelper.d(TAG,"Current fragment implements ISlidePolicy.");
    if (!slide.isPolicyRespected()) {
      LogHelper.d(TAG,"Slide policy not respected, denying change request.");
      return false;
    }
  }
  LogHelper.d(TAG,"Change request will be allowed.");
  return true;
}

private boolean handleBeforeSlideChanged ( ) { Fragment currentFragment = mPagerAdapter . getItem ( pager . getCurrentItem ( ) ) ; LogHelper . d ( TAG , String . format ( "User wants to move away from slide: %s. Checking if this should be allowed..." , currentFragment ) ) ; if ( currentFragment instanceof ISlidePolicy ) { ISlidePolicy slide = ( ISlidePolicy ) currentFragment ; LogHelper . d ( TAG , "Current fragment implements ISlidePolicy." ) ; if ( ! slide . isPolicyRespected ( ) ) { LogHelper . d ( TAG , "Slide policy not respected, denying change request." ) ; return false ; } } LogHelper . d ( TAG , "Change request will be allowed." ) ; return true ; }
called before a slide change happens . by returning false , one can disallow the slide change .
