private void reflectMemberVariablesInRightButton(){
  final boolean lastPageReached=(viewPager.getCurrentItem() + 1) == pages.size();
  final boolean buttonShouldBeInvisible=lastPageReached || rightButtonDisabled;
  final boolean buttonIsCurrentlyInvisible=rightButton.getVisibility() == View.INVISIBLE;
  final boolean shouldUpdateButton=buttonShouldBeInvisible != buttonIsCurrentlyInvisible;
  if (shouldUpdateButton) {
    final Animator buttonAnimator=buttonShouldBeInvisible ? buttonAnimatorFactory.newRightButtonDisappearAnimator(rightButton) : buttonAnimatorFactory.newRightButtonAppearAnimator(rightButton);
    if (buttonShouldBeInvisible) {
      disableButton(buttonAnimator,rightButton);
    }
 else {
      enableButton(buttonAnimator,rightButton);
    }
  }
}

private void reflectMemberVariablesInRightButton ( ) { final boolean lastPageReached = ( viewPager . getCurrentItem ( ) + 1 ) == pages . size ( ) ; final boolean buttonShouldBeInvisible = lastPageReached || rightButtonDisabled ; final boolean buttonIsCurrentlyInvisible = rightButton . getVisibility ( ) == View . INVISIBLE ; final boolean shouldUpdateButton = buttonShouldBeInvisible != buttonIsCurrentlyInvisible ; if ( shouldUpdateButton ) { final Animator buttonAnimator = buttonShouldBeInvisible ? buttonAnimatorFactory . newRightButtonDisappearAnimator ( rightButton ) : buttonAnimatorFactory . newRightButtonAppearAnimator ( rightButton ) ; if ( buttonShouldBeInvisible ) { disableButton ( buttonAnimator , rightButton ) ; } else { enableButton ( buttonAnimator , rightButton ) ; } } }
enables or disables the right button , so that it matches the current member variables .
