diff --git a/library/src/main/java/com/heinrichreimersoftware/materialintro/app/IntroActivity.java b/library/src/main/java/com/heinrichreimersoftware/materialintro/app/IntroActivity.java index d71bbd4..279029b 100644 --- a/library/src/main/java/com/heinrichreimersoftware/materialintro/app/IntroActivity.java +++ b/library/src/main/java/com/heinrichreimersoftware/materialintro/app/IntroActivity.java @@ -309,13 +309,15 @@ private void smoothScrollPagerTo(final int position) { animator.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { - pager.endFakeDrag(); + if (pager.isFakeDragging()) + pager.endFakeDrag(); pager.setCurrentItem(position); } @Override public void onAnimationCancel(Animator animation) { - pager.endFakeDrag(); + if (pager.isFakeDragging()) + pager.endFakeDrag(); } }); animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { @@ -1059,7 +1061,7 @@ public boolean isButtonBackVisible() { @SuppressWarnings("unused") public void setButtonBackVisible(boolean visible) { - buttonBack.setVisibility(visible ? View.VISIBLE : View.GONE); + buttonBack.setVisibility(visible ? View.VISIBLE : View.INVISIBLE); } @SuppressWarnings("unused") @@ -1069,7 +1071,7 @@ public boolean isButtonNextVisible() { @SuppressWarnings("unused") public void setButtonNextVisible(boolean visible) { - buttonNext.setVisibility(visible ? View.VISIBLE : View.GONE); + buttonNext.setVisibility(visible ? View.VISIBLE : View.INVISIBLE); } @SuppressWarnings("unused")