mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-19 08:15:31 +00:00
e9ce8f8488
Previously for the spacing at the top and bottom of the tabs grid panel we had the total desired vertical spacing set on the RecyclerView padding, but then there was also an additional half spacing coming from the ItemDecoration padding in the top and bottom rows. Here we decrease the RecyclerView vertical padding to account for the ItemDecoration vertical padding. The alternative route of keeping full RecyclerView padding and then having the ItemDecoration adjust itself depending on its position turned out to not "just work": for example, if span count is three and you have four tabs, then the first three tabs have half padding along their bottoms (since there are two rows), but then when you close tab 4, there's now only one row and so the three tabs should have no padding along their bottoms (since the RecyclerView already has its own full padding), *but only tab 3 gets its ItemDecoration updated automatically*, so it gets 0 bottom padding, but its row still has other tabs with half bottom padding, so a) there's still too much bottom padding in that row coming from tabs 1 and 2, and b) tab 3 sits too far down in its space because it doesn't have the bottom padding that tabs 1 and 2 do. That issue could be fixed by updating all ItemDecorations after each close, but the patch here is both simpler and leads to less runtime work. MozReview-Commit-ID: 2WeZ6QdfIF4 --HG-- extra : rebase_source : 85aec8adfdaacac7062827e273cf697c09167d63 |
||
---|---|---|
.. | ||
android | ||
locales |