androidbroadcast / ViewBindingPropertyDelegate

Make work with Android View Binding simpler
https://proandroiddev.com/make-android-view-binding-great-with-kotlin-b71dd9c87719
Apache License 2.0
1.42k stars 102 forks source link

Using property delegate breaks recyclerView #67

Closed Nek-12 closed 2 years ago

Nek-12 commented 3 years ago

Using the library breaks the behavior of RecyclerViews so that when calling findViewHolderForItemId(id) or findViewHolderForAdapterPosition(pos) or findViewHolderForLayoutPosition(pos)- all of these methods return null, always. Steps to reproduce:

  1. Create a new fragment that has a recyclerview with setHasStableIds(true) (for the example with ids)
  2. Use property delegate (in my case I used CreateMethod.INFLATE because I was working with BottomSheetDialogFragment and tried both reflection and non-reflection methods)
  3. Open up this fragment screen for the 1st time. You can find view holder for id/position successfully
  4. Navigate to some other fragment, causing the view to be destroyed
  5. Navigate back (I used navigation components and navigateBack() )
  6. Try to find the view holder using the same id/position. The method will always return null
kirich1409 commented 3 years ago

Please show sample where the issue is reproducible

Nek-12 commented 3 years ago

Please show sample where the issue is reproducible

What do you mean by "sample"? I have already added steps to reproduce to my report

kirich1409 commented 3 years ago

Please, create a sample app where the issues is reproducible and I can check fix