Q:

Sliding up Animation but wrap_content

What I want to achieve is the XML (no code please!!!) to do this:

I don't want the xml below because it drag my popup window to the top of screen
    <translate 
    android:fromYDelta="100%p" 
    android:toYDelta="0%p" 
    android:fillAfter="true"
    android:interpolator="@android:anim/linear_interpolator"
    android:duration="500" />

Here's my XML but it doesn't work either :(
    <translate 
    android:fromYDelta="100%p" 
    android:toYDelta="-100%"
    android:fillAfter="true"
    android:interpolator="@android:anim/linear_interpolator"
    android:duration="500" />

A:

Very simple to do if you have any experience with animation!
You'll need to create a folder in your /res folder called anim, and inside of that folder put the slide_up.xml animation file:
<set xmlns:android="http://schemas.android.com/apk/res/android">
    <translate
        android:fromYDelta="100%"
        android:toYDelta="0%"       
        android:duration="1000" />
</set>

And then a slide_down.xml animation file:
<?xml version="1.0" encoding="utf-8"?>

<set xmlns:android="http://schemas.android.com/apk/res/android">
    <translate
        android:fromYDelta="0%"
        android:toYDelta="100%"
        android:duration="1000" />
</set>

Then you'll have in your java where you create your fragment:
String FRAGMENT_TAG = "YOURFRAGMENT"; //this is how you'll look for it in the manager
YourFragment f = new YourFragment();
getSupportFragmentManager().beginTransaction()
         .setCustomAnimations(R.anim.slide_up,
                R.anim.slide_down)              
         .replace(R.id.menu_container, f, FRAGMENT_TAG)
         .addToBackStack(null).commit();

Or if you are using a popup window:
popupwindow.showAtLocation(getWindow().getDecorView().findViewById(android.R.id.‌​content), Gravity.BOTTOM, 0, 0);

And voila! I'm not quite sure of a way to do this through xml only. This seems to be one of the easier ways that is fairly flexible. 

