From 7e36d3f8d72072152376e1f9c6dbef52cf1db0f3 Mon Sep 17 00:00:00 2001 From: Chris Lord Date: Tue, 12 Mar 2013 18:32:26 +0000 Subject: [PATCH] Bug 846772 - Observe dynamic toolbar pref on Android. r=kats Respond to this pref changing instantly instead of requiring a restart. --- mobile/android/base/BrowserApp.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/mobile/android/base/BrowserApp.java b/mobile/android/base/BrowserApp.java index f40c048644ff..72fcfd9ffb01 100644 --- a/mobile/android/base/BrowserApp.java +++ b/mobile/android/base/BrowserApp.java @@ -449,7 +449,7 @@ abstract public class BrowserApp extends GeckoApp } } - // Load the dynamic toolbar pref + // Listen to the dynamic toolbar pref PrefsHelper.getPref(PREF_CHROME_DYNAMICTOOLBAR, new PrefsHelper.PrefHandlerBase() { @Override public void prefValue(String pref, boolean value) { @@ -466,6 +466,7 @@ abstract public class BrowserApp extends GeckoApp } else { // Immediately show the toolbar when disabling the dynamic // toolbar. + mAboutHomeContent.setPadding(0, 0, 0, 0); mBrowserToolbar.cancelVisibilityAnimation(); mBrowserToolbar.getLayout().scrollTo(0, 0); } @@ -476,6 +477,13 @@ abstract public class BrowserApp extends GeckoApp } }); } + + @Override + public boolean isObserver() { + // We want to be notified of changes to be able to switch mode + // without restarting. + return true; + } }); }