android - How to repeat YoYo Animation Techniques infinite times? -
hi everyone..
i'm using nice animation techniques github. guy provide nice text effect , use of them infinite times not if user pressed particular button , play effect.
here code:
private yoyo.yoyostring rope; rope = yoyo.with(techniques.rollout) .duration(1200) .interpolate(new acceleratedecelerateinterpolator()) .withlistener(new animator.animatorlistener() { @override public void onanimationstart(animator animation) {} @override public void onanimationend(animator animation) {} @override public void onanimationcancel(animator animation) {} @override public void onanimationrepeat(animator animation) {} }).playon(mtarget); so here problem when i'm going add code @ onanimationend method:
animation.setrepeatcount(animation.infinite); there error , said: "the method setrepeatcount(int) undefined type animator".
if want proceed please go github address i've provided. so, again in short, want repeat animation infinite times.
this trick works me. try
yoyo.with(techniques.rollout) .duration(1200) .interpolate(new acceleratedecelerateinterpolator()) .withlistener(new animator.animatorlistener() { @override public void onanimationstart(animator animation) {} @override public void onanimationend(animator animation) { yoyo.with(techniques.rollout) .duration(1200) .interpolate(new acceleratedecelerateinterpolator()) .withlistener(this).playon(mtarget); } @override public void onanimationcancel(animator animation) {} @override public void onanimationrepeat(animator animation) {} }).playon(mtarget);
Comments
Post a Comment