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)
Attachment actions
Unintended behavior
View staffing
Description
Component used: StaggeredGridLayoutManager
Version used: 1.3.2
Devices/Android versions reproduced on: Pixel 7, API 34
When using a top/bottom decoration with a vertical
StaggeredGridLayoutManager
(with RV heightmatch_parent
), and child item views with fixed heights, the child heights are decreased from what they are defined as by the offsets.It seems the decoration offsets are being double counted (i.e. added below/above the item, and then also subtracted from the item height). This is opposed to the standard
GridLayoutManager
where this works correctly and the item heights are not altered.The problem may be related to this bug fix inhttps://github.com/androidx/androidx/commit/de8a5de43b647f9b61f4859a22a0ce59155f442a
GridLayoutManager
:StaggeredGridLayoutManager
still retains theupdateSpecWithExtra
method, and skipping the calls to this method inStaggeredGridLayoutManager
(as was done in theGridLayoutManager
fix) seems to fix the issue (however I assume an actual fix would probably be slightly more involved than that).The screenshots attached show the problem in
StaggeredGridLayoutManager
with various item decoration bottom offset sizes, withGridLayoutManager
showing the correct behaviour. The sample project from which the screenshots were taken is also attached.