My app minimum version is 10 and till now i am using the support library for fragments
Now i want to add the flip animation for few fragment transition So as per the android guide we need to use the animator for that and it has support from the api level 11 which is no issue for me.
but also need to use the getFragmentManager
instead getSupportFragmentManager
So i removed the support library changed my minimum version 10 to 11 errors are coming
because in my app i have FragmentTabhost
and getChildFragmentManager()
.
FragmentTabHost
only available on support library and to set FragmentManager
using the getChildFragmentManager
it wont allow me to do that because it requires api level 17
any help appreciated. Let me know if you need more details
Thanks in advance.
use android.support.v4.fragment instead of android.app Fragment in your project
and you can use following snippet for animation while adding/replacing fragment
getSupportFragmentManager().beginTransaction()
.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN)
.replace(R.id.fragment, new FragmenntTwo())
.commit();
where FragemntTwo() is the fragment you are inflating.Here you can use your custome animation as well by replacing setTransition(..) with setCustomAnimations(..)
I think coding Animation for API level 10 and below is challenging, and rather obsolete. I can give one suggestion, read web page @ NineOldAndroids from the active developer Jake Wharton. It supports Android 1.0 and up, though deprecated with new Android libraries. So one lesson is that it would be easier for you to create a new project, basically start over instead of converting code.
Even if you do use existing animation like ValueAnimator, the API level is 11 and up. You're hitting that boundary between level 10 and 11 for animation.
Good luck and keep us posted.
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