Ich habe eine Animation auf ProgressBar
in Click-Ereignisse in AdapterWie Animation von Blick bekommen
ObjectAnimator animation = ObjectAnimator.ofInt(holder.progressbar, "progress", 0, 100);
animation.setDuration(PROGRESS_TIME);
animation.setInterpolator(new DecelerateInterpolator());
animation.addListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animator) {
Toast.makeText(context,"HELL_Start",Toast.LENGTH_SHORT).show();
}
@Override
public void onAnimationEnd(Animator animator) {
//do something when the countdown is complete
Toast.makeText(context,"HELL_OFF_END",Toast.LENGTH_SHORT).show();
}
@Override
public void onAnimationCancel(Animator animator) {
Toast.makeText(context,"HELL_OFF_Cancel",Toast.LENGTH_SHORT).show();
}
@Override
public void onAnimationRepeat(Animator animator) { }
});
animation.start();
gesetzt
Ich versuche, Animation, mithilfe von
aus denProgressBar
(wenn Liste Elementwert erhalten geändert) zu erhalten
AlphaAnimation animation = (AlphaAnimation)mProgressBar.getAnimation();
aber es kehrt null
Ihr Objekt Animator arbeitet unabhängig von der Sicht, so dass Sie nicht aus der Sicht gehen zu können, um es zu bekommen. Aber warum referenzieren Sie nicht nur die von Ihnen erstellte Animation? – dominicoder
@dominicoder wie man es für jedes Listenelement hinzufügt und dann auf es verweist, wenn geklickt wird –