Skip to content

Commit 5df18fb

Browse files
authored
Replaced Mapbox with osmdroid (Nearby activity) (#5403)
* Fixed Grey empty screen at Upload wizard caption step after denying files permission * Empty commit * Fixed loop issue * Created docs for earlier commits * Fixed javadoc * Fixed spaces * Added added basic features to OSM Maps * Added search location feature * Added filter to Open Street Maps * Fixed chipGroup in Open Street Maps * Removed mapBox code * Removed mapBox's code * Reformat code * Reformatted code * Removed rotation feature to map * Removed rotation files and Fixed Marker click problem * Ignored failing tests
1 parent 3d525d4 commit 5df18fb

File tree

10 files changed

+1241
-1040
lines changed

10 files changed

+1241
-1040
lines changed

.idea/codeStyles/Project.xml

-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/build.gradle

+2
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,8 @@ dependencies {
161161

162162
implementation("io.github.coordinates2country:coordinates2country-android:1.3") { exclude group: 'com.google.android', module: 'android' }
163163

164+
//OSMDroid
165+
implementation ("org.osmdroid:osmdroid-android:$OSMDROID_VERSION")
164166
constraints {
165167
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.0") {
166168
because("kotlin-stdlib-jdk7 is now a part of kotlin-stdlib")

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

+53-10
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,84 @@
11
package fr.free.nrw.commons.nearby.contract;
22

33
import android.content.Context;
4-
54
import androidx.annotation.Nullable;
65
import com.mapbox.mapboxsdk.annotations.Marker;
7-
8-
import fr.free.nrw.commons.location.LocationServiceManager.LocationChangeType;
9-
import java.util.List;
10-
116
import fr.free.nrw.commons.kvstore.JsonKvStore;
127
import fr.free.nrw.commons.location.LatLng;
8+
import fr.free.nrw.commons.location.LocationServiceManager.LocationChangeType;
139
import fr.free.nrw.commons.nearby.Label;
1410
import fr.free.nrw.commons.nearby.NearbyBaseMarker;
1511
import fr.free.nrw.commons.nearby.Place;
12+
import java.util.List;
1613

1714
public interface NearbyParentFragmentContract {
1815

1916
interface View {
17+
2018
boolean isNetworkConnectionEstablished();
19+
2120
void listOptionMenuItemClicked();
21+
2222
void populatePlaces(LatLng curlatLng);
23+
2324
void populatePlaces(LatLng curlatLng, String customQuery);
25+
2426
boolean isListBottomSheetExpanded();
27+
2528
void checkPermissionsAndPerformAction();
29+
2630
void displayLoginSkippedWarning();
31+
2732
void setFABPlusAction(android.view.View.OnClickListener onClickListener);
33+
2834
void setFABRecenterAction(android.view.View.OnClickListener onClickListener);
35+
2936
void animateFABs();
37+
3038
void recenterMap(LatLng curLatLng);
39+
3140
void showLocationOffDialog();
41+
3242
void openLocationSettings();
43+
3344
void hideBottomSheet();
45+
3446
void hideBottomDetailsSheet();
47+
3548
void displayBottomSheetWithInfo(Marker marker);
36-
void addOnCameraMoveListener();
49+
3750
void addSearchThisAreaButtonAction();
51+
3852
void setSearchThisAreaButtonVisibility(boolean isVisible);
53+
3954
void setProgressBarVisibility(boolean isVisible);
55+
4056
void setTabItemContributions();
57+
4158
boolean isDetailsBottomSheetVisible();
59+
4260
void setBottomSheetDetailsSmaller();
43-
boolean isSearchThisAreaButtonVisible();
61+
4462
void setRecyclerViewAdapterAllSelected();
63+
4564
void setRecyclerViewAdapterItemsGreyedOut();
65+
4666
void setCheckBoxAction();
67+
4768
void setCheckBoxState(int state);
69+
4870
void setFilterState();
71+
4972
void disableFABRecenter();
73+
5074
void enableFABRecenter();
75+
5176
void addCurrentLocationMarker(LatLng curLatLng);
5277

5378
void updateMapToTrackPosition(LatLng curLatLng);
5479

80+
void clearAllMarkers();
81+
5582
Context getContext();
5683

5784
void updateMapMarkers(List<NearbyBaseMarker> nearbyBaseMarkers, Marker selectedMarker);
@@ -60,7 +87,9 @@ interface View {
6087

6188
void displayAllMarkers();
6289

63-
void filterMarkersByLabels(List<Label> selectedLabels, boolean existsSelected, boolean needPhotoSelected, boolean wlmSelected, boolean filterForPlaceState, boolean filterForAllNoneType);
90+
void filterMarkersByLabels(List<Label> selectedLabels, boolean existsSelected,
91+
boolean needPhotoSelected, boolean wlmSelected, boolean filterForPlaceState,
92+
boolean filterForAllNoneType);
6493

6594
LatLng getCameraTarget();
6695

@@ -70,10 +99,15 @@ interface View {
7099

71100
LatLng getLastLocation();
72101

102+
LatLng getLastMapFocus();
103+
104+
LatLng getMapCenter();
105+
106+
LatLng getMapFocus();
107+
73108
com.mapbox.mapboxsdk.geometry.LatLng getLastFocusLocation();
74109

75110
boolean isCurrentLocationMarkerVisible();
76-
void setProjectorLatLngBounds();
77111

78112
boolean isAdvancedQueryFragmentVisible();
79113

@@ -83,26 +117,35 @@ interface View {
83117
}
84118

85119
interface NearbyListView {
120+
86121
void updateListFragment(List<Place> placeList);
87122
}
88123

89124
interface UserActions {
125+
90126
void updateMapAndList(LocationChangeType locationChangeType);
127+
91128
void lockUnlockNearby(boolean isNearbyLocked);
92129

93130
void attachView(View view);
94131

95132
void detachView();
96133

97134
void setActionListeners(JsonKvStore applicationKvStore);
135+
98136
void removeNearbyPreferences(JsonKvStore applicationKvStore);
137+
99138
boolean backButtonClicked();
139+
100140
void onCameraMove(com.mapbox.mapboxsdk.geometry.LatLng latLng);
101-
void filterByMarkerType(List<Label> selectedLabels, int state, boolean filterForPlaceState, boolean filterForAllNoneType);
141+
142+
void filterByMarkerType(List<Label> selectedLabels, int state, boolean filterForPlaceState,
143+
boolean filterForAllNoneType);
102144

103145
void updateMapMarkersToController(List<NearbyBaseMarker> nearbyBaseMarkers);
104146

105147
void searchViewGainedFocus();
148+
106149
void setCheckboxUnknown();
107150

108151
void setAdvancedQuery(String query);

0 commit comments

Comments
 (0)