I want to Animate two Different layouts.
Example

I already have the animation the way I want, I just want to animate a different XML Layout.
There is a class LayoutAnimationController, but I really dont know how to use it.
Can some one point me in the right direction, with an example or good explanation.
heres the code I use to animate.
TranslateAnimation slide = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 300f, 0,0 );
slide.setAnimationListener(AL);
slide.setFillAfter(true);
slide.setDuration(1000);
parentlayout.startAnimation(slide);
Update
Because of the many up-votes I decided to put a example project into a Git repository.
See my answers for the link.
Ok After spending 2 days reading about similair problems and how people solved them I finally was able to create the thing I wanted.
I was not able to do it with 2 diffrent XML files, but I doubt it is not possible.
I did encountert some problems tho.
After the first animation ended, the button was not clickable.
This is because the animation shows that everything is moved but it does not update the layout, so the button is still at the position where the animation started.
So I had to calculate the new position of the layout.
I think I read somewhere that this is no longer an issue in 3.0, but correct me if I am wrong
Another was that when I had my animation finally working the way I wanted my underlaying view did disapear before the animation was finished because I invoked
view.setVisabilty(View.GONE);.Now the problem was when I did not invoke that method, the animation just hang for a second and then shooter to the end position of the animation.
So I added a empty LinearLayout (can be anything) , Default property on GONE, when the animation starts set it on Visible. when you revert the animation, set it again to gone.
after doing this the animation was working the way I wanted.
And if you are using a Rel, Linear, or any other layout.
then you cant stack views in the Z order so you have to use an SurfaceView.
so heres main.xml
heres the java code
I did some extra coding on touching views and stuff.
And the final result
before Animation
after First Animation
And after the second Animation back to the left it states returns as the first Image.
Al those posts that helped me really deserve some credit but I cant find any of them.
Edit
GIT https://bitbucket.org/maikelbollemeijer/sidepanelswitcher
Update:
https://github.com/jfeinstein10/SlidingMenu
this lib is compatible with Actionbar Sherlock.
hope this helps