diff options
author | Bananeweizen <bananeweizen@gmx.de> | 2015-02-17 19:30:03 +0100 |
---|---|---|
committer | Bananeweizen <bananeweizen@gmx.de> | 2015-02-17 19:30:03 +0100 |
commit | e212c8a43ef6c0503837794b04f14362217a882f (patch) | |
tree | 13ca720107af064e6fee933254dfa87de3287969 | |
parent | 0a47150668740f308fb53a0698ce401eb6ed79f1 (diff) | |
download | cgeo-e212c8a43ef6c0503837794b04f14362217a882f.zip cgeo-e212c8a43ef6c0503837794b04f14362217a882f.tar.gz cgeo-e212c8a43ef6c0503837794b04f14362217a882f.tar.bz2 |
new: show number of trackables in cache list
-rw-r--r-- | main/res/layout/cacheslist_item.xml | 12 | ||||
-rw-r--r-- | main/res/values/changelog_master.xml | 1 | ||||
-rw-r--r-- | 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" > - <ImageView + <TextView android:id="@+id/inventory" android:layout_width="35dip" android:layout_height="22dip" android:layout_alignParentTop="true" android:layout_gravity="center_vertical|center_horizontal" android:background="?inventory" + android:drawableLeft="@drawable/trackable_all" + android:drawablePadding="-10sp" + android:gravity="center" android:scaleType="center" - android:src="@drawable/trackable_all" /> + android:singleLine="true" + android:text="" + android:textColor="?text_color" + android:textIsSelectable="false" + android:textSize="12sp" + android:textStyle="bold" /> <TextView android:id="@+id/favorite" diff --git a/main/res/values/changelog_master.xml b/main/res/values/changelog_master.xml index 6937b7d..4b5bf66 100644 --- a/main/res/values/changelog_master.xml +++ b/main/res/values/changelog_master.xml @@ -7,6 +7,7 @@ · New: Show own saved log first in logbook\n · New: Show hint in compass and map action bar\n · New: Sort events of same date by time (if recognized from cache description)\n + · New: Show number of trackables in cache list\n · New: Weekday shown in event lists\n · New: Show rudimentary details for geocaching.com.au swaggies\n · New: Filter for caches with offline logs\n diff --git a/main/src/cgeo/geocaching/ui/CacheListAdapter.java b/main/src/cgeo/geocaching/ui/CacheListAdapter.java index e2daf11..d9daa1d 100644 --- a/main/src/cgeo/geocaching/ui/CacheListAdapter.java +++ b/main/src/cgeo/geocaching/ui/CacheListAdapter.java @@ -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; @@ -433,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); |