• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Animated Layout Mask

jamgood96

Lurker
Hi All,

I'm not sure the best way to explain what I'm trying to do, and Googling it has proven to be quite difficult, so my apologies if I'm long winded at all...

Basically, I want to have a couple of layouts and have one of them animate to reveal the layout below. I've attached a crude image of what I'm attempting to do.

As the top layout animates out of the way, I want all of its contents to remain in their relative positions. The same goes for the layout behind.

I have tried setting one of the layout's height to 0 and then animated it to be full height, but this reeks havoc on the scaling and the placement of the elements inside. I also tried implementing the solution in the link below, but it didn't do what I needed.

Is it possible to mask a View in android? - Stack Overflow

I hope this makes some sense. Any guidance would be greatly appreciated!

- James
 

Attachments

  • android.png
    android.png
    25.8 KB · Views: 159
Dunno about buttons, but It seems like it should be possible

So I read a bit and tried a few things but it seems that this is limited to drawables only, not a layout. :-(

I've tried looking through some of the documentation for Layouts and Views, and while there is mention of clipping in various spots, none of it makes much sense to me. There's a clipChildren attribute, a clipToPadding, and a few others, but I'm not sure any will help me.

I've tried a few hacks that allow me to adjust the height of a layout, but it's very difficult to get the contents of the layout to stay in their exact same spots as well as maintain their size as the parent layout height shrinks.

Any other thoughts or ideas?

Thanks!

- James
 
Back
Top Bottom