mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 12:53:55 +01:00
Refactored recent + gps cat block
This commit is contained in:
parent
89ed9eb70a
commit
0c29a875dd
1 changed files with 35 additions and 31 deletions
|
|
@ -256,10 +256,7 @@ public class CategorizationFragment extends SherlockFragment{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
private ArrayList<String> recentCatQuery() {
|
||||||
protected ArrayList<String> doInBackground(Void... voids) {
|
|
||||||
//If user hasn't typed anything in yet, get GPS and recent items
|
|
||||||
if(TextUtils.isEmpty(filter)) {
|
|
||||||
ArrayList<String> items = new ArrayList<String>();
|
ArrayList<String> items = new ArrayList<String>();
|
||||||
ArrayList<String> mergedItems= new ArrayList<String>();
|
ArrayList<String> mergedItems= new ArrayList<String>();
|
||||||
|
|
||||||
|
|
@ -293,6 +290,13 @@ public class CategorizationFragment extends SherlockFragment{
|
||||||
return mergedItems;
|
return mergedItems;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected ArrayList<String> doInBackground(Void... voids) {
|
||||||
|
//If user hasn't typed anything in yet, get GPS and recent items
|
||||||
|
if(TextUtils.isEmpty(filter)) {
|
||||||
|
return recentCatQuery();
|
||||||
|
}
|
||||||
|
|
||||||
//if user types in something that is in cache, return cached category
|
//if user types in something that is in cache, return cached category
|
||||||
if(categoriesCache.containsKey(filter)) {
|
if(categoriesCache.containsKey(filter)) {
|
||||||
return categoriesCache.get(filter);
|
return categoriesCache.get(filter);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue