android - Cannot set visibility after using ObjectAnimator -


i using nineoldandroids animations. trying achieve apply animation button before hiding it. so, apply animations button , call setvisibility(view.gone), seems it's not taking effect. button still on screen , handles clicks. should 'reset' somehow button state after applying animations?

    final button button = (button) getview().findviewbyid(r.id.user_to_button);     button.setonclicklistener(new view.onclicklistener() {         @override         public void onclick(view v) {             objectanimator.offloat(animatorproxy.wrap(v), "alpha", 1, 0).setduration(100).start();             objectanimator.offloat(animatorproxy.wrap(v), "translationx", 0, -v.getwidth()).setduration(100).start();             v.setvisibility(view.gone);         }     }); 

if remove animations works expected - hides button.

use before setvisibility after animation completed:

anim.reverse();         anim.removealllisteners();         anim.end();         anim.cancel(); 

where anim objectanimator


Comments

Popular posts from this blog

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

python - How do I create a list index that loops through integers in another list -

c# - “System.Security.Cryptography.CryptographicException: Keyset does not exist” when reading private key from remote machine -