Bug 869411 - Part 2: Replace getPadding() with getTopPadding() in AboutHome. r=lucasr, a=lsblakk
authorBrian Nicholson <bnicholson@mozilla.com>
Thu, 23 May 2013 11:29:43 -0700
changeset 142755 90c8dc46a182a43dd2ce429e8073855c82432d2a
parent 142754 64fc1861d51cc30b010c5c49b4b30cec59b470a8
child 142756 f14cb7d1d276983b153af9f3870b663c0d049d01
push id2579
push userakeybl@mozilla.com
push dateMon, 24 Jun 2013 18:52:47 +0000
treeherdermozilla-beta@b69b7de8a05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslucasr, lsblakk
bugs869411
milestone23.0a2
Bug 869411 - Part 2: Replace getPadding() with getTopPadding() in AboutHome. r=lucasr, a=lsblakk
mobile/android/base/BrowserApp.java
mobile/android/base/widget/AboutHome.java
--- a/mobile/android/base/BrowserApp.java
+++ b/mobile/android/base/BrowserApp.java
@@ -457,17 +457,17 @@ abstract public class BrowserApp extends
             }
             setToolbarMargin(0);
         } else {
             // Immediately show the toolbar when disabling the dynamic
             // toolbar.
             if (mLayerView != null) {
                 mLayerView.getLayerClient().setOnMetricsChangedListener(null);
             }
-            mAboutHome.setPadding(0, 0, 0, 0);
+            mAboutHome.setTopPadding(0);
             if (mBrowserToolbar != null) {
                 mBrowserToolbar.getLayout().scrollTo(0, 0);
             }
         }
 
         refreshToolbarHeight();
     }
 
@@ -609,17 +609,17 @@ abstract public class BrowserApp extends
         if (!isDynamicToolbarEnabled() || mAboutHome.getUserVisibleHint()) {
             // Use aVisibleHeight here so that when the dynamic toolbar is
             // enabled, the padding will animate with the toolbar becoming
             // visible.
             if (isDynamicToolbarEnabled()) {
                 // When the dynamic toolbar is enabled, set the padding on the
                 // about:home widget directly - this is to avoid resizing the
                 // LayerView, which can cause visible artifacts.
-                mAboutHome.setPadding(0, height, 0, 0);
+                mAboutHome.setTopPadding(height);
             } else {
                 setToolbarMargin(height);
                 height = 0;
             }
         } else {
             setToolbarMargin(0);
         }
 
--- a/mobile/android/base/widget/AboutHome.java
+++ b/mobile/android/base/widget/AboutHome.java
@@ -32,20 +32,17 @@ public class AboutHome extends Fragment 
 
         public static final EnumSet<UpdateFlags> ALL = EnumSet.allOf(UpdateFlags.class);
     }
 
     private UriLoadListener mUriLoadListener;
     private LoadCompleteListener mLoadCompleteListener;
     private LightweightTheme mLightweightTheme;
     private ContentObserver mTabsContentObserver;
-    private int mPaddingLeft;
-    private int mPaddingRight;
-    private int mPaddingTop;
-    private int mPaddingBottom;
+    private int mTopPadding;
     private AboutHomeView mAboutHomeView;
     private AddonsSection mAddonsSection;
     private LastTabsSection mLastTabsSection;
     private RemoteTabsSection mRemoteTabsSection;
     private TopSitesView mTopSitesView;
 
     public interface UriLoadListener {
         public void onAboutHomeUriLoad(String uriSpec);
@@ -108,17 +105,17 @@ public class AboutHome extends Fragment 
 
         return mAboutHomeView;
     }
 
     @Override
     public void onViewCreated(View view, Bundle savedInstanceState) {
         super.onViewCreated(view, savedInstanceState);
 
-        view.setPadding(mPaddingLeft, mPaddingTop, mPaddingRight, mPaddingBottom);
+        view.setPadding(0, mTopPadding, 0, 0);
         ((PromoBox) view.findViewById(R.id.promo_box)).showRandomPromo();
         update(AboutHome.UpdateFlags.ALL);
 
         mTopSitesView.setLoadCompleteListener(mLoadCompleteListener);
         mTopSitesView.setUriLoadListener(mUriLoadListener);
         mAddonsSection.setUriLoadListener(mUriLoadListener);
 
         // Reload the mobile homepage on inbound tab syncs
@@ -237,23 +234,20 @@ public class AboutHome extends Fragment 
 
     public void requestFocus() {
         View view = getView();
         if (view != null) {
             view.requestFocus();
         }
     }
 
-    public void setPadding(int left, int top, int right, int bottom) {
+    public void setTopPadding(int topPadding) {
         View view = getView();
         if (view != null) {
-            view.setPadding(left, top, right, bottom);
+            view.setPadding(0, topPadding, 0, 0);
         }
 
         // If the padding has changed but the view hasn't been created yet,
         // store the padding values here; they will be used later in
         // onViewCreated().
-        mPaddingLeft = left;
-        mPaddingRight = right;
-        mPaddingTop = top;
-        mPaddingBottom = bottom;
+        mTopPadding = topPadding;
     }
 }