Android: What's wrong with my fragment transition animation? -
i need plain slide in , slide out animation fragment transition, below code: slide_in_left.xml:
<?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" android:shareinterpolator="true"> <translate android:fromxdelta="-100%" android:toxdelta="0%" android:fromydelta="0%" android:toydelta="0%" android:duration="700"> </translate> </set>
slide_out_right.xml:
<?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" android:shareinterpolator="false"> <translate android:fromxdelta="0%" android:toxdelta="100%" android:fromydelta="0%" android:toydelta="0%" android:duration="700"> </translate> </set>
the code used:
somefragment frag = somefragment.newinstance(foo); fragmenttransaction ft = getsupportfragmentmanager().begintransaction(); ft.setcustomanimations(r.anim.slide_in_left, r.anim.slide_out_right); ft.replace(r.id.the_fragment, frag); ft.addtobackstack(null); ft.commit();
the result looks stranges, when transition starts, current fragment disappears without animation, entering fragment comes(from left) scrolling paper. what's wrong animation xml code?
thanks!
getsupportfragmentmanager() means using compatibility package fragments, guess. have same problem, no animation happening @ all.
Comments
Post a Comment