Remove individual remove and add metods, use only setItems for setting items instead (#4107)

This commit is contained in:
neslihanturan 2020-12-15 18:10:05 +03:00 committed by GitHub
parent 58cd7b85a1
commit 9e92c95d42
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -675,14 +675,6 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment
noResultsView.setVisibility(placeList.isEmpty() ? View.VISIBLE : View.GONE);
}
public void clearNearbyList() {
adapter.clear();
}
public void addPlaceToNearbyList(final Place place) {
adapter.add(place);
}
@Override
public fr.free.nrw.commons.location.LatLng getLastLocation() {
return lastKnownLocation;
@ -1206,8 +1198,6 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment
* @param curLatLng current location
*/
public void updateMarker(final boolean isBookmarked, final Place place, @Nullable final fr.free.nrw.commons.location.LatLng curLatLng) {
addPlaceToNearbyList(place);
VectorDrawableCompat vectorDrawable = VectorDrawableCompat.create(
getContext().getResources(), getIconFor(place, isBookmarked), getContext().getTheme());
@ -1266,7 +1256,6 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment
}
}
addCurrentLocationMarker(NearbyController.currentLocation);
clearNearbyList();
}
private void addNearbyMarkersToMapBoxMap(final List<NearbyBaseMarker> nearbyBaseMarkers, final Marker selectedMarker) {