I am having some trouble trying to set custom animation to my fragment transaction. I know there are several treads on this and I have tried all their soluction and I still cant get this to work. Here are the animation xml files:
slide.down.xml(for exit)
<set xmlns:android="”http://schemas.android.com/apk/res/android”"
android:shareInterpolator="false" >
<translate
android:duration="700"
android:fromXDelta="0%"
android:fromYDelta="-100%"
android:toXDelta="0%"
android:toYDelta="0%" />
slide_up.xml(for entering)
<set xmlns:android="”http://schemas.android.com/apk/res/android”"
android:shareInterpolator="false" >
<translate
android:duration="700"
android:fromXDelta="0%"
android:fromYDelta="0%"
android:toXDelta="0%"
android:toYDelta="-100%"/>
and my fragment transaction code:
getFragmentManager().beginTransaction()
.setCustomAnimations(R.anim.slide_up , R.anim.slide_down,R.anim.slide_up , R.anim.slide_down)
.replace(R.id.container, list)
.addToBackStack(null)
.commitAllowingStateLoss();
All the solutions form other similar threads I have tried:
- Made sure
setCustomAnimations
is beforereplace
- Have set
android:hardwareAccelerated
to true in the Manifest. - Made sure animations are not disabled in the developer options on my test device
I seem to be messing something very obvious and important but I cant figure out what that is.
My question: Why doesn't my costume animation work and how do I get it to work ?