Skip to content

Commit ed32ebb

Browse files
committed
Fix Codacy issues
1 parent f9fd354 commit ed32ebb

File tree

3 files changed

+17
-15
lines changed

3 files changed

+17
-15
lines changed

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

+1-2
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,11 @@ public boolean onOptionsItemSelected(MenuItem item) {
5555
}
5656

5757
private void showMapView() {
58-
if(!isMapViewActive){
58+
if (!isMapViewActive) {
5959
getSupportFragmentManager().beginTransaction()
6060
.replace(R.id.container, new NearbyMapFragment()).commit();
6161
isMapViewActive = true;
6262
}
63-
6463
}
6564

6665
@Override

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

+13-11
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
import com.mapbox.mapboxsdk.annotations.BaseMarkerOptions;
88
import com.mapbox.mapboxsdk.annotations.MarkerOptions;
99

10+
import fr.free.nrw.commons.location.LatLng;
11+
1012
import java.util.ArrayList;
1113
import java.util.Collections;
1214
import java.util.Comparator;
@@ -15,7 +17,6 @@
1517
import java.util.Locale;
1618
import java.util.Map;
1719

18-
import fr.free.nrw.commons.location.LatLng;
1920
import timber.log.Timber;
2021

2122
import static fr.free.nrw.commons.utils.LengthUtils.computeDistanceBetween;
@@ -56,13 +57,14 @@ public int compare(Place lhs, Place rhs) {
5657
}
5758

5859
/**
59-
* Loads attractions from location for list view, we need to return Place data type
60-
* @param curLatLng
61-
* @param context
60+
* Loads attractions from location for list view, we need to return Place data type.
61+
* @param curLatLng users current location
62+
* @param context current activity
6263
* @return
6364
*/
6465

65-
public static List<Place> loadAttractionsFromLocationToPlaces(LatLng curLatLng, Context context) {
66+
public static List<Place> loadAttractionsFromLocationToPlaces(LatLng curLatLng,
67+
Context context) {
6668

6769
List<Place> places = loadAttractionsFromLocation(curLatLng,context);
6870
places = places.subList(0, Math.min(places.size(), MAX_RESULTS));
@@ -74,9 +76,9 @@ public static List<Place> loadAttractionsFromLocationToPlaces(LatLng curLatLng,
7476
}
7577

7678
/**
77-
*Loads attractions from location for map view, we need to return BaseMarkerOption data type
78-
* @param curLatLng
79-
* @param context
79+
*Loads attractions from location for map view, we need to return BaseMarkerOption data type.
80+
* @param curLatLng users current location
81+
* @param context the activity
8082
* @return
8183
*/
8284
public static List<BaseMarkerOptions> loadAttractionsFromLocationToBaseMarkerOptions(
@@ -89,10 +91,10 @@ public static List<BaseMarkerOptions> loadAttractionsFromLocationToBaseMarkerOpt
8991
String distance = formatDistanceBetween(curLatLng, place.location);
9092
place.setDistance(distance);
9193
baseMarkerOptionses.add(new MarkerOptions()
92-
.position(new com.mapbox.mapboxsdk.geometry
94+
.position(new com.mapbox.mapboxsdk.geometry
9395
.LatLng(place.location.latitude,place.location.longitude))
94-
.title(place.name)
95-
.snippet(place.description));
96+
.title(place.name)
97+
.snippet(place.description));
9698
}
9799
return baseMarkerOptionses;
98100
}

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
import android.net.Uri;
44
import android.os.StrictMode;
55

6+
import fr.free.nrw.commons.Utils;
7+
import fr.free.nrw.commons.location.LatLng;
8+
69
import java.io.BufferedReader;
710
import java.io.IOException;
811
import java.io.InputStreamReader;
@@ -16,8 +19,6 @@
1619
import java.util.regex.Matcher;
1720
import java.util.regex.Pattern;
1821

19-
import fr.free.nrw.commons.Utils;
20-
import fr.free.nrw.commons.location.LatLng;
2122
import timber.log.Timber;
2223

2324
public class NearbyPlaces {

0 commit comments

Comments
 (0)