aboutsummaryrefslogtreecommitdiffstats
path: root/src/cgeo/geocaching/cgeocaches.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/cgeo/geocaching/cgeocaches.java')
-rw-r--r--src/cgeo/geocaching/cgeocaches.java49
1 files changed, 25 insertions, 24 deletions
diff --git a/src/cgeo/geocaching/cgeocaches.java b/src/cgeo/geocaching/cgeocaches.java
index b2b1870..19a55cb 100644
--- a/src/cgeo/geocaching/cgeocaches.java
+++ b/src/cgeo/geocaching/cgeocaches.java
@@ -13,6 +13,7 @@ import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
+import java.util.Map;
import org.apache.commons.lang3.StringUtils;
@@ -143,7 +144,7 @@ public class cgeocaches extends AbstractListActivity {
private String address = null;
private String username = null;
private Long searchId = null;
- private ArrayList<cgCache> cacheList = new ArrayList<cgCache>();
+ private List<cgCache> cacheList = new ArrayList<cgCache>();
private cgCacheListAdapter adapter = null;
private LayoutInflater inflater = null;
private View listFooter = null;
@@ -164,7 +165,7 @@ public class cgeocaches extends AbstractListActivity {
private geocachesExportFieldNotes threadF = null;
private geocachesRemoveFromHistory threadH = null;
private int listId = 0;
- private ArrayList<cgList> lists = null;
+ private List<cgList> lists = null;
private String selectedFilter = null;
private GeocodeComparator gcComparator = new GeocodeComparator();
private Handler loadCachesHandler = new Handler() {
@@ -176,7 +177,7 @@ public class cgeocaches extends AbstractListActivity {
setTitle(title + " [" + app.getCount(searchId) + "]");
cacheList.clear();
- final ArrayList<cgCache> cacheListTmp = app.getCaches(searchId);
+ final List<cgCache> cacheListTmp = app.getCaches(searchId);
if (CollectionUtils.isNotEmpty(cacheListTmp)) {
cacheList.addAll(cacheListTmp);
cacheListTmp.clear();
@@ -274,7 +275,7 @@ public class cgeocaches extends AbstractListActivity {
setTitle(title + " [" + app.getCount(searchId) + "]");
cacheList.clear();
- final ArrayList<cgCache> cacheListTmp = app.getCaches(searchId);
+ final List<cgCache> cacheListTmp = app.getCaches(searchId);
if (CollectionUtils.isNotEmpty(cacheListTmp)) {
cacheList.addAll(cacheListTmp);
cacheListTmp.clear();
@@ -363,7 +364,7 @@ public class cgeocaches extends AbstractListActivity {
}
} else {
if (cacheList != null && searchId != null) {
- final ArrayList<cgCache> cacheListTmp = app.getCaches(searchId);
+ final List<cgCache> cacheListTmp = app.getCaches(searchId);
if (CollectionUtils.isNotEmpty(cacheListTmp)) {
cacheList.clear();
cacheList.addAll(cacheListTmp);
@@ -424,7 +425,7 @@ public class cgeocaches extends AbstractListActivity {
cacheList.clear();
- final ArrayList<cgCache> cacheListTmp = app.getCaches(searchId);
+ final List<cgCache> cacheListTmp = app.getCaches(searchId);
if (CollectionUtils.isNotEmpty(cacheListTmp)) {
cacheList.addAll(cacheListTmp);
cacheListTmp.clear();
@@ -452,7 +453,7 @@ public class cgeocaches extends AbstractListActivity {
cacheList.clear();
- final ArrayList<cgCache> cacheListTmp = app.getCaches(searchId);
+ final List<cgCache> cacheListTmp = app.getCaches(searchId);
if (CollectionUtils.isNotEmpty(cacheListTmp)) {
cacheList.addAll(cacheListTmp);
cacheListTmp.clear();
@@ -744,7 +745,7 @@ public class cgeocaches extends AbstractListActivity {
subMenuSort.setHeaderTitle(res.getString(R.string.caches_sort_title));
// sort the context menu labels alphabetically for easier reading
- HashMap<String, Integer> comparators = new HashMap<String, Integer>();
+ Map<String, Integer> comparators = new HashMap<String, Integer>();
comparators.put(res.getString(R.string.caches_sort_distance), MENU_SORT_DISTANCE);
comparators.put(res.getString(R.string.caches_sort_difficulty), MENU_SORT_DIFFICULTY);
comparators.put(res.getString(R.string.caches_sort_terrain), MENU_SORT_TERRAIN);
@@ -759,7 +760,7 @@ public class cgeocaches extends AbstractListActivity {
comparators.put(res.getString(R.string.caches_sort_finds), MENU_SORT_FINDS);
comparators.put(res.getString(R.string.caches_sort_state), MENU_SORT_STATE);
- ArrayList<String> sortedLabels = new ArrayList<String>(comparators.keySet());
+ List<String> sortedLabels = new ArrayList<String>(comparators.keySet());
Collections.sort(sortedLabels);
for (String label : sortedLabels) {
Integer id = comparators.get(label);
@@ -1108,7 +1109,7 @@ public class cgeocaches extends AbstractListActivity {
}
if (cache.reason >= 1) {
menu.add(0, MENU_DROP_CACHE, 0, res.getString(R.string.cache_offline_drop));
- ArrayList<cgList> cacheLists = app.getLists();
+ List<cgList> cacheLists = app.getLists();
int listCount = cacheLists.size();
if (listCount > 1) {
SubMenu submenu = menu.addSubMenu(0, MENU_MOVE_TO_LIST, 0, res.getString(R.string.cache_menu_move_list));
@@ -1122,7 +1123,7 @@ public class cgeocaches extends AbstractListActivity {
}
private void createFakeContextMenuMoveToList(ContextMenu menu) {
- ArrayList<cgList> cacheLists = app.getLists();
+ List<cgList> cacheLists = app.getLists();
int listCount = cacheLists.size();
menu.setHeaderTitle(res.getString(R.string.cache_menu_move_list));
for (int i = 0; i < listCount; i++) {
@@ -1251,7 +1252,7 @@ public class cgeocaches extends AbstractListActivity {
} else if (id >= MENU_MOVE_SELECTED_OR_ALL_TO_LIST && id < MENU_MOVE_SELECTED_OR_ALL_TO_LIST + 100) {
int newListId = id - MENU_MOVE_SELECTED_OR_ALL_TO_LIST;
boolean moveAll = adapter.getChecked() == 0;
- final ArrayList<cgCache> cacheListTemp = new ArrayList<cgCache>(cacheList);
+ final List<cgCache> cacheListTemp = new ArrayList<cgCache>(cacheList);
for (cgCache c : cacheListTemp) {
if (moveAll || c.statusChecked) {
app.moveToList(c.geocode, newListId);
@@ -1270,7 +1271,7 @@ public class cgeocaches extends AbstractListActivity {
if (cache != null) {
// create a searchId for a single cache (as if in details view)
- HashMap<String, String> params = new HashMap<String, String>();
+ Map<String, String> params = new HashMap<String, String>();
params.put("geocode", cache.geocode);
Long singleSearchId = base.searchByGeocode(params, 0, false);
@@ -1754,7 +1755,7 @@ public class cgeocaches extends AbstractListActivity {
@Override
public void run() {
- HashMap<String, Object> params = new HashMap<String, Object>();
+ Map<String, Object> params = new HashMap<String, Object>();
if (latitude != null && longitude != null) {
params.put("latitude", latitude);
params.put("longitude", longitude);
@@ -1778,7 +1779,7 @@ public class cgeocaches extends AbstractListActivity {
@Override
public void run() {
- HashMap<String, Object> params = new HashMap<String, Object>();
+ Map<String, Object> params = new HashMap<String, Object>();
if (latitude != null && longitude != null) {
params.put("cachetype", settings.cacheType);
}
@@ -1830,7 +1831,7 @@ public class cgeocaches extends AbstractListActivity {
@Override
public void run() {
- HashMap<String, String> params = new HashMap<String, String>();
+ Map<String, String> params = new HashMap<String, String>();
params.put("latitude", String.format((Locale) null, "%.6f", latitude));
params.put("longitude", String.format((Locale) null, "%.6f", longitude));
params.put("cachetype", cachetype);
@@ -1864,7 +1865,7 @@ public class cgeocaches extends AbstractListActivity {
@Override
public void run() {
- HashMap<String, String> params = new HashMap<String, String>();
+ Map<String, String> params = new HashMap<String, String>();
params.put("keyword", keyword);
params.put("cachetype", cachetype);
@@ -1897,7 +1898,7 @@ public class cgeocaches extends AbstractListActivity {
@Override
public void run() {
- HashMap<String, String> params = new HashMap<String, String>();
+ Map<String, String> params = new HashMap<String, String>();
params.put("username", username);
params.put("cachetype", cachetype);
@@ -1930,7 +1931,7 @@ public class cgeocaches extends AbstractListActivity {
@Override
public void run() {
- HashMap<String, String> params = new HashMap<String, String>();
+ Map<String, String> params = new HashMap<String, String>();
params.put("username", username);
params.put("cachetype", cachetype);
@@ -1972,7 +1973,7 @@ public class cgeocaches extends AbstractListActivity {
geo = app.removeGeo();
}
- final ArrayList<cgCache> cacheListTemp = new ArrayList<cgCache>(cacheList);
+ final List<cgCache> cacheListTemp = new ArrayList<cgCache>(cacheList);
for (cgCache cache : cacheListTemp) {
if (checked > 0 && cache.statusChecked == false) {
handler.sendEmptyMessage(0);
@@ -2146,7 +2147,7 @@ public class cgeocaches extends AbstractListActivity {
geo = app.removeGeo();
}
- final ArrayList<cgCache> cacheListTemp = new ArrayList<cgCache>(cacheList);
+ final List<cgCache> cacheListTemp = new ArrayList<cgCache>(cacheList);
for (cgCache cache : cacheListTemp) {
if (checked > 0 && cache.statusChecked == false) {
continue;
@@ -2251,7 +2252,7 @@ public class cgeocaches extends AbstractListActivity {
// We need our own HashMap because cgBase.LogTypes1 will give us localized and maybe
// different strings than gc.com expects in the field note
// We only need such logtypes that are possible to log via c:geo
- HashMap<Integer, String> logTypes = new HashMap<Integer, String>();
+ Map<Integer, String> logTypes = new HashMap<Integer, String>();
logTypes.put(cgBase.LOG_FOUND_IT, "Found it");
logTypes.put(cgBase.LOG_DIDNT_FIND_IT, "Didn't find it");
logTypes.put(cgBase.LOG_NOTE, "Write Note");
@@ -2374,7 +2375,7 @@ public class cgeocaches extends AbstractListActivity {
return;
}
- final ArrayList<CharSequence> listsTitle = new ArrayList<CharSequence>();
+ final List<CharSequence> listsTitle = new ArrayList<CharSequence>();
for (cgList list : lists) {
listsTitle.add(list.title);
}
@@ -2438,7 +2439,7 @@ public class cgeocaches extends AbstractListActivity {
public void run() {
int checked = adapter.getChecked();
if (checked > 0) {
- final ArrayList<cgCache> cacheListTemp = new ArrayList<cgCache>(cacheList);
+ final List<cgCache> cacheListTemp = new ArrayList<cgCache>(cacheList);
for (cgCache cache : cacheListTemp) {
if (cache.statusChecked) {
app.moveToList(cache.geocode, listId);