mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-31 14:15:30 +00:00
Bug 846772 - Observe dynamic toolbar pref on Android. r=kats
Respond to this pref changing instantly instead of requiring a restart.
This commit is contained in:
parent
aaaa3fc551
commit
7e36d3f8d7
@ -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;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user