diff --git a/InkPageIndicator/build.gradle b/InkPageIndicator/build.gradle index e1e6550..e649185 100644 --- a/InkPageIndicator/build.gradle +++ b/InkPageIndicator/build.gradle @@ -6,7 +6,7 @@ android { buildToolsVersion "23.0.1" defaultConfig { - minSdkVersion 16 + minSdkVersion 14 targetSdkVersion 23 versionCode 1 versionName "1.0" diff --git a/InkPageIndicator/src/main/java/com/pixelcan/inkpageindicator/InkPageIndicator.java b/InkPageIndicator/src/main/java/com/pixelcan/inkpageindicator/InkPageIndicator.java index 35032ea..c44daf1 100644 --- a/InkPageIndicator/src/main/java/com/pixelcan/inkpageindicator/InkPageIndicator.java +++ b/InkPageIndicator/src/main/java/com/pixelcan/inkpageindicator/InkPageIndicator.java @@ -30,12 +30,14 @@ import android.graphics.RectF; import android.os.Parcel; import android.os.Parcelable; +import android.support.v4.view.ViewCompat; import android.support.v4.view.ViewPager; +import android.support.v4.view.animation.FastOutSlowInInterpolator; import android.util.AttributeSet; import android.util.Log; import android.view.View; import android.view.animation.Interpolator; -import android.support.v4.view.animation.FastOutSlowInInterpolator; + import java.util.Arrays; @@ -608,7 +610,7 @@ public void onAnimationUpdate(ValueAnimator valueAnimator) { // todo avoid autoboxing selectedDotX = (Float) valueAnimator.getAnimatedValue(); retreatAnimation.startIfNecessary(selectedDotX); - postInvalidateOnAnimation(); + ViewCompat.postInvalidateOnAnimation(InkPageIndicator.this); } }); moveSelected.addListener(new AnimatorListenerAdapter() { @@ -642,18 +644,20 @@ private void setJoiningFraction(int leftDot, float fraction) { } joiningFractions[leftDot] = fraction; - postInvalidateOnAnimation(); + ViewCompat.postInvalidateOnAnimation(this); + ; } } private void clearJoiningFractions() { Arrays.fill(joiningFractions, 0f); - postInvalidateOnAnimation(); + ViewCompat.postInvalidateOnAnimation(this); } private void setDotRevealFraction(int dot, float fraction) { dotRevealFractions[dot] = fraction; - postInvalidateOnAnimation(); + ViewCompat.postInvalidateOnAnimation(this); + ; } private void cancelJoiningAnimations() { @@ -726,7 +730,7 @@ public PendingRetreatAnimator(int was, int now, int steps, StartPredicate predic public void onAnimationUpdate(ValueAnimator valueAnimator) { // todo avoid autoboxing retreatingJoinX1 = (Float) valueAnimator.getAnimatedValue(); - postInvalidateOnAnimation(); + ViewCompat.postInvalidateOnAnimation(InkPageIndicator.this); // start any reveal animations if we've passed them for (PendingRevealAnimator pendingReveal : revealAnimations) { pendingReveal.startIfNecessary(retreatingJoinX1); @@ -746,7 +750,7 @@ public void onAnimationUpdate(ValueAnimator valueAnimator) { public void onAnimationUpdate(ValueAnimator valueAnimator) { // todo avoid autoboxing retreatingJoinX2 = (Float) valueAnimator.getAnimatedValue(); - postInvalidateOnAnimation(); + ViewCompat.postInvalidateOnAnimation(InkPageIndicator.this); // start any reveal animations if we've passed them for (PendingRevealAnimator pendingReveal : revealAnimations) { pendingReveal.startIfNecessary(retreatingJoinX2); @@ -766,14 +770,14 @@ public void onAnimationStart(Animator animation) { } retreatingJoinX1 = initialX1; retreatingJoinX2 = initialX2; - postInvalidateOnAnimation(); + ViewCompat.postInvalidateOnAnimation(InkPageIndicator.this); } @Override public void onAnimationEnd(Animator animation) { retreatingJoinX1 = INVALID_FRACTION; retreatingJoinX2 = INVALID_FRACTION; - postInvalidateOnAnimation(); + ViewCompat.postInvalidateOnAnimation(InkPageIndicator.this); } }); } @@ -804,7 +808,7 @@ public void onAnimationUpdate(ValueAnimator valueAnimator) { @Override public void onAnimationEnd(Animator animation) { setDotRevealFraction(PendingRevealAnimator.this.dot, 0f); - postInvalidateOnAnimation(); + ViewCompat.postInvalidateOnAnimation(InkPageIndicator.this); } }); } diff --git a/app/build.gradle b/app/build.gradle index 178d1c5..fe9d0f0 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -6,7 +6,7 @@ android { defaultConfig { applicationId "com.pixelcan.ipidemo" - minSdkVersion 16 + minSdkVersion 14 targetSdkVersion 23 versionCode 1 versionName "1.0"