43e567ec1c07b3ed5967685c5054ba497a5cd854 |
|
28-Mar-2018 |
Dake Gu <dake@google.com> |
leanback: perform unbind ViewHolder when app forgot to clear ViewPropertyAnimation If app forgot to override onDetachedFromWindow() to clear ViewPropertyAnimation, it may leave view in transient state when RecyclerView is about to recycle the ViewHolder. RecyclerView cannot decide if the transient state is caused by ItemAnimator or app's custom animation, it will call Adapter.onFailedRecycleViewHolder() and skip the onViewRecycled() step. Although it is recommended that app should clear animation in onDetachedFromWindow. If app does not do that, Leanback should respond to onFailedRecycleViewHolder and perform same resource releasing steps as onViewRecycled(). Bug: 77150099 Test: ./gradlew leanback:connectedCheck --info -Pandroid.testInstrumentationRunnerArguments.class=androidx.leanback.widget.ItemBridgeAdapterTest Change-Id: I584d1b817edaacbfc91008479570474bba98378f
/frameworks/support/leanback/src/androidTest/java/androidx/leanback/widget/ItemBridgeAdapterTest.java
|