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