Fix "show history" button
This commit is contained in:
parent
2199c796a3
commit
ee4622a4aa
2 changed files with 6 additions and 5 deletions
|
@ -378,11 +378,13 @@ public class MapMarkersHelper {
|
|||
}
|
||||
|
||||
public void updateGroup(MapMarkersGroup mapMarkersGroup) {
|
||||
createHeaderAndHistoryButtonInGroup(mapMarkersGroup);
|
||||
createHeaderInGroup(mapMarkersGroup);
|
||||
int historyMarkersCount = mapMarkersGroup.getHistoryMarkers().size();
|
||||
ShowHideHistoryButton showHideHistoryButton = mapMarkersGroup.getShowHideHistoryButton();
|
||||
if (showHideHistoryButton != null && historyMarkersCount == 0) {
|
||||
mapMarkersGroup.setShowHideHistoryButton(null);
|
||||
if (showHideHistoryButton != null) {
|
||||
if (historyMarkersCount == 0) {
|
||||
mapMarkersGroup.setShowHideHistoryButton(null);
|
||||
}
|
||||
} else if (historyMarkersCount > 0) {
|
||||
showHideHistoryButton = new ShowHideHistoryButton();
|
||||
showHideHistoryButton.setShowHistory(false);
|
||||
|
@ -418,7 +420,7 @@ public class MapMarkersHelper {
|
|||
}
|
||||
}
|
||||
|
||||
private void createHeaderAndHistoryButtonInGroup(@NonNull MapMarkersGroup group) {
|
||||
private void createHeaderInGroup(@NonNull MapMarkersGroup group) {
|
||||
if (group.getName() != null) {
|
||||
GroupHeader header = new GroupHeader();
|
||||
int type = group.getType();
|
||||
|
|
|
@ -137,7 +137,6 @@ public class MapMarkersGroupsAdapter extends RecyclerView.Adapter<RecyclerView.V
|
|||
}
|
||||
} else {
|
||||
GroupHeader header = group.getGroupHeader();
|
||||
// TODO fix null-header
|
||||
items.add(header);
|
||||
populateAdapterWithGroupMarkers(group, getItemCount());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue