tags:

views:

232

answers:

1

I am trying to create a menu that slides up from the bottom. It starts with the menu's view just visible at the bottom of the screen, and then clicking it causes it to slide up. I tried using a TranslateAnimation, but although the pixels move, the hit areas of the menu are in the same position as before. So I think that if I can adjust the menu's margins after the animation is complete, this will accomplish what I want. However, I can't figure out how to adjust the margins.

I've tried to create a LinearLayout.LayoutMargins object and then set its margins and apply it to the menu's view (which is a LinearLayout), but this doesn't work.

Any ideas?

+1  A: 

My solution was to create two LinearLayouts, one in it's up state (set to gone) and the other in the menu's down state. Then when the user clicks on the button to slide the menu up, I call a TranslateAnimation showing the menu slide up. I put a listener on the animation that causes the up state to be visible and the down state to be gone when the animation finishes. I reversed this for the "closing" action.

Not exactly the way I had originally imagined doing it, but it worked.

karnage