Fix icons

This commit is contained in:
Alexander Sytnyk 2017-11-10 12:18:21 +02:00
parent 6b4d786f9f
commit f1df9abb4d

View file

@ -284,16 +284,14 @@ public class DirectionIndicationDialogFragment extends BaseOsmAndDialogFragment
} }
private Drawable getIconTop(int id, boolean active) { private Drawable getIconTop(int id, boolean active) {
return active ? getIcon(id, R.color.osmand_orange) return active ? getIcon(id, R.color.osmand_orange) : getContentIcon(id);
: getContentIcon(id);
} }
private void updateDisplayedMarkersCount(int count) { private void updateDisplayedMarkersCount(int count) {
((TextView) mainView.findViewById(R.id.active_markers_text_view)) ((TextView) mainView.findViewById(R.id.active_markers_text_view))
.setText(count == 1 ? R.string.shared_string_one : R.string.shared_string_two); .setText(count == 1 ? R.string.shared_string_one : R.string.shared_string_two);
getSettings().DISPLAYED_MARKERS_WIDGETS_COUNT.set(count); getSettings().DISPLAYED_MARKERS_WIDGETS_COUNT.set(count);
notifyListener(); updateSelection(true);
updateHelpImage();
} }
private void updateChecked(OsmandPreference<Boolean> setting, CompoundButton button) { private void updateChecked(OsmandPreference<Boolean> setting, CompoundButton button) {
@ -320,8 +318,11 @@ public class DirectionIndicationDialogFragment extends BaseOsmAndDialogFragment
OsmandSettings settings = getSettings(); OsmandSettings settings = getSettings();
MapMarkersMode mode = settings.MAP_MARKERS_MODE.get(); MapMarkersMode mode = settings.MAP_MARKERS_MODE.get();
boolean distIndEnabled = settings.MARKERS_DISTANCE_INDICATION_ENABLED.get(); boolean distIndEnabled = settings.MARKERS_DISTANCE_INDICATION_ENABLED.get();
updateIcon(R.id.top_bar_icon, R.drawable.ic_action_device_topbar, mode.isToolbar() && distIndEnabled); int count = settings.DISPLAYED_MARKERS_WIDGETS_COUNT.get();
updateIcon(R.id.widget_icon, R.drawable.ic_action_device_widget, mode.isWidgets() && distIndEnabled); int topBarIconId = count == 1 ? R.drawable.ic_action_device_topbar : R.drawable.ic_action_device_topbar_two;
int widgetIconId = count == 1 ? R.drawable.ic_action_device_widget : R.drawable.ic_action_device_widget_two;
updateIcon(R.id.top_bar_icon, topBarIconId, mode.isToolbar() && distIndEnabled);
updateIcon(R.id.widget_icon, widgetIconId, mode.isWidgets() && distIndEnabled);
updateMarkerModeRow(R.id.top_bar_row, R.id.top_bar_radio_button, mode.isToolbar(), distIndEnabled); updateMarkerModeRow(R.id.top_bar_row, R.id.top_bar_radio_button, mode.isToolbar(), distIndEnabled);
updateMarkerModeRow(R.id.widget_row, R.id.widget_radio_button, mode.isWidgets(), distIndEnabled); updateMarkerModeRow(R.id.widget_row, R.id.widget_radio_button, mode.isWidgets(), distIndEnabled);
if (notifyListener) { if (notifyListener) {