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' -

Making Empty C++ Project: General exception (Exception from HRESULT:0x80131500) Visual Studio Community 2015 -

How to fix java warning for "The value of the local variable is not used " -