Identify when default Android Checkbox animation ends -


when clicking on checkbox, default android material design animation triggered (from blank "v" mark, , "v" mark blank).

i want identify when animation ends.

according documentation, should possible in 1 of 2 ways -

  • when checkbox checked or unchecked (setoncheckedchangelistener()), obtain current animation object (getanimation()) , register listener on (setanimationlistener()). unfortunately, doesn't work - animation object, @ point in time, null.

  • subclass checkbox object , implement onanimationend() method. unfortunately, doesn't work - method never called.

what missing? way identify when such default animation ends? assume relevant events can registered on other view in activity, can't figure out which.

here relevant code snippet first approach (animation null) -

    checkbox checkbox = (checkbox)findviewbyid(r.id.checkbox1);     checkbox.setoncheckedchangelistener(new compoundbutton.oncheckedchangelistener() {         @override         public void oncheckedchanged(compoundbutton compoundbutton, boolean b) {             animation animation = compoundbutton.getanimation();             log.d("checkbox", "animation " + animation);        }    }); 


Comments