Retractable button bar using animations
Posted
by AndroidDev
on Stack Overflow
See other posts from Stack Overflow
or by AndroidDev
Published on 2010-05-21T10:35:51Z
Indexed on
2010/05/21
10:40 UTC
Read the original article
Hit count: 216
I want to create a button bar that is retractable: when the user clicks on a special "handle" button, the button bar should slide out of view partially so only the handle remains visible.
When the bar is in retracted state only the handle is visible. Clicking on the handle should "slide out" the button bar so it is completely visible again.
Ideally, the bar would start out in retracted state.
I have tried some approaches using TranslateAnimation, including using a layout animation or calling "View.startAnimation" when the handle is clicked, but no luck so far.
Do you guys have any tips how to approach this? Is there any decent documentation out there regarding Android animations?
The documentation I find is sketchy at best. For instance, I found examples that cause a view to slide into view automatically using TranslateAnimation and a LayoutAnimationController when calling "addView", but when I call removeView no animation seems to be triggered at all, even if I set an animation that should create the opposite motion.
© Stack Overflow or respective owner