From c81decd70519d0c6b0d177b2b5c99e2eb0a450ca Mon Sep 17 00:00:00 2001 From: DjBushido Date: Tue, 8 Apr 2014 19:56:41 -0400 Subject: [PATCH] Refactor some weird naming conventions for locations --- .../src/edu/uncc/scavenger/rest/LocationClient.java | 6 +++--- .../src/edu/uncc/scavenger/rest/LocationService.java | 2 +- .../rest/{Location.java => RestLocation.java} | 10 ++++++---- 3 files changed, 10 insertions(+), 8 deletions(-) rename UNCCScavenger/src/edu/uncc/scavenger/rest/{Location.java => RestLocation.java} (79%) diff --git a/UNCCScavenger/src/edu/uncc/scavenger/rest/LocationClient.java b/UNCCScavenger/src/edu/uncc/scavenger/rest/LocationClient.java index b465f1d..927bd7b 100644 --- a/UNCCScavenger/src/edu/uncc/scavenger/rest/LocationClient.java +++ b/UNCCScavenger/src/edu/uncc/scavenger/rest/LocationClient.java @@ -33,12 +33,12 @@ public class LocationClient { return client.getResult(keys); } - public List getLocations() { + public List getLocations() { try { // Inline AsyncTask - return new AsyncTask>() { + return new AsyncTask>() { @Override - protected List doInBackground(Void... params) { + protected List doInBackground(Void... params) { // Work happens here return getAdapter().listLocations(); } diff --git a/UNCCScavenger/src/edu/uncc/scavenger/rest/LocationService.java b/UNCCScavenger/src/edu/uncc/scavenger/rest/LocationService.java index 2282627..61c4372 100644 --- a/UNCCScavenger/src/edu/uncc/scavenger/rest/LocationService.java +++ b/UNCCScavenger/src/edu/uncc/scavenger/rest/LocationService.java @@ -9,7 +9,7 @@ import retrofit.http.QueryMap; public interface LocationService { @GET("/locations") - List listLocations(); + List listLocations(); @GET("/validate") String getResult(@QueryMap Map keys); diff --git a/UNCCScavenger/src/edu/uncc/scavenger/rest/Location.java b/UNCCScavenger/src/edu/uncc/scavenger/rest/RestLocation.java similarity index 79% rename from UNCCScavenger/src/edu/uncc/scavenger/rest/Location.java rename to UNCCScavenger/src/edu/uncc/scavenger/rest/RestLocation.java index 6b2372e..448edb2 100644 --- a/UNCCScavenger/src/edu/uncc/scavenger/rest/Location.java +++ b/UNCCScavenger/src/edu/uncc/scavenger/rest/RestLocation.java @@ -1,6 +1,8 @@ package edu.uncc.scavenger.rest; -public class Location { +import android.location.Location; + +public class RestLocation { private int id; private String name; @@ -39,14 +41,14 @@ public class Location { this.locationLat = locationLat; } - private android.location.Location getAndroidLocation() { + public Location getLocation() { android.location.Location mLocation = new android.location.Location("NinerFinderServer"); mLocation.setLatitude(getLocationLat()); mLocation.setLongitude(getLocationLong()); return mLocation; } - public float bearingTo(Location target) { - return getAndroidLocation().bearingTo(target.getAndroidLocation()); + public float bearingTo(RestLocation target) { + return getLocation().bearingTo(target.getLocation()); } }