java - Change button function during animation -


i need change button function during animation playback @julianonunessilvaoliveria said can change flag variable :

boolean = false; if (something) { doa(); = false;} else { dob(); } 

but how use it? start animation this

oilcan.startanimation(seq1) 

you can use animatorlistener:

oilcan.animate().setlistener(new animator.animatorlistener() {                 @override                 public void onanimationstart(animator animation) {                   = false;                 }                  @override                 public void onanimationend(animator animation) {                   = true;                 }                  @override                 public void onanimationcancel(animator animation) {                  }                  @override                 public void onanimationrepeat(animator animation) {                  }             });         } 

Comments