Bug 1321002 - Reduce total space at top and bottom of tabs grid panels. r=sebastian
authorTom Klein <twointofive@gmail.com>
Mon, 28 Nov 2016 14:58:09 -0600
changeset 324688 d2b817bfed7cda483903914bff356dc1e73ff05d
parent 324687 12718a74c79f3b720f5a0cef171242ab2e10b8b8
child 324689 c283c3fbcdcb949c84fbd03e7c53dbfd562f5052
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewerssebastian
bugs1321002
milestone53.0a1
Bug 1321002 - Reduce total space at top and bottom of tabs grid panels. r=sebastian 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
mobile/android/base/resources/values/dimens.xml
--- a/mobile/android/base/resources/values/dimens.xml
+++ b/mobile/android/base/resources/values/dimens.xml
@@ -144,17 +144,19 @@
     <dimen name="tabs_strip_shadow_size">1dp</dimen>
     <dimen name="validation_message_height">50dp</dimen>
     <dimen name="validation_message_margin_top">6dp</dimen>
 
     <dimen name="tab_thumbnail_width">121dp</dimen>
     <dimen name="tab_thumbnail_height">90dp</dimen>
     <dimen name="tab_panel_item_width">129dp</dimen>
     <dimen name="tab_panel_grid_hpadding">20dp</dimen>
-    <dimen name="tab_panel_grid_vpadding">19dp</dimen>
+    <!-- Top and bottom tab panel grid padding is split between tab_panel_grid_vpadding (the
+         RecyclerView padding) and tab_panel_grid_item_vpadding (individual item padding). -->
+    <dimen name="tab_panel_grid_vpadding">9dp</dimen>
     <dimen name="tab_panel_grid_ideal_item_hspacing">20dp</dimen>
     <dimen name="tab_panel_grid_min_item_hspacing">2dp</dimen>
     <dimen name="tab_panel_grid_item_vpadding">10dp</dimen>
 
     <dimen name="tab_highlight_stroke_width">4dp</dimen>
 
     <!-- PageActionButtons dimensions -->
     <dimen name="page_action_button_width">32dp</dimen>