Tidied up comments in prep for 2nd attempt

This commit is contained in:
misaochan 2016-01-24 15:20:24 +13:00
parent c638a211d5
commit 7d2fa800c4

View file

@ -38,14 +38,17 @@ public class MethodAUpdater extends AsyncTask<Void, Void, ArrayList<String>> {
@Override @Override
protected ArrayList<String> doInBackground(Void... voids) { protected ArrayList<String> doInBackground(Void... voids) {
//If user hasn't typed anything in yet, get GPS and recent items
if(TextUtils.isEmpty(filter)) { if(TextUtils.isEmpty(filter)) {
return catFragment.recentCatQuery(); return catFragment.recentCatQuery();
} }
//if user types in something that is in cache, return cached category
if(catFragment.categoriesCache.containsKey(filter)) { if(catFragment.categoriesCache.containsKey(filter)) {
return catFragment.categoriesCache.get(filter); return catFragment.categoriesCache.get(filter);
} }
//otherwise if user has typed something in that isn't in cache, search API for matching categories
MWApi api = CommonsApplication.createMWApi(); MWApi api = CommonsApplication.createMWApi();
ApiResult result; ApiResult result;
ArrayList<String> categories = new ArrayList<String>(); ArrayList<String> categories = new ArrayList<String>();