Bug 1109155 - Gridview doesnt show the last row completely on portrait. r=mfinkle, a=sledru
authorMartyn Haigh <martyn.haigh@gmail.com>
Tue, 06 Jan 2015 14:10:29 +0000
changeset 243633 bc4e060096bd
parent 243632 e98376bbdf79
child 243634 f308adc4e97c
push id4421
push userryanvm@gmail.com
push date2015-02-02 19:52 +0000
treeherdermozilla-beta@08a02585bc60 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle, sledru
bugs1109155
milestone36.0
Bug 1109155 - Gridview doesnt show the last row completely on portrait. r=mfinkle, a=sledru
mobile/android/base/tabs/TabsGridLayout.java
--- a/mobile/android/base/tabs/TabsGridLayout.java
+++ b/mobile/android/base/tabs/TabsGridLayout.java
@@ -89,17 +89,22 @@ class TabsGridLayout extends GridView
         setClipToPadding(false);
 
         final Resources resources = getResources();
         mColumnWidth = resources.getDimensionPixelSize(R.dimen.new_tablet_tab_panel_column_width);
         setColumnWidth(mColumnWidth);
 
         final int padding = resources.getDimensionPixelSize(R.dimen.new_tablet_tab_panel_grid_padding);
         final int paddingTop = resources.getDimensionPixelSize(R.dimen.new_tablet_tab_panel_grid_padding_top);
-        setPadding(padding, paddingTop, padding, padding);
+
+        // Lets set double the top padding on the bottom so that the last row shows up properly!
+        // Your demise, GridView, cannot come fast enough.
+        final int paddingBottom = paddingTop * 2;
+
+        setPadding(padding, paddingTop, padding, paddingBottom);
 
         setOnItemClickListener(new OnItemClickListener() {
             @Override
             public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                 TabsLayoutItemView tab = (TabsLayoutItemView) view;
                 Tabs.getInstance().selectTab(tab.getTabId());
                 autoHidePanel();
             }
@@ -405,10 +410,9 @@ class TabsGridLayout extends GridView
                     child.setX(targetLocation.x);
                     child.setY(targetLocation.y);
                 }
 
                 return true;
             }
         });
     }
-
 }