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"?> | |
| <layoutAnimation | |
| xmlns:android="http://schemas.android.com/apk/res/android" | |
| android:animation="@anim/item_animation_fall_down" | |
| android:delay="15%" | |
| android:animationOrder="normal" | |
| /> |
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
| private void runLayoutAnimation(final RecyclerView recyclerView) { | |
| final Context context = recyclerView.getContext(); | |
| final LayoutAnimationController controller = | |
| AnimationUtils.loadLayoutAnimation(context, R.anim.layout_animation_fall_down); | |
| recyclerView.setLayoutAnimation(controller); | |
| recyclerView.getAdapter().notifyDataSetChanged(); | |
| recyclerView.scheduleLayoutAnimation(); | |
| } |
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" | |
| android:duration="@integer/anim_duration_long"> | |
| <translate | |
| android:interpolator="@android:anim/decelerate_interpolator" | |
| android:fromXDelta="100%p" | |
| android:toXDelta="0" | |
| /> |
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" | |
| android:duration="@integer/anim_duration_long"> | |
| <translate | |
| android:interpolator="@android:anim/accelerate_decelerate_interpolator" | |
| android:fromYDelta="50%p" | |
| android:toYDelta="0" | |
| /> |
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"?> | |
| <gridLayoutAnimation | |
| xmlns:android="http://schemas.android.com/apk/res/android" | |
| android:animation="@anim/item_animation_from_bottom" | |
| android:animationOrder="normal" | |
| android:columnDelay="15%" | |
| android:rowDelay="15%" | |
| android:direction="top_to_bottom|left_to_right" | |
| /> |
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" | |
| android:duration="@integer/anim_duration_long"> | |
| <translate | |
| android:interpolator="@android:anim/accelerate_decelerate_interpolator" | |
| android:fromYDelta="50%p" | |
| android:toYDelta="0" | |
| /> |
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
| /** | |
| * RecyclerView with support for grid animations. | |
| * | |
| * Based on: | |
| * https://gist.github.com/Musenkishi/8df1ab549857756098ba | |
| * Credit to Freddie (Musenkishi) Lust-Hed | |
| * | |
| * ...which in turn is based on the GridView implementation of attachLayoutParameters(...): | |
| * https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/widget/GridView.java | |
| * |
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
| com.patrickiv.demo.enteranimationdemo E/AndroidRuntime: FATAL EXCEPTION: main | |
| Process: com.patrickiv.demo.enteranimationdemo, PID: 19510 | |
| java.lang.ClassCastException: android.view.animation.LayoutAnimationController$AnimationParameters cannot be cast to android.view.animation.GridLayoutAnimationController$AnimationParameters | |
| at android.view.animation.GridLayoutAnimationController.getDelayForView(GridLayoutAnimationController.java:299) | |
| at android.view.animation.LayoutAnimationController.getAnimationForView(LayoutAnimationController.java:323) | |
| at android.view.ViewGroup.bindLayoutAnimation(ViewGroup.java:4584) | |
| at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3453) | |
| at android.view.View.draw(View.java:17240) | |
| at android.support.v7.widget.RecyclerView.draw(RecyclerView.java:3985) | |
| ... |
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
| int resId = R.anim.grid_layout_animation_from_bottom; | |
| LayoutAnimationController animation = AnimationUtils.loadLayoutAnimation(ctx, resId); | |
| recyclerview.setLayoutAnimation(animation); |
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
| <com.patrickiv.demo.enteranimationdemo.recyclerview.GridRecyclerView | |
| android:id="@+id/recycler_view" | |
| android:layout_width="match_parent" | |
| android:layout_height="match_parent" | |
| android:layoutAnimation="@anim/grid_layout_animation_from_bottom" | |
| /> |