Skip to content

Commit ed97594

Browse files
committed
fix(android): disable update animation
1 parent 996bee4 commit ed97594

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

packages/collectionview/platforms/android/java/com/nativescript/collectionview/RecyclerView.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
import androidx.recyclerview.widget.LinearSmoothScroller;
88
// import jp.wasabeef.recyclerview.animators.FadeInAnimator;
99
// import jp.wasabeef.recyclerview.animators.BaseItemAnimator;
10-
import android.view.animation.OvershootInterpolator;
10+
// import android.view.animation.OvershootInterpolator;
11+
import androidx.recyclerview.widget.SimpleItemAnimator;
1112

1213
public class RecyclerView extends androidx.recyclerview.widget.RecyclerView {
1314
static final String TAG = "RecyclerView";
@@ -34,6 +35,7 @@ public RecyclerView(Context context, android.util.AttributeSet attrs) {
3435
// Change animations are enabled by default since support-v7-recyclerview v22.
3536
// Need to disable them when using animation indicator.
3637
// animator.setSupportsChangeAnimations(false);
38+
((SimpleItemAnimator) getItemAnimator()).setSupportsChangeAnimations(false);
3739
}
3840

3941
static public RecyclerView createRecyclerView(Context context) {

packages/collectionview/platforms/android/native-api-usage.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
"com.h6ah4i.android.widget.advrecyclerview.animator:BaseItemAnimator",
2525
"com.h6ah4i.android.widget.advrecyclerview.animator:GeneralItemAnimator",
2626
"com.h6ah4i.android.widget.advrecyclerview.animator:RefactoredDefaultItemAnimator",
27+
"jp.wasabeef.recyclerview.animators:FadeInAnimator",
28+
"jp.wasabeef.recyclerview.animators:BaseItemAnimator",
29+
"android.view.animation:OvershootInterpolator",
2730
"com.nativescript.collectionview*:*"
2831
]
2932
}

0 commit comments

Comments
 (0)