All Products
Search
Document Center

Set entrance/exit animation

Last Updated: Feb 05, 2021

The settings involved in this section is only applicable for entering and exiting from animation, not for the cross-page jumping in the mini program.

Enable the function of entering and exiting from animation

Add the parameter needAnimInTiny after starting the Mini Program, and set the value as true. For example:

  1. Bundle bundle = new Bundle();
  2. bundle.putBoolean("needAnimInTiny", true);
  3. MPNebula.startApp("2018080616290001", bundle);

Set animation entrance

Add the animation resource files (tiny_fading_out.xml and tiny_push_up_in.xml) in the main project.

  • tiny_fading_out.xml:

    1. <?xml version="1.0" encoding="utf-8"?>
    2. <!--tiny_fading_out.xml-->
    3. <set xmlns:android="http://schemas.android.com/apk/res/android"
    4. android:duration="300">
    5. <translate android:fromYDelta="0%" android:toYDelta="100%" />
    6. </set>
  • tiny_push_up_in.xml:

    1. <?xml version="1.0" encoding="utf-8"?>
    2. <!--tiny_push_up_in.xml-->
    3. <set xmlns:android="http://schemas.android.com/apk/res/android"
    4. android:duration="300">
    5. <translate android:fromYDelta="100%" android:toYDelta="0%" />
    6. </set>

Set animation exit

Add the animation resource files (tiny_fading_in.xml and tiny_push_down_out.xml) in the main project.

  • tiny_fading_in.xml:

    1. <?xml version="1.0" encoding="utf-8"?>
    2. <!--tiny_fading_in.xml-->
    3. <set xmlns:android="http://schemas.android.com/apk/res/android"
    4. android:duration="300">
    5. <translate android:fromYDelta="100%" android:toYDelta="0%" />
    6. </set>
  • tiny_push_down_out.xml:

    1. <?xml version="1.0" encoding="utf-8"?>
    2. <!--tiny_push_down_out.xml-->
    3. <set xmlns:android="http://schemas.android.com/apk/res/android"
    4. android:duration="300">
    5. <translate android:fromYDelta="0%" android:toYDelta="100%" />
    6. </set>