airbnb / epoxy

Epoxy is an Android library for building complex screens in a RecyclerView
https://goo.gl/eIK82p
Apache License 2.0
8.51k stars 726 forks source link

RecyclerView's wrap_content constrained height not updating #885

Open timozander opened 4 years ago

timozander commented 4 years ago

Hello everyone,

using Epoxy I stumbled upon a problem which I narrowed down to being a possible problem at the library's end.

I am using a RecyclerView which height="wrap_content". So, I expect the height to recalculate whenever the data changes. Unfortunately, this does not happen. When I click on one of the items, I re-set the data and all the diffing works properly. Nonetheless, the height is not re-calculated (onMeasure() of the RecyclerView is not called at all).

Screenshot_3

When I manually force the RecyclerView to update its height (e.g. by opening the keyboard), the height recalculates. Recreating this scenario with a default adapter and viewholder works properly.

Any ideas on how I could fix this?

elihart commented 4 years ago

Are you using hasFixedSize in the RecyclerView? That sounds like the behavior you are seeing

timozander commented 4 years ago

No, I explicitly set hasFixedSize to false via databinding

kukadiajayesh commented 9 months ago

Is there any update on this, I've the same issue in which some of the views will be hidden based on logic, and the recycler view is not recalculated and is shown an extra bottom space.