Fixed
Status Update
Comments
sh...@google.com <sh...@google.com>
ap...@google.com <ap...@google.com> #2
Hi. Thanks for reporting this. Fixed in alpha-04
sh...@google.com <sh...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-main
commit e782987543a9f8ccd485e970ddc74564b24378db
Author: Vighnesh Raut <vighnesh.raut13@gmail.com>
Date: Mon Jan 02 15:27:40 2023
fix: tab row crashes when only 1 tab is added
Bug: b/264018028
Test: Added unit test
Change-Id: I6381dbac304fc1d69d3708c6655f8b595668e93f
M tv/tv-material/src/androidTest/java/androidx/tv/material/TabRowTest.kt
M tv/tv-material/src/main/java/androidx/tv/material/TabRow.kt
https://android-review.googlesource.com/2373449
Branch: androidx-main
commit e782987543a9f8ccd485e970ddc74564b24378db
Author: Vighnesh Raut <vighnesh.raut13@gmail.com>
Date: Mon Jan 02 15:27:40 2023
fix: tab row crashes when only 1 tab is added
Bug:
Test: Added unit test
Change-Id: I6381dbac304fc1d69d3708c6655f8b595668e93f
M tv/tv-material/src/androidTest/java/androidx/tv/material/TabRowTest.kt
M tv/tv-material/src/main/java/androidx/tv/material/TabRow.kt
ge...@deliveroo.co.uk <ge...@deliveroo.co.uk> #4
deleted
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)
...