Will definitely implement that somehow.
And thanks, I really appreciate it.
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
// we just would have to create 2 anim xml files with the animation.
transaction.setCustomAnimations(android.R.anim.fade_in, android.R.anim.fade_out);
transaction.replace(R.id.fragmentContainer, fragment);
transaction.commit();
Does somebody already has a similar animation?
Update: See response below
I've tried to get the same transition that we have in the spec. It looks more or less identical! Here my code:
anim/fade_out.xml
<?xml version="1.0" encoding="utf-8"?>
<alpha
xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="@android:integer/config_shortAnimTime"
android:fromAlpha="1"
android:toAlpha="0"/>
anim/slide_in_up.xml
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:duration="@android:integer/config_shortAnimTime"
android:fromYDelta="5%p"
android:toYDelta="0%p"/>
<alpha
android:duration="@android:integer/config_shortAnimTime"
android:fromAlpha="0"
android:toAlpha="1"/>
</set>
And in the fragmentManager set:
transaction.setCustomAnimations(R.anim.slide_in_up, R.anim.fade_out);
Most helpful comment
Will definitely implement that somehow.
And thanks, I really appreciate it.