Actually, 2 questions:

1) In which type is it better to create activities so that you can make a beautiful transition?

2) How to make this transition? For example, the default transition from parental activity to a child - the child rolls onto the screen from right to left. What else there are default transitions, and whether it is possible to invent the?

    1 answer 1

    This is called transition animation. If you want detailed and beautiful, go here: https://developer.android.com/training/transitions/index.html

    In short, you can start with this example and experiment further:

    Fade_in.xml file in res / anim

    <?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android"> <alpha android:interpolator="@android:anim/accelerate_interpolator" android:fromAlpha="0.0" android:toAlpha="1.0" android:duration="2000" /> </set> 

    The fade_out.xml file in the same place:

     <?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android"> <alpha android:interpolator="@android:anim/accelerate_interpolator" android:fromAlpha="1.0" android:toAlpha="0.0" android:duration="2000" /> </set> 

    And when starting the second activation add overridePendingTransition() :

     startActivity(intentToSecondActivity); overridePendingTransition(R.anim.fade_in, R.anim.fade_out); 

    How animations are described in xml is described here: https://developer.android.com/guide/topics/resources/animation-resource.html#Tween

    • thanks, but is this true? When I change the values, the animation does not change. You can even empty the files with animations, and they sink somewhere in the cache and work quietly even without files ... The project rebuild helps, but it takes too long for each edit - Egor Randomize