Fix Codacy issues

This commit is contained in:
Neslihan 2017-05-12 19:05:20 +03:00
parent f9fd354d00
commit ed32ebbb62
3 changed files with 17 additions and 15 deletions

View file

@ -55,12 +55,11 @@ public class NearbyActivity extends BaseActivity {
} }
private void showMapView() { private void showMapView() {
if(!isMapViewActive){ if (!isMapViewActive) {
getSupportFragmentManager().beginTransaction() getSupportFragmentManager().beginTransaction()
.replace(R.id.container, new NearbyMapFragment()).commit(); .replace(R.id.container, new NearbyMapFragment()).commit();
isMapViewActive = true; isMapViewActive = true;
} }
} }
@Override @Override

View file

@ -7,6 +7,8 @@ import android.preference.PreferenceManager;
import com.mapbox.mapboxsdk.annotations.BaseMarkerOptions; import com.mapbox.mapboxsdk.annotations.BaseMarkerOptions;
import com.mapbox.mapboxsdk.annotations.MarkerOptions; import com.mapbox.mapboxsdk.annotations.MarkerOptions;
import fr.free.nrw.commons.location.LatLng;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.Comparator; import java.util.Comparator;
@ -15,7 +17,6 @@ import java.util.List;
import java.util.Locale; import java.util.Locale;
import java.util.Map; import java.util.Map;
import fr.free.nrw.commons.location.LatLng;
import timber.log.Timber; import timber.log.Timber;
import static fr.free.nrw.commons.utils.LengthUtils.computeDistanceBetween; import static fr.free.nrw.commons.utils.LengthUtils.computeDistanceBetween;
@ -56,13 +57,14 @@ public class NearbyController {
} }
/** /**
* Loads attractions from location for list view, we need to return Place data type * Loads attractions from location for list view, we need to return Place data type.
* @param curLatLng * @param curLatLng users current location
* @param context * @param context current activity
* @return * @return
*/ */
public static List<Place> loadAttractionsFromLocationToPlaces(LatLng curLatLng, Context context) { public static List<Place> loadAttractionsFromLocationToPlaces(LatLng curLatLng,
Context context) {
List<Place> places = loadAttractionsFromLocation(curLatLng,context); List<Place> places = loadAttractionsFromLocation(curLatLng,context);
places = places.subList(0, Math.min(places.size(), MAX_RESULTS)); places = places.subList(0, Math.min(places.size(), MAX_RESULTS));
@ -74,9 +76,9 @@ public class NearbyController {
} }
/** /**
*Loads attractions from location for map view, we need to return BaseMarkerOption data type *Loads attractions from location for map view, we need to return BaseMarkerOption data type.
* @param curLatLng * @param curLatLng users current location
* @param context * @param context the activity
* @return * @return
*/ */
public static List<BaseMarkerOptions> loadAttractionsFromLocationToBaseMarkerOptions( public static List<BaseMarkerOptions> loadAttractionsFromLocationToBaseMarkerOptions(

View file

@ -3,6 +3,9 @@ package fr.free.nrw.commons.nearby;
import android.net.Uri; import android.net.Uri;
import android.os.StrictMode; import android.os.StrictMode;
import fr.free.nrw.commons.Utils;
import fr.free.nrw.commons.location.LatLng;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.IOException; import java.io.IOException;
import java.io.InputStreamReader; import java.io.InputStreamReader;
@ -16,8 +19,6 @@ import java.util.Locale;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import fr.free.nrw.commons.Utils;
import fr.free.nrw.commons.location.LatLng;
import timber.log.Timber; import timber.log.Timber;
public class NearbyPlaces { public class NearbyPlaces {