Fixed
Status Update
Comments
sh...@google.com <sh...@google.com>
ap...@google.com <ap...@google.com> #2
sh...@google.com <sh...@google.com> #3
> We accept pull requests! :)
Is there a public repo somewhere? I don't see any obvious repo for it inhttps://android.googlesource.com , and it doesn't seem to be inside https://android.googlesource.com/platform/frameworks/support .
Room supports final fields (yay!), which probably will suffice for many people with respect to this feature request.
Is there a public repo somewhere? I don't see any obvious repo for it in
Room supports final fields (yay!), which probably will suffice for many people with respect to this feature request.
ge...@deliveroo.co.uk <ge...@deliveroo.co.uk> #4
Room supports immutability (it can use arg constructors) but does not directly support AutoValue. It is in the schedule but not high priority :/. Idk much about its internals at this stage so I'm not sure how we would implement it but should be totally doable.
Sorry we don't have the source release yet :/.
Sorry we don't have the source release yet :/.
Description
Code to reproduce:
The Android ItemTouchHelper class can crash when overriding clearView() in the ItemTouchHelper.Callback because the restore animations are not cancelled when detaching the the touch helper from the RecyclerView. When the restore animation completes, it attempts to invoke clearView() on the callback and calls the method with a null RecyclerView. The RecyclerView parameter is annotated as @NonNull and Kotlin expects a non-nullable value.
This issue was discovered because with new gesture based navigation on Android 10 is it easy to start swiping a list item while attempting to swipe to go back. Our application detaches the touch helper from the RecyclerView whenever a fragment's view is destroyed.
See the Github link for code to reproduce this issue.
Stack trace
------------
java.lang.IllegalArgumentException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull, parameter recyclerView
at com.victorrendina.touchhelpercrash.SampleItemTouchHelperCallback.clearView(Unknown Source:2)
at androidx.recyclerview.widget.ItemTouchHelper$3.onAnimationEnd(ItemTouchHelper.java:644)
at android.animation.Animator$AnimatorListener.onAnimationEnd(Animator.java:554)
...