Question

I would like to implement something similar like can be seen here. Basicaly, one can slide up new activity from the bottom.

first second

My activity has navigation drawer inside.

<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/drawer_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:theme="@android:style/Theme.Holo.Light" >

    <!-- Framelayout pre zobrazovanie jednotlivých fragmentov -->
    <FrameLayout
            android:id="@+id/frame_container"
            android:layout_width="match_parent"
            android:layout_height="match_parent" />

    <!-- Listview ako menu pre navDrawer -->
    <ListView
        android:id="@+id/list_slidermenu"
        android:layout_width="240dp"
        android:layout_height="fill_parent"
        android:layout_gravity="start"
        android:background="#2B2B2B"
        android:divider="@null"
        android:dividerHeight="0dp" />

</android.support.v4.widget.DrawerLayout>

Is there any way how can I achive this ?

Was it helpful?

Solution

In regards to the original question of sliding an activity from bottom of the screen, use the following code.

Intent intent = new Intent(FirstActivity.this, SecondActivity.class);
ActivityOptions options = ActivityOptions.makeCustomAnimation(FirstActivity.this,R.anim.slide_in_up,0);
startActivity(intent, options.toBundle());

slide_in_up.xml

<?xml version="1.0" encoding="utf-8"?>
<translate xmlns:android="http://schemas.android.com/apk/res/android"
android:fromYDelta="100%p" android:toYDelta="0%p"
android:duration="@android:integer/config_longAnimTime"/>

You could define your own exit animation in the third parameter of the function makeCustomAnimation

As for the specific response as per your screens, @Naser 's reply seems like the way to go

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top