From e212c8a43ef6c0503837794b04f14362217a882f Mon Sep 17 00:00:00 2001 From: Bananeweizen Date: Tue, 17 Feb 2015 19:30:03 +0100 Subject: new: show number of trackables in cache list --- main/res/layout/cacheslist_item.xml | 12 ++++++++++-- main/res/values/changelog_master.xml | 1 + main/src/cgeo/geocaching/ui/CacheListAdapter.java | 6 ++++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/main/res/layout/cacheslist_item.xml b/main/res/layout/cacheslist_item.xml index efb622e..9c5ca28 100644 --- a/main/res/layout/cacheslist_item.xml +++ b/main/res/layout/cacheslist_item.xml @@ -140,15 +140,23 @@ android:layout_marginBottom="1dip" android:layout_marginTop="1dip" > - + android:singleLine="true" + android:text="" + android:textColor="?text_color" + android:textIsSelectable="false" + android:textSize="12sp" + android:textStyle="bold" /> { @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; @@ -433,7 +433,9 @@ public class CacheListAdapter extends ArrayAdapter { } 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); -- cgit v1.1