Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Unintended behavior
View staffing
Description
Components and version used:
'androidx.constraintlayout:constraintlayout:2.1.4'
'androidx.recyclerview:recyclerview:1.3.1'
Devices/Android versions reproduced on: Pixel 6 Pro running Android 14 UPB5.230623.006
I'm trying to display recyclerview inside a ConstraintLayout.
I'd like to have the recyclerview respecting vertical constraints but at the same time only using required space.
For that I use the following code:
```
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constrainedHeight="true"
app:layout_constraintTop_toBottomOf="@id/title"
app:layout_constraintBottom_toBottomOf="parent" />
```
First issue is that after submitting the list in the adapter, the recyclerview's height is 0 (until the keyboard is opened for example). I have to force a layout using the following code to workaround that:
```
adapter.submitList(it) {
binding.list.requestLayout()
}
```
That being said, it does the job but when the recyclerview's height is not enough to display all items, the scrolling is very slow (laggy). Removing the `layout_constrainedHeight` breaks the constraints but the scrolling gets smooth again.
Could you do something about that please?
Thanks in advance,