Jignesh Ansodariya
Jignesh Ansodariya

Reputation: 12685

uncovering slide animation at activity change in Android

Hi I am applying animation at time of activity change like this.

Intent i;
        i = new Intent(MainActivity.this, DemoActi.class);
        startActivity(i);
        overridePendingTransition(R.anim.push_left_in, R.anim.push_left_out);

xml file push_left_in in anim folder

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android" >

<translate
    android:duration="1500"
    android:fromXDelta="-100%"
    android:interpolator="@android:anim/anticipate_overshoot_interpolator"
    android:toXDelta="0%" />

</set>

xml file push_left_out in anim folder

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android" >

<translate
    android:duration="1500"
    android:fromXDelta="0%"
    android:interpolator="@android:anim/anticipate_overshoot_interpolator"
    android:toXDelta="100%" />

</set>

problem is that, I found an animation like MainActivity is going left to right and DemoActi is joining behind it same like train containers. but I need animation like DemoActi is covered by MainActivity and uncovering it at time of finish. please help me.

Upvotes: 0

Views: 229

Answers (1)

Sanket Kachhela
Sanket Kachhela

Reputation: 10856

just put demoview on detail view and apply animation on it,,,,

    splash.clearAnimation();
    splash.startAnimation(bottomDownAnimation);
    splash.setVisibility(View.INVISIBLE); 

Upvotes: 1

Related Questions