I'm using Android Fragments. I want to achieve the effect below.
I have 2 fragments details and a main-body. On a button click I want the details panel slide down and pan out part of the main-body.
The details panel isn't declared in the activity's xml layout. It is being added dynamically. Also the details panel can be dismissed when the user is done with it.
I found an example of exactly what I want to do. The Gmail app in honeycomb does this when you have it in portrait mode on the Xoom. Navigate all the way to an email such that it is take up the whole screen. Press the back button and notice the email body pans to the right to make room for the email messages list.
The best approach I've currently seen and use (with views but should work for fragments as well) is following: http://udinic.wordpress.com/2011/09/03/expanding-listview-items/
Basically he creates a view with negative margin and then he animates the margin to the desired value. This basically transforms the view properly instead of just doing a simple animation. I'm working on my own implementation that uses height instead of margin.
I'm VERY interested in a better approach. This gets the job done, but I don't like the way its done :)
Edit: I've done it in the following way: https://stackoverflow.com/a/9290723/969325
This is for views but could be used for fragments as well.
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