Fix small issues

This commit is contained in:
alex 2018-03-20 18:34:49 +02:00
parent 8bc61a1b1b
commit 2199c796a3

View file

@ -377,19 +377,12 @@ public class MapMarkersHelper {
}
}
// TODO rewrite?
public void updateGroup(MapMarkersGroup mapMarkersGroup) {
// if (mapMarkersGroup.getMarkers().size() == 0) {
// removeFromGroupsList(mapMarkersGroup);
// return;
// }
createHeaderAndHistoryButtonInGroup(mapMarkersGroup);
int historyMarkersCount = mapMarkersGroup.getHistoryMarkers().size();
ShowHideHistoryButton showHideHistoryButton = mapMarkersGroup.getShowHideHistoryButton();
if (showHideHistoryButton != null) {
if (historyMarkersCount == 0) {
if (showHideHistoryButton != null && historyMarkersCount == 0) {
mapMarkersGroup.setShowHideHistoryButton(null);
}
} else if (historyMarkersCount > 0) {
showHideHistoryButton = new ShowHideHistoryButton();
showHideHistoryButton.setShowHistory(false);
@ -417,6 +410,7 @@ public class MapMarkersHelper {
mapMarkersGroup.setId(marker.groupKey);
mapMarkersGroup.setName(marker.groupName);
mapMarkersGroup.setCreationDate(Long.MAX_VALUE);
mapMarkersGroup.getMarkers().add(marker);
addToGroupsList(mapMarkersGroup);
sortGroups();
updateGroup(mapMarkersGroup);