Add delete action to history menu
This commit is contained in:
parent
1810e5fcbf
commit
aa64fcd47a
2 changed files with 13 additions and 1 deletions
|
@ -252,6 +252,14 @@ public class MapMarkersHelper {
|
|||
}
|
||||
}
|
||||
|
||||
public void removeMarkerFromHistory(MapMarker marker) {
|
||||
if (marker != null) {
|
||||
markersDbHelper.removeMarkerFromHistory(marker);
|
||||
loadMarkers();
|
||||
refresh();
|
||||
}
|
||||
}
|
||||
|
||||
public List<MapMarker> getMapMarkers() {
|
||||
return mapMarkers;
|
||||
}
|
||||
|
|
|
@ -82,7 +82,11 @@ public class MapMarkersHistoryFragment extends Fragment implements MapMarkersHel
|
|||
|
||||
@Override
|
||||
public void onDeleteMarker(int pos) {
|
||||
|
||||
Object item = adapter.getItem(pos);
|
||||
if (item instanceof MapMarker) {
|
||||
app.getMapMarkersHelper().removeMarkerFromHistory((MapMarker) item);
|
||||
adapter.notifyItemRemoved(pos);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue