Skip to content

Commit c891c2b

Browse files
authored
Nearby: Fix race condition and lag when loading pin details, faster overlay management (#6047)
* temporary fixes part one * temporary fixes part two * temporary fixes part three * temporary fixes part four * temporary fixes part five * reformatting * remove code no longer in use * Migrate NearbyParentFragmentPresenter to Kotlin * Partially replace temporary experimental fixes * Replace temporary experimental fixes part 2 * Replace temporary experimental fixes part 3 * Replace temporary fixes completely * Fix caching and loading places in Nearby list * Add place bookmarking logic, Remove all old code * Nearby Presenter: Close channel properly * Nearby pins now load starting from the center Fixes #6049 * Add comments and javadoc for Nearby Presenter * Fix warnings, Fix formatting, Add javadoc * Pass unit tests
1 parent 70b4f78 commit c891c2b

File tree

6 files changed

+676
-679
lines changed

6 files changed

+676
-679
lines changed

app/src/main/java/fr/free/nrw/commons/nearby/NearbyController.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020

2121
public class NearbyController extends MapController {
2222

23-
private static final int MAX_RESULTS = 1000;
2423
private final NearbyPlaces nearbyPlaces;
24+
public static final int MAX_RESULTS = 1000;
2525
public static double currentLocationSearchRadius = 10.0; //in kilometers
2626
public static LatLng currentLocation; // Users latest fetched location
2727
public static LatLng latestSearchLocation; // Can be current and camera target on search this area button is used

app/src/main/java/fr/free/nrw/commons/nearby/contract/NearbyParentFragmentContract.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22

33
import android.content.Context;
44
import androidx.annotation.Nullable;
5+
import androidx.lifecycle.LifecycleCoroutineScope;
56
import fr.free.nrw.commons.BaseMarker;
67
import fr.free.nrw.commons.kvstore.JsonKvStore;
78
import fr.free.nrw.commons.location.LatLng;
89
import fr.free.nrw.commons.location.LocationServiceManager.LocationChangeType;
910
import fr.free.nrw.commons.nearby.Label;
11+
import fr.free.nrw.commons.nearby.MarkerPlaceGroup;
1012
import fr.free.nrw.commons.nearby.Place;
1113
import java.util.List;
1214

@@ -68,7 +70,7 @@ interface View {
6870

6971
Context getContext();
7072

71-
void updateMapMarkers(List<BaseMarker> BaseMarkers);
73+
void replaceMarkerOverlays(List<MarkerPlaceGroup> markerPlaceGroups);
7274

7375
void filterOutAllMarkers();
7476

@@ -127,5 +129,7 @@ void filterByMarkerType(List<Label> selectedLabels, int state, boolean filterFor
127129
void setCheckboxUnknown();
128130

129131
void setAdvancedQuery(String query);
132+
133+
void toggleBookmarkedStatus(Place place);
130134
}
131135
}

0 commit comments

Comments
 (0)