The bell animation now is smooth
This commit is contained in:
parent
97b460d1d0
commit
f279298af1
@ -12,18 +12,20 @@ public class BellAnimation extends Transition {
|
|||||||
int index;
|
int index;
|
||||||
|
|
||||||
public BellAnimation(ImageView imageView, Image[] bells) {
|
public BellAnimation(ImageView imageView, Image[] bells) {
|
||||||
setCycleCount(17);
|
setCycleCount(16);
|
||||||
index = 0;
|
index = 0;
|
||||||
this.imageView = imageView;
|
this.imageView = imageView;
|
||||||
this.bells = bells;
|
this.bells = bells;
|
||||||
setCycleDuration(new Duration(59));
|
setCycleDuration(new Duration(100));
|
||||||
setInterpolator(Interpolator.DISCRETE);
|
setInterpolator(Interpolator.DISCRETE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void interpolate(double frac) {
|
protected void interpolate(double frac) {
|
||||||
|
if(index < 17) {
|
||||||
imageView.setImage(bells[index]);
|
imageView.setImage(bells[index]);
|
||||||
|
}
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user