According to the conversation in #231, setting match_parent in a child of a "ConstraintLayout" while removing all conflicting constraints is a valid layout configuration. However, I discovered an example that shows such configuration causes display and stability problem in its descendant views.
A more detailed description can be found on the Readme file.
However, I am not sure if the problem is really caused by the "ConstraintLayout" and it is hard for me to decide where to file this bug report. According to some observations, having the 4 components with some specific configuration are required to reproduce the problem:
ConstraintLayout
ViewPager2
data binding
RecyclerView
On the other hand, this indicates that such problems might be hard for unit tests to identify.
According to the conversation in #231, setting match_parent in a child of a "ConstraintLayout" while removing all conflicting constraints is a valid layout configuration. However, I discovered an example that shows such configuration causes display and stability problem in its descendant views.
The problem can be reproduced by this minimal example: https://github.com/dsoutw/Android-RecyclerView-Bug
In this example, there a child view of a "ConstraintLayout" with "match_parent" set.
This generates problems in a "RecyclerView" which is a descendant view of the "ViewPager2":
If the code is replaced by the following, then the problems disappear.
A more detailed description can be found on the Readme file.
However, I am not sure if the problem is really caused by the "ConstraintLayout" and it is hard for me to decide where to file this bug report. According to some observations, having the 4 components with some specific configuration are required to reproduce the problem:
On the other hand, this indicates that such problems might be hard for unit tests to identify.
Thanks for taking a look into the details!