Slide in (over) activity
<p>Currently I'm trying to implement something in my app where I really don't know where to start.
Have a look at this little image:</p>

<p><img src="http://i.stack.imgur.com/UKMrD.png" alt="enter image description here"></p>

<p>You can find the app in play store here: <a href="https://play.google.com/store/apps/details?id=com.imano.euro2012.row" rel="nofollow">https://play.google.com/store/apps/details?id=com.imano.euro2012.row</a></p>

<p>In my app, I have a listview and when i tap on an item I want to slide in the black activity in to about 3/4. In that activity I want to have some llistview item specific options.</p>

<p>Any one knows how to solve this?</p>

<p><strong>Solution:</strong></p>

<p>Thanks to Imran-Khan I got it working.
But I think this code is not perfect. I'm not sure if the width and height calculation in the first half of the showPopup() method is correct. And in my solution the popup has on the bottom and on the right a little margin. I don't know right now why this happens. Maybe someone can help...</p>

<p>Here is what I did so far:</p>

<p>First I added the method showpopup(long selectedItem) to my listview:</p>

<pre><code>lv_timer.setOnItemClickListener(new OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView&lt;?&gt; parentView, View childView, int position, long id) {
            showPopup(id);
        }
});
</code></pre>

<p>and the method itself:</p>

<pre><code>private void showPopup(long selectedItem) {
    Display display = getWindowManager().getDefaultDisplay();
    Point size = new Point();
    display.getSize(size);
    int width = size.x;
    int height = size.y;

    int popupWidth = (width / 4) * 3;
    int popupHeight = height;

    LinearLayout viewGroup = (LinearLayout) findViewById(R.id.ll_timer_prop);
    LayoutInflater layoutInflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View layout = layoutInflater.inflate(R.layout.timer_properties, viewGroup);

    final PopupWindow popup = new PopupWindow(this);
    popup.setContentView(layout);
    popup.setWidth(popupWidth);
    popup.setHeight(popupHeight);
    popup.setFocusable(true);

    popup.showAtLocation(layout, Gravity.NO_GRAVITY, width - (width / 4 * 3), 0);

    TextView tv_item = (TextView) layout.findViewById(R.id.tv_item);
    tv_item.setText("Clicked Item ID: " + selectedItem);
}
</code></pre>

<p>This is working fine for me.</p>

<p>for the slide in part I've found this thread: <a href="http://stackoverflow.com/questions/7438290/popupwindow-animation-not-working">PopupWindow animation not working</a></p>

<p>I added</p>

<pre><code>popup.setAnimationStyle(R.style.AnimationPopup);
</code></pre>

<p>before the showAtLocation() call, created a res/anim directory an created two XML files in it: popup_show.xml and popup_hide.xml</p>

<p>popup_show.xml</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;set xmlns:android="http://schemas.android.com/apk/res/android"&gt;

    &lt;scale
        android:fromXScale="0.0" android:toXScale="1.0"
        android:fromYScale="1.0" android:toYScale="1.0"
        android:pivotX="100%" android:pivotY="0%"
        android:duration="@android:integer/config_shortAnimTime"
        /&gt;
    &lt;alpha
        android:interpolator="@android:anim/decelerate_interpolator"
        android:fromAlpha="0.0" android:toAlpha="1.0"
        android:duration="@android:integer/config_shortAnimTime"
        /&gt;

&lt;/set&gt;
</code></pre>

<p>popup_hide.xml</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;set xmlns:android="http://schemas.android.com/apk/res/android"&gt;

    &lt;scale
        android:fromXScale="1.0" android:toXScale="0.0"
        android:fromYScale="1.0" android:toYScale="1.0"
        android:pivotX="100%" android:pivotY="0%"
        android:duration="@android:integer/config_shortAnimTime"
        /&gt;
    &lt;alpha
        android:interpolator="@android:anim/decelerate_interpolator"
        android:fromAlpha="1.0" android:toAlpha="0.0"
        android:duration="@android:integer/config_shortAnimTime"
        /&gt;

&lt;/set&gt;
</code></pre>
