Created
December 1, 2017 22:37
-
-
Save arvkmr/40b468b4c6fd646744610a5b7a82277d to your computer and use it in GitHub Desktop.
Fragment Animations that work with back button slide up and down
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void createFragment(){ | |
FragmentTransaction transaction = mFragmentManager.beginTransaction(); | |
transaction.setCustomAnimations(R.anim.slide_in_up, R.anim.slide_out_down, R.anim.slide_in_up,R.anim.slide_out_down); | |
transaction.addToBackStack(MyFragment.class.getSimpleName()); | |
transaction.replace(R.id.baseLayout, fragment).commit(); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<translate xmlns:android="http://schemas.android.com/apk/res/android" | |
android:duration="@android:integer/config_mediumAnimTime" | |
android:interpolator="@android:interpolator/accelerate_decelerate" | |
android:fromYDelta="0%p" | |
android:toYDelta="100%p" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<translate xmlns:android="http://schemas.android.com/apk/res/android" | |
android:duration="@android:integer/config_mediumAnimTime" | |
android:interpolator="@android:interpolator/accelerate_decelerate" | |
android:fromYDelta="100%p" | |
android:toYDelta="0%p" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment