Dismissable banner in Android
Question
I would like to show a banner in an Android activity.
The banner should be:
- Aligned at the bottom of the layout
- Take all the width and have relative height (say 100dip)
- Be dismissable
When dismissed the rest of the layout should strech to fill the area that was occupied by the banner.
What's the best way to implement this in Android?
Thanks!
Solution
you can set up an Animation
to slide the banner down, and when it's out of the view (setup a onAnimationComplete
listener) call it's method : setVisibility(View.GONE)
so it will not take up space in layout any more.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow