aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/cgeocaches.java
diff options
context:
space:
mode:
authorBananeweizen <bananeweizen@gmx.de>2013-07-06 11:33:40 +0200
committerBananeweizen <bananeweizen@gmx.de>2013-07-06 11:33:40 +0200
commit06e089bd300a3967f1c50d6509bdc8a0b792bdad (patch)
tree425601382f3b98ce6d2c2ab8f71bc70a36c1544c /main/src/cgeo/geocaching/cgeocaches.java
parente640735cb24b4fe153a052d6d976efc7cf3d6c84 (diff)
downloadcgeo-06e089bd300a3967f1c50d6509bdc8a0b792bdad.zip
cgeo-06e089bd300a3967f1c50d6509bdc8a0b792bdad.tar.gz
cgeo-06e089bd300a3967f1c50d6509bdc8a0b792bdad.tar.bz2
fix #2954: sorting wrong after switching between event list and normal
list
Diffstat (limited to 'main/src/cgeo/geocaching/cgeocaches.java')
-rw-r--r--main/src/cgeo/geocaching/cgeocaches.java36
1 files changed, 4 insertions, 32 deletions
diff --git a/main/src/cgeo/geocaching/cgeocaches.java b/main/src/cgeo/geocaching/cgeocaches.java
index 431d718..58e280a 100644
--- a/main/src/cgeo/geocaching/cgeocaches.java
+++ b/main/src/cgeo/geocaching/cgeocaches.java
@@ -33,8 +33,6 @@ import cgeo.geocaching.network.Network;
import cgeo.geocaching.network.Parameters;
import cgeo.geocaching.sorting.CacheComparator;
import cgeo.geocaching.sorting.ComparatorUserInterface;
-import cgeo.geocaching.sorting.EventDateComparator;
-import cgeo.geocaching.sorting.VisitComparator;
import cgeo.geocaching.ui.CacheListAdapter;
import cgeo.geocaching.ui.LoggingUI;
import cgeo.geocaching.ui.WeakReferenceHandler;
@@ -166,14 +164,13 @@ public class cgeocaches extends AbstractListActivity implements FilteredActivity
*/
private MenuItem navigationMenu;
+ // FIXME: This method has mostly been replaced by the loaders. But it still contains a license agreement check.
public void handleCachesLoaded() {
try {
setAdapter();
updateTitle();
- setDateComparatorForEventList();
-
showFooterMoreCaches();
if (search != null && search.getError() == StatusCode.UNAPPROVED_LICENSE) {
@@ -1625,32 +1622,6 @@ public class cgeocaches extends AbstractListActivity implements FilteredActivity
}
}
- /**
- * set date comparator for pure event lists
- *
- * TODO: move this method into the adapter
- */
- private void setDateComparatorForEventList() {
- if (CollectionUtils.isNotEmpty(cacheList)) {
- boolean eventsOnly = true;
- for (final Geocache cache : cacheList) {
- if (!cache.isEventCache()) {
- eventsOnly = false;
- break;
- }
- }
- if (eventsOnly) {
- adapter.setComparator(new EventDateComparator());
- }
- else if (type == CacheListType.HISTORY) {
- adapter.setComparator(new VisitComparator());
- }
- else if (adapter.getCacheComparator() != null && adapter.getCacheComparator() instanceof EventDateComparator) {
- adapter.setComparator(null);
- }
- }
- }
-
public static void startActivityNearest(final AbstractActivity context, final Geopoint coordsNow) {
if (!isValidCoords(context, coordsNow)) {
return;
@@ -1778,7 +1749,7 @@ public class cgeocaches extends AbstractListActivity implements FilteredActivity
loader = new OwnerGeocacheListLoader(app, ownerName);
break;
case MAP:
- //TODO Build Nullloader
+ //TODO Build Null loader
title = res.getString(R.string.map_map);
search = (SearchResult) extras.get(Intents.EXTRA_SEARCH);
replaceCacheListFromSearch();
@@ -1812,6 +1783,7 @@ public class cgeocaches extends AbstractListActivity implements FilteredActivity
cacheList.addAll(cachesFromSearchResult);
search = searchIn;
adapter.reFilter();
+ adapter.setInitialComparator();
adapter.forceSort();
adapter.notifyDataSetChanged();
updateTitle();
@@ -1823,7 +1795,7 @@ public class cgeocaches extends AbstractListActivity implements FilteredActivity
@Override
public void onLoaderReset(Loader<SearchResult> arg0) {
- //Not interessting
+ //Not interesting
}
}