我想将动画设置为图像视图中的图像,如报摊应用程序,并在特定时间间隔后更改图像。
请帮助它对我非常重要。
答案 0 :(得分:0)
用于动画视图(包括图像视图)我建议this library
设置动画时间及其结束时更改图像,the code snippet
rope = YoYo.with(Techniques.FadeIn).duration(1000).playOn(mTarget);// after start,just click mTarget view, rope is not init
mListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Techniques technique = (Techniques)view.getTag();
rope = YoYo.with(technique)
.duration(1200)
.interpolate(new AccelerateDecelerateInterpolator())
.withListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animation) {
}
@Override
public void onAnimationEnd(Animator animation) {
//change image here
}
@Override
public void onAnimationCancel(Animator animation) {
Toast.makeText(MyActivity.this, "canceled", Toast.LENGTH_SHORT).show();
}
@Override
public void onAnimationRepeat(Animator animation) {
}
})
.playOn(mTarget);
}
});