Skip to content

Commit 9324f50

Browse files
committed
Merge pull request #205 from kenyee/master
catch and ignore spurious error from NineOldAndroids library
2 parents 5a7ba7e + 0790606 commit 9324f50

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

MaterialDesign/src/com/gc/materialdesign/views/ProgressBarIndeterminate.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,14 @@ public void onAnimationEnd(Animator arg0) {
3636
// Repeat animation
3737
ViewHelper.setX(progressView,-progressView.getWidth()/2);
3838
cont += suma;
39-
ObjectAnimator anim2Repeat = ObjectAnimator.ofFloat(progressView, "x", getWidth());
40-
anim2Repeat.setDuration(duration/cont);
41-
anim2Repeat.addListener(this);
42-
anim2Repeat.start();
39+
try {
40+
ObjectAnimator anim2Repeat = ObjectAnimator.ofFloat(progressView, "x", getWidth());
41+
anim2Repeat.setDuration(duration/cont);
42+
anim2Repeat.addListener(this);
43+
anim2Repeat.start();
44+
} catch (java.lang.ArrayIndexOutOfBoundsException e) {
45+
// ignore this error that sometimes comes from the NineOldAndroids 2.4 library
46+
}
4347
if(cont == 3 || cont == 1) suma *=-1;
4448

4549
}

0 commit comments

Comments
 (0)