Giter VIP home page Giter VIP logo

Comments (5)

renyedi avatar renyedi commented on May 16, 2024 3

The fix which worked for me: do not reuse the same animator instance across multiple recycler view instances!

I had a static field referring the animator instance. I was creating two instances of the fragment containing the recycler view, but I also noticed the issue when the single fragment instance got recycled and a another instance created.

from recyclerview-animators.

wasabeef avatar wasabeef commented on May 16, 2024

@Prashanthlkv

Please your code.

from recyclerview-animators.

ramden avatar ramden commented on May 16, 2024

For me too when using in fragment.

Code is standard recyclerview in fragment with adapter like here:
https://www.youtube.com/watch?v=MHqpR3yLNfk

11-12 18:58:03.022 26703-26703/de.demoapp.app E/AndroidRuntime: FATAL EXCEPTION: main
11-12 18:58:03.022 26703-26703/de.demoapp.app E/AndroidRuntime: Process: de.demoapp.app, PID: 26703
11-12 18:58:03.022 26703-26703/de.demoapp.app E/AndroidRuntime: java.lang.AbstractMethodError: abstract method "boolean android.support.v7.widget.RecyclerView$ItemAnimator.animateAppearance(android.support.v7.widget.RecyclerView$ViewHolder, android.support.v7.widget.RecyclerView$ItemAnimator$ItemHolderInfo,
.......

from recyclerview-animators.

renyedi avatar renyedi commented on May 16, 2024

I also started seeing these occasionally with recyclerview-animators-2.2.3, com.android.support:recyclerview-v7:23.4.0 on Genymotion (Nexus 5 running Android 5.1). As it stands right now, I can't reproduce it :-( Will add more details in case I can. Preventively adding android:focusableInTouchMode="true" and android:animateLayoutChanges="false" to my recyclerview, as hinted at from several stackoverflow threads.

This is my stack trace:
06-09 01:00:16.762 20948-20948/com.ebay.napp E/AndroidRuntime: FATAL EXCEPTION: main Process: com.ebay.napp, PID: 20948 java.lang.IllegalArgumentException: Scrapped or attached views may not be recycled. isScrap:false isAttached:true at android.support.v7.widget.RecyclerView$Recycler.recycleViewHolderInternal(RecyclerView.java:4878) at android.support.v7.widget.RecyclerView.removeAnimatingView(RecyclerView.java:1127) at android.support.v7.widget.RecyclerView.access$6400(RecyclerView.java:147) at android.support.v7.widget.RecyclerView$ItemAnimatorRestoreListener.onAnimationFinished(RecyclerView.java:10294) at android.support.v7.widget.RecyclerView$ItemAnimator.dispatchAnimationFinished(RecyclerView.java:10794) at android.support.v7.widget.SimpleItemAnimator.dispatchRemoveFinished(SimpleItemAnimator.java:265) at jp.wasabeef.recyclerview.animators.BaseItemAnimator$DefaultRemoveVpaListener.onAnimationEnd(BaseItemAnimator.java:690) at android.support.v4.view.ViewPropertyAnimatorCompatJB$1.onAnimationEnd(ViewPropertyAnimatorCompatJB.java:47) at android.view.ViewPropertyAnimator$AnimatorEventListener.onAnimationEnd(ViewPropertyAnimator.java:1116) at android.animation.ValueAnimator.endAnimation(ValueAnimator.java:1171) at android.animation.ValueAnimator$AnimationHandler.doAnimationFrame(ValueAnimator.java:722) at android.animation.ValueAnimator$AnimationHandler.run(ValueAnimator.java:738) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:767) at android.view.Choreographer.doCallbacks(Choreographer.java:580) at android.view.Choreographer.doFrame(Choreographer.java:549) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:753) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5254) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)

from recyclerview-animators.

jason1114 avatar jason1114 commented on May 16, 2024

@renyedi Exactly the right answer!

from recyclerview-animators.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.