mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 04:43:54 +01:00
Simplify catList is empty logic
This commit is contained in:
parent
9baafdf82b
commit
5d4768e1ee
1 changed files with 4 additions and 4 deletions
|
|
@ -191,7 +191,7 @@ public class ShareActivity
|
||||||
//convert image Uri to file path
|
//convert image Uri to file path
|
||||||
FilePathConverter uriObj = new FilePathConverter(this, mediaUri);
|
FilePathConverter uriObj = new FilePathConverter(this, mediaUri);
|
||||||
String filePath = uriObj.getFilePath();
|
String filePath = uriObj.getFilePath();
|
||||||
|
|
||||||
|
|
||||||
if (filePath != null) {
|
if (filePath != null) {
|
||||||
//extract the coordinates of image in decimal degrees
|
//extract the coordinates of image in decimal degrees
|
||||||
|
|
@ -206,11 +206,11 @@ public class ShareActivity
|
||||||
app.cacheData.setQtPoint(decLongitude, decLatitude);
|
app.cacheData.setQtPoint(decLongitude, decLatitude);
|
||||||
|
|
||||||
MwVolleyApi apiCall = new MwVolleyApi(this);
|
MwVolleyApi apiCall = new MwVolleyApi(this);
|
||||||
|
|
||||||
List displayCatList = app.cacheData.findCategory();
|
List displayCatList = app.cacheData.findCategory();
|
||||||
|
boolean catListEmpty = displayCatList.isEmpty();
|
||||||
|
|
||||||
//if no categories found in cache, call MW API to match image coords with nearby Commons categories
|
//if no categories found in cache, call MW API to match image coords with nearby Commons categories
|
||||||
if (displayCatList.size() == 0) {
|
if (catListEmpty) {
|
||||||
cacheFound = false;
|
cacheFound = false;
|
||||||
apiCall.request(decimalCoords);
|
apiCall.request(decimalCoords);
|
||||||
Log.d(TAG, "displayCatList size 0, calling MWAPI" + displayCatList.toString());
|
Log.d(TAG, "displayCatList size 0, calling MWAPI" + displayCatList.toString());
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue