From 0a86a3120373899bacc2ff392094e45c58b447c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Sch=C3=B6nberg?= Date: Sun, 28 May 2017 18:39:10 +0200 Subject: [PATCH] Code style fixes --- app/src/main/java/fr/free/nrw/commons/location/LatLng.java | 2 +- .../free/nrw/commons/location/LocationServiceManager.java | 3 ++- .../java/fr/free/nrw/commons/nearby/NearbyMapFragment.java | 7 ++++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/fr/free/nrw/commons/location/LatLng.java b/app/src/main/java/fr/free/nrw/commons/location/LatLng.java index 0cc5ba00f..4b92b34ab 100644 --- a/app/src/main/java/fr/free/nrw/commons/location/LatLng.java +++ b/app/src/main/java/fr/free/nrw/commons/location/LatLng.java @@ -4,7 +4,7 @@ public class LatLng { public final double latitude; public final double longitude; - public final float accuracy; + private final float accuracy; /** Accepts latitude and longitude. * North and South values are cut off at 90° diff --git a/app/src/main/java/fr/free/nrw/commons/location/LocationServiceManager.java b/app/src/main/java/fr/free/nrw/commons/location/LocationServiceManager.java index 041281464..e87eaf92e 100644 --- a/app/src/main/java/fr/free/nrw/commons/location/LocationServiceManager.java +++ b/app/src/main/java/fr/free/nrw/commons/location/LocationServiceManager.java @@ -69,7 +69,8 @@ public class LocationServiceManager implements LocationListener { double currentLatitude = location.getLatitude(); double currentLongitude = location.getLongitude(); latestLocationAccuracy = location.getAccuracy(); - Timber.d("Latitude: %f Longitude: %f Accuracy %f", currentLatitude, currentLongitude, latestLocationAccuracy); + Timber.d("Latitude: %f Longitude: %f Accuracy %f", + currentLatitude, currentLongitude, latestLocationAccuracy); latestLocation = new LatLng(currentLatitude, currentLongitude, latestLocationAccuracy); } diff --git a/app/src/main/java/fr/free/nrw/commons/nearby/NearbyMapFragment.java b/app/src/main/java/fr/free/nrw/commons/nearby/NearbyMapFragment.java index 093eee33f..ed50555a4 100644 --- a/app/src/main/java/fr/free/nrw/commons/nearby/NearbyMapFragment.java +++ b/app/src/main/java/fr/free/nrw/commons/nearby/NearbyMapFragment.java @@ -146,11 +146,12 @@ public class NearbyMapFragment extends android.support.v4.app.Fragment { * * @return List List of LatLng points of the circle. */ - public List createCircleArray(double centerLat, double centerLong, float radius, int nodes) { + public List createCircleArray( + double centerLat, double centerLong, float radius, int nodes) { List circle = new ArrayList<>(); float radiusKilometer = radius / 1000; - double radiusLong = radiusKilometer / - (111.320 * Math.cos(centerLat * Math.PI / 180)); + double radiusLong = radiusKilometer + / (111.320 * Math.cos(centerLat * Math.PI / 180)); double radiusLat = radiusKilometer / 110.574; for (int i = 0; i < nodes; i++) {