I am having a HorizontalScrollView in my application and I am playing with its visibility very frequently(VISIBLE and GONE). So what I want is, instead of suddenly making it visible and invisible, can I apply some kind of animation or something so that it will start becoming visible and invisible in a sliding manner ?
Any help or suggestions would be highly appreciated. Thanks in advance.
You could try this:
Animation animation = new TranslateAnimation(0,0,0,1000);
animation.setDuration(1000);
yourButtonorImage.startAnimation(animation);
To make it visible or invisible you could use setAnimationListener. In onAnimationEnd, make it visible or invisible. NOt sure if this is what you meant..Hope it helps..
Try this..
youView.setVisibility(View.VISIBLE);
ObjectAnimator anim = ObjectAnimator.ofFloat(youView, "alpha", 0f, 1f);
anim.setDuration(1000);
anim.start();
Api Level Restrictions Applied.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With