I'm using Peter Doyle's android-support-v4-googlemaps support library for implementing an Activity that uses both Fragments and Google Maps, and can't seem to get FragmentTransaction animations to work. I've tried using the setCustomAnimations(int enter, int exit)
method as well as the setTransition(int transit)
method but to no avail. Anyone been able to get animations to work, or also had problems getting animations to work?
Some of the animations I tried:
setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE)
setCustomAnimations(android.R.anim.fade_in, android.R.anim.fade_out)
setCustomAnimations(android.R.anim.slide_in_left, android.R.anim.slide_out_right)
You should call FragmentTransaction.setCustomAnimations first and then call FragmentTransaction.replace method like this:
FragmentTransaction ft = getActivity().getSupportFragmentManager().beginTransaction();
ft.setCustomAnimations(R.anim.fade_out,R.anim.fade_in);
ft.replace(R.id.fragmentDetails, detailsFrag);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With