mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Changed confusing names
This commit is contained in:
parent
c8773101d5
commit
3b1a8e2c97
1 changed files with 7 additions and 10 deletions
|
|
@ -14,7 +14,6 @@ public class CacheController {
|
|||
private double x;
|
||||
private double y;
|
||||
private QuadTree quadTree;
|
||||
private List<String> categoryList;
|
||||
private Point[] pointsFound;
|
||||
|
||||
public CacheController() {
|
||||
|
|
@ -32,26 +31,24 @@ public class CacheController {
|
|||
|
||||
public void cacheCategory() {
|
||||
|
||||
List<String> pointCatList = new ArrayList<String>();
|
||||
if (MwVolleyApi.GpsCatExists.getGpsCatExists() == true) {
|
||||
categoryList = new ArrayList<String>(MwVolleyApi.getGpsCat());
|
||||
Log.d("Cache", "Categories being cached: " + categoryList);
|
||||
pointCatList.addAll(MwVolleyApi.getGpsCat());
|
||||
Log.d("Cache", "Categories being cached: " + pointCatList);
|
||||
} else {
|
||||
Log.d("Cache", "No categories found, so no categories cached");
|
||||
}
|
||||
|
||||
//categoryList = new ArrayList<String>();
|
||||
//categoryList.add("UK");
|
||||
//categoryList.add("US");
|
||||
quadTree.set(x, y, categoryList);
|
||||
quadTree.set(x, y, pointCatList);
|
||||
}
|
||||
|
||||
public void findCategory() {
|
||||
|
||||
//TODO: Convert decLatitude and decLongitude to a range with proper formula, for testing just use 10
|
||||
pointsFound = quadTree.searchWithin(x-10, y-10, x+10, y+10);
|
||||
ArrayList catList = new ArrayList();
|
||||
ArrayList displayCatList = new ArrayList();
|
||||
Log.d("Cache", "Points found in quadtree: " + pointsFound);
|
||||
|
||||
//TODO: Potentially flatten catList and iterate thru it to convert into unique Set? But currently just displays one point...
|
||||
if (pointsFound.length != 0) {
|
||||
|
||||
Log.d("Cache", "Entering for loop");
|
||||
|
|
@ -60,7 +57,7 @@ public class CacheController {
|
|||
Log.d("Cache", "Nearby point: " + point.toString());
|
||||
Object cat = point.getValue();
|
||||
Log.d("Cache", "Nearby cat: " + cat);
|
||||
catList.add(index, cat);
|
||||
displayCatList.add(index, cat);
|
||||
index++;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue