Bug 1403728 - Remove unwanted padding. r=jwu
authorNevin Chen(:nechen) <cnevinchen@gmail.com>
Fri, 06 Oct 2017 13:02:09 +0800
changeset 427511 f3e41eff3192312b05f0e3762fdc445b0a58e859
parent 427510 0b70ead3e555da343acf9f3953fcfd6612d7ff31
child 427512 b05a80fad5bcdd6066d7f8b4775337a1513cfda8
push id97
push userfmarier@mozilla.com
push dateSat, 14 Oct 2017 01:12:59 +0000
reviewersjwu
bugs1403728
milestone58.0a1
Bug 1403728 - Remove unwanted padding. r=jwu MozReview-Commit-ID: lMO3l83226
mobile/android/app/src/photon/res/values/dimens.xml
mobile/android/base/java/org/mozilla/gecko/tabs/TabsListLayout.java
--- a/mobile/android/app/src/photon/res/values/dimens.xml
+++ b/mobile/android/app/src/photon/res/values/dimens.xml
@@ -169,19 +169,16 @@
 
     <!-- CompactTabsGridLayout -->
     <dimen name="tab_panel_grid_hpadding_compact">15dp</dimen>
     <dimen name="tab_panel_grid_vpadding_compact">7dp</dimen>
     <dimen name="tab_panel_grid_item_hpadding_compact">10dp</dimen>
     <dimen name="tab_panel_grid_item_vpadding_compact">6dp</dimen>
 
     <!-- TabsListLayout -->
-    <dimen name="tab_panel_list_item_top_padding">6dp</dimen>
-
-
     <dimen name="tab_highlight_stroke_width">5dp</dimen>
 
     <!-- PageActionButtons dimensions -->
     <dimen name="page_action_button_width">@dimen/browser_toolbar_image_button_width</dimen>
 
     <!-- Banner -->
     <dimen name="home_banner_height">72dp</dimen>
     <dimen name="home_banner_close_width">42dp</dimen>
--- a/mobile/android/base/java/org/mozilla/gecko/tabs/TabsListLayout.java
+++ b/mobile/android/base/java/org/mozilla/gecko/tabs/TabsListLayout.java
@@ -26,40 +26,31 @@ public class TabsListLayout extends Tabs
 
     public TabsListLayout(Context context, AttributeSet attrs) {
         super(context, attrs, R.layout.tabs_list_item_view);
 
         setHasFixedSize(true);
 
         setLayoutManager(new LinearLayoutManager(context));
 
-        setPadding();
-
         final int dragDirections = ItemTouchHelper.UP | ItemTouchHelper.DOWN;
         // A TouchHelper handler for drag and drop and swipe to close.
         final TabsTouchHelperCallback callback = new TabsTouchHelperCallback(this, dragDirections, this) {
             @Override
             protected float alphaForItemSwipeDx(float dX, int distanceToAlphaMin) {
                 return Math.max(0.1f,
                         Math.min(1f, 1f - 2f * Math.abs(dX) / distanceToAlphaMin));
             }
         };
         final ItemTouchHelper touchHelper = new ItemTouchHelper(callback);
         touchHelper.attachToRecyclerView(this);
 
         setItemAnimator(new TabsListLayoutAnimator(ANIMATION_DURATION));
     }
 
-    private void setPadding() {
-        final float scale = getResources().getDisplayMetrics().density;
-        final float sizeInDp = getResources().getDimensionPixelSize(R.dimen.tab_panel_list_item_top_padding);
-        final int dpAsPixels = (int) (sizeInDp * scale);
-        super.setPadding(0, dpAsPixels, 0, dpAsPixels);
-    }
-
     @Override
     public void closeAll() {
         final int childCount = getChildCount();
 
         // Just close the panel if there are no tabs to close.
         if (childCount == 0) {
             autoHidePanel();
             return;