mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 04:43:54 +01:00
findCategory() returns List
This commit is contained in:
parent
4e5fb1b1ae
commit
a13eb88cd3
2 changed files with 7 additions and 5 deletions
|
|
@ -41,11 +41,11 @@ public class CacheController {
|
|||
quadTree.set(x, y, pointCatList);
|
||||
}
|
||||
|
||||
public void findCategory() {
|
||||
public List 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 displayCatList = new ArrayList();
|
||||
List 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...
|
||||
|
|
@ -60,11 +60,12 @@ public class CacheController {
|
|||
displayCatList.add(index, cat);
|
||||
index++;
|
||||
}
|
||||
|
||||
Log.d("Cache", "Categories found in cache: " + displayCatList.toString());
|
||||
} else {
|
||||
Log.d("Cache", "No categories found in cache");
|
||||
}
|
||||
|
||||
return displayCatList;
|
||||
}
|
||||
|
||||
public
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ import fr.free.nrw.commons.modifications.ModificationsContentProvider;
|
|||
import fr.free.nrw.commons.modifications.ModifierSequence;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class ShareActivity
|
||||
|
|
@ -202,7 +203,7 @@ public class ShareActivity
|
|||
Log.d("Coords", "Decimal coords of image: " + decimalCoords);
|
||||
cacheObj.cacheData.setQtPoint(decLongitude, decLatitude);
|
||||
|
||||
cacheObj.cacheData.findCategory();
|
||||
List displayCatList = cacheObj.cacheData.findCategory();
|
||||
|
||||
//TODO: If categories found from cache in that area, skip API call and display those categories instead
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue