Created
November 28, 2016 21:34
-
-
Save d4rkc0de/1e6c3755dac0f908bacf895212f052bf to your computer and use it in GitHub Desktop.
Animation slide in/out using fragment and xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { | |
View view = (ViewGroup) inflater.inflate(R.layout.product_frame, null); | |
getFragmentManager().beginTransaction().replace(R.id.sub_header, new Sub_Header()).commit(); | |
getFragmentManager().beginTransaction().setCustomAnimations(R.animator.slide_in_left,R.animator.slide_out_right, 0, 0) | |
.replace(R.id.product_frame, new Sub_Catagory_Grid()).commit(); | |
return view; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
slide_out_right and slide_out_right should be placed inside animator folder.