android - Fragment slide out animation doesn't work -
i have android app in loading fragment 1 fragment on click of button
fragment fragment = new editimagesfragment(); fragmentmanager fragmentmanager = getfragmentmanager(); fragmenttransaction tran = fragmentmanager.begintransaction(); tran.setcustomanimations(r.anim.push, r.anim.pop); tran.replace(r.id.content_frame, fragment).addtobackstack(null).commit();
and have push , pop (slide in , out ) kind of animations defined follows
<?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" > <objectanimator xmlns:android="http://schemas.android.com/apk/res/android" android:duration="500" android:propertyname="x" android:valuefrom="1000" android:valueto="0" android:valuetype="floattype" /> </set>
<?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" > <objectanimator xmlns:android="http://schemas.android.com/apk/res/android" android:duration="500" android:propertyname="x" android:valuefrom="0" android:valueto="-1000" android:valuetype="floattype" /> </set>
now when load fragment slides in expected slide out animation doesn't work when press button , try go back, supporting v14 , above api level. can spot issue ?
thanks
try
setcustomanimations(int enter, int exit, int popenter, int popexit)
instead of
setcustomanimations(int enter, int exit)
according android documentation, enter , exit animations will not played on popping stack.
Comments
Post a Comment