Add small UI fixes

This commit is contained in:
Alexander Sytnyk 2018-02-01 18:26:58 +02:00
parent 2e479f0563
commit e4298a796c

View file

@ -53,6 +53,7 @@ public class OsmNotesMenu {
showOsmBugsPref.set(isChecked); showOsmBugsPref.set(isChecked);
plugin.updateLayers(mapActivity.getMapView(), mapActivity); plugin.updateLayers(mapActivity.getMapView(), mapActivity);
mapActivity.refreshMap(); mapActivity.refreshMap();
mapActivity.getDashboard().refreshContent(true);
} else if (itemId == showZoomLevelStringId) { } else if (itemId == showZoomLevelStringId) {
int checked = Arrays.asList(zoomIntValues).indexOf(showOsmBugsZoomPref.get()); int checked = Arrays.asList(zoomIntValues).indexOf(showOsmBugsZoomPref.get());
@ -81,12 +82,22 @@ public class OsmNotesMenu {
} }
}; };
boolean showOsmBugs = showOsmBugsPref.get();
boolean nightMode = mapActivity.getMyApplication().getDaynightHelper().isNightModeForMapControls();
int toggleIconColorId;
if (showOsmBugs) {
toggleIconColorId = nightMode ? R.color.color_dialog_buttons_dark : R.color.color_dialog_buttons_light;
} else {
toggleIconColorId = nightMode ? 0 : R.color.icon_color;
}
adapter.addItem(new ContextMenuItem.ItemBuilder() adapter.addItem(new ContextMenuItem.ItemBuilder()
.setTitleId(osmNotesStringId, mapActivity) .setTitleId(osmNotesStringId, mapActivity)
.setDescription(mapActivity.getString(R.string.switch_osm_notes_visibility_desc)) .setDescription(mapActivity.getString(R.string.switch_osm_notes_visibility_desc))
.setIcon(R.drawable.ic_action_bug_dark) .setIcon(R.drawable.ic_action_bug_dark)
.setColor(toggleIconColorId)
.setListener(l) .setListener(l)
.setSelected(showOsmBugsPref.get()) .setSelected(showOsmBugs)
.createItem()); .createItem());
adapter.addItem(new ContextMenuItem.ItemBuilder() adapter.addItem(new ContextMenuItem.ItemBuilder()
@ -95,6 +106,7 @@ public class OsmNotesMenu {
.setLayout(R.layout.list_item_single_line_descrition_narrow) .setLayout(R.layout.list_item_single_line_descrition_narrow)
.setIcon(R.drawable.ic_action_map_magnifier) .setIcon(R.drawable.ic_action_map_magnifier)
.setListener(l) .setListener(l)
.setClickable(showOsmBugs)
.createItem()); .createItem());
adapter.addItem(new ContextMenuItem.ItemBuilder() adapter.addItem(new ContextMenuItem.ItemBuilder()
@ -102,6 +114,7 @@ public class OsmNotesMenu {
.setIcon(R.drawable.ic_action_note_dark) .setIcon(R.drawable.ic_action_note_dark)
.setListener(l) .setListener(l)
.setSelected(showClosedOsmBugsPref.get()) .setSelected(showClosedOsmBugsPref.get())
.setClickable(showOsmBugs)
.hideDivider(true) .hideDivider(true)
.createItem()); .createItem());