aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/ui/CacheListAdapter.java
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/cgeo/geocaching/ui/CacheListAdapter.java')
-rw-r--r--main/src/cgeo/geocaching/ui/CacheListAdapter.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/main/src/cgeo/geocaching/ui/CacheListAdapter.java b/main/src/cgeo/geocaching/ui/CacheListAdapter.java
index ebbe23f..d9daa1d 100644
--- a/main/src/cgeo/geocaching/ui/CacheListAdapter.java
+++ b/main/src/cgeo/geocaching/ui/CacheListAdapter.java
@@ -18,7 +18,7 @@ import cgeo.geocaching.sorting.EventDateComparator;
import cgeo.geocaching.sorting.InverseComparator;
import cgeo.geocaching.sorting.VisitComparator;
import cgeo.geocaching.utils.AngleUtils;
-import cgeo.geocaching.utils.DateUtils;
+import cgeo.geocaching.utils.CalendarUtils;
import cgeo.geocaching.utils.Formatter;
import cgeo.geocaching.utils.Log;
@@ -112,7 +112,7 @@ public class CacheListAdapter extends ArrayAdapter<Geocache> {
@InjectView(R.id.distance) protected DistanceView distance;
@InjectView(R.id.favorite) protected TextView favorite;
@InjectView(R.id.info) protected TextView info;
- @InjectView(R.id.inventory) protected ImageView inventory;
+ @InjectView(R.id.inventory) protected TextView inventory;
@InjectView(R.id.direction) protected CompassMiniView direction;
@InjectView(R.id.dirimg) protected ImageView dirImg;
public Geocache cache = null;
@@ -160,7 +160,6 @@ public class CacheListAdapter extends ArrayAdapter<Geocache> {
/**
* change the sort order
*
- * @param comparator
*/
public void setComparator(final CacheComparator comparator) {
cacheComparator = comparator;
@@ -415,7 +414,7 @@ public class CacheListAdapter extends ArrayAdapter<Geocache> {
}
Spannable spannable = null;
- if (cache.isDisabled() || cache.isArchived() || DateUtils.isPastEvent(cache)) { // strike
+ if (cache.isDisabled() || cache.isArchived() || CalendarUtils.isPastEvent(cache)) { // strike
spannable = Spannable.Factory.getInstance().newSpannable(cache.getName());
spannable.setSpan(new StrikethroughSpan(), 0, spannable.toString().length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
}
@@ -434,7 +433,9 @@ public class CacheListAdapter extends ArrayAdapter<Geocache> {
}
holder.text.setCompoundDrawablesWithIntrinsicBounds(getCacheIcon(cache), null, null, null);
- if (cache.getInventoryItems() > 0) {
+ final int inventorySize = cache.getInventoryItems();
+ if (inventorySize > 0) {
+ holder.inventory.setText(Integer.toString(inventorySize));
holder.inventory.setVisibility(View.VISIBLE);
} else {
holder.inventory.setVisibility(View.GONE);