Commit 517f32a7 authored by Alan Newberger's avatar Alan Newberger
Browse files

Restore grid initialization logic to fix grid display on startup

The large settings refactor in ag/484817 not only changed settings
calls in ButtonManager.initializeGridLinesButton, it altered the
order of calls to create the button callback and to set the button
state. The prior implementation and this CL creates the callback,
and then sets state so that the callback, which controls display,
runs upon initial state setup of the button. Otherwise the grid
is not shown correctly on module startup.

Bug: 16687954
Change-Id: I482906d2d54a8545066dded3209b55ae4ad48bdb
parent 57bcd92f
......@@ -786,10 +786,6 @@ public class ButtonManager implements SettingsManager.OnSettingChangedListener {
}
button.overrideContentDescriptions(R.array.grid_lines_descriptions);
int index = mSettingsManager.getIndexOfCurrentValue(SettingsManager.SCOPE_GLOBAL,
Keys.KEY_CAMERA_GRID_LINES);
button.setState(index >= 0 ? index : 0, false);
button.setOnStateChangeListener(new MultiToggleImageButton.OnStateChangeListener() {
@Override
public void stateChanged(View view, int state) {
......@@ -800,6 +796,10 @@ public class ButtonManager implements SettingsManager.OnSettingChangedListener {
}
}
});
int index = mSettingsManager.getIndexOfCurrentValue(SettingsManager.SCOPE_GLOBAL,
Keys.KEY_CAMERA_GRID_LINES);
button.setState(index >= 0 ? index : 0, true);
}
public boolean isPanoEnabled() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment