Fix if else in amenity controller

This commit is contained in:
PavelRatushny 2017-12-21 15:41:10 +02:00
parent d33ec08b18
commit 2ba6c849ba

View file

@ -67,17 +67,15 @@ public class AmenityMenuController extends MenuController {
new MapMarkerMenuController(mapActivity, marker.getPointDescription(mapActivity), marker);
leftTitleButtonController = markerMenuController.getLeftTitleButtonController();
rightTitleButtonController = markerMenuController.getRightTitleButtonController();
} else {
if (amenity.getType().isWiki()) {
leftTitleButtonController = new TitleButtonController() {
@Override
public void buttonPressed() {
POIMapLayer.showWikipediaDialog(mapActivity, mapActivity.getMyApplication(), amenity);
}
};
leftTitleButtonController.caption = getMapActivity().getString(R.string.context_menu_read_article);
leftTitleButtonController.leftIcon = getIcon(R.drawable.ic_action_note_dark, isLight() ? R.color.ctx_menu_controller_button_text_color_light_n : R.color.ctx_menu_controller_button_text_color_dark_n);
}
} else if (amenity.getType().isWiki()) {
leftTitleButtonController = new TitleButtonController() {
@Override
public void buttonPressed() {
POIMapLayer.showWikipediaDialog(mapActivity, mapActivity.getMyApplication(), amenity);
}
};
leftTitleButtonController.caption = getMapActivity().getString(R.string.context_menu_read_article);
leftTitleButtonController.leftIcon = getIcon(R.drawable.ic_action_note_dark, isLight() ? R.color.ctx_menu_controller_button_text_color_light_n : R.color.ctx_menu_controller_button_text_color_dark_n);
}
}