mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 04:43:54 +01:00
Tidied up displayCatList with List<String> cas
This commit is contained in:
parent
9cd0f8fb5a
commit
6537ff217c
1 changed files with 6 additions and 12 deletions
|
|
@ -46,29 +46,23 @@ public class CacheController {
|
||||||
//Convert decLatitude and decLongitude to a coordinate offset range
|
//Convert decLatitude and decLongitude to a coordinate offset range
|
||||||
convertCoordRange();
|
convertCoordRange();
|
||||||
pointsFound = quadTree.searchWithin(xMinus, yMinus, xPlus, yPlus);
|
pointsFound = quadTree.searchWithin(xMinus, yMinus, xPlus, yPlus);
|
||||||
List displayCatList = new ArrayList();
|
List<String> displayCatList = new ArrayList<String>();
|
||||||
Log.d(TAG, "Points found in quadtree: " + pointsFound);
|
Log.d(TAG, "Points found in quadtree: " + pointsFound);
|
||||||
|
|
||||||
List<String> flatCatList = new ArrayList<String>();
|
|
||||||
|
|
||||||
if (pointsFound.length != 0) {
|
if (pointsFound.length != 0) {
|
||||||
Log.d(TAG, "Entering for loop");
|
Log.d(TAG, "Entering for loop");
|
||||||
int index = 0;
|
|
||||||
for (Point point : pointsFound) {
|
for (Point point : pointsFound) {
|
||||||
Log.d(TAG, "Nearby point: " + point.toString());
|
Log.d(TAG, "Nearby point: " + point.toString());
|
||||||
Object cat = point.getValue();
|
displayCatList = (List<String>)point.getValue();
|
||||||
Log.d(TAG, "Nearby cat: " + cat);
|
Log.d(TAG, "Nearby cat: " + point.getValue());
|
||||||
displayCatList.add(index, cat);
|
|
||||||
index++;
|
|
||||||
}
|
}
|
||||||
//FIXME: temporary, can't figure out why for loop always only accesses 1 point
|
|
||||||
flatCatList = ((ArrayList<String>)displayCatList.get(0));
|
|
||||||
|
|
||||||
Log.d(TAG, "Categories found in cache: " + flatCatList.toString());
|
Log.d(TAG, "Categories found in cache: " + displayCatList.toString());
|
||||||
} else {
|
} else {
|
||||||
Log.d(TAG, "No categories found in cache");
|
Log.d(TAG, "No categories found in cache");
|
||||||
}
|
}
|
||||||
return flatCatList;
|
return displayCatList;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void convertCoordRange() {
|
public void convertCoordRange() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue