Bug 891631 - Fix saving browser toolbar instance state. r=margaret
authorBrian Nicholson <bnicholson@mozilla.com>
Thu, 25 Jul 2013 14:26:01 -0700
changeset 151427 635b940aae8df09d3855203f5c55034a7a905c4f
parent 151426 2097a11d890238b229d6ad0345090a6f5e334e81
child 151428 022ec255724712582eaa302a2b7d0843d5b5942e
push idunknown
push userunknown
push dateunknown
reviewersmargaret
bugs891631
milestone25.0a1
Bug 891631 - Fix saving browser toolbar instance state. r=margaret
mobile/android/base/BrowserApp.java
--- a/mobile/android/base/BrowserApp.java
+++ b/mobile/android/base/BrowserApp.java
@@ -482,18 +482,17 @@ abstract public class BrowserApp extends
                         return new NdefMessage(new NdefRecord[] { NdefRecord.createUri(tab.getURL()) });
                     }
                 }, this);
             }
         }
 
         if (savedInstanceState != null) {
             mDynamicToolbarEnabled = savedInstanceState.getBoolean(STATE_DYNAMIC_TOOLBAR_ENABLED);
-            // FIXME: address this in bug 876750
-            //mHomePager.setTopPadding(savedInstanceState.getInt(STATE_ABOUT_HOME_TOP_PADDING));
+            mHomePagerContainer.setPadding(0, savedInstanceState.getInt(STATE_ABOUT_HOME_TOP_PADDING), 0, 0);
         }
 
         // Listen to the dynamic toolbar pref
         mPrefObserverId = PrefsHelper.getPref(PREF_CHROME_DYNAMICTOOLBAR, new PrefsHelper.PrefHandlerBase() {
             @Override
             public void prefValue(String pref, boolean value) {
                 if (value == mDynamicToolbarEnabled) {
                     return;
@@ -577,26 +576,24 @@ abstract public class BrowserApp extends
     }
 
     private void setDynamicToolbarEnabled(boolean enabled) {
         if (enabled) {
             if (mLayerView != null) {
                 mLayerView.getLayerClient().setOnMetricsChangedListener(this);
             }
             setToolbarMargin(0);
-            // FIXME: address this in bug 876750
-            //mHomePagerContainer.setTopPadding(mBrowserToolbar.getLayout().getHeight());
+            mHomePagerContainer.setPadding(0, mBrowserToolbar.getHeight(), 0, 0);
         } else {
             // Immediately show the toolbar when disabling the dynamic
             // toolbar.
             if (mLayerView != null) {
                 mLayerView.getLayerClient().setOnMetricsChangedListener(null);
             }
-            // FIXME: address this in bug 876750
-            //mHomePagerContainer.setTopPadding(0);
+            mHomePagerContainer.setPadding(0, 0, 0, 0);
             if (mBrowserToolbar != null) {
                 mBrowserToolbar.scrollTo(0, 0);
             }
         }
 
         refreshToolbarHeight();
     }
 
@@ -1213,18 +1210,17 @@ abstract public class BrowserApp extends
         mMainLayoutAnimator = null;
     }
 
     @Override
     public void onSaveInstanceState(Bundle outState) {
         super.onSaveInstanceState(outState);
         mToast.onSaveInstanceState(outState);
         outState.putBoolean(STATE_DYNAMIC_TOOLBAR_ENABLED, mDynamicToolbarEnabled);
-        // FIXME: address this in bug 876750
-        //outState.putInt(STATE_ABOUT_HOME_TOP_PADDING, mHomePager.getTopPadding());
+        outState.putInt(STATE_ABOUT_HOME_TOP_PADDING, mHomePagerContainer.getPaddingTop());
     }
 
     private void openUrl(String url) {
         openUrl(url, null, false);
     }
 
     private void openUrl(String url, boolean newTab) {
         openUrl(url, null, newTab);