diff options
| author | KiwiStone <Kiwi.Stone@web.de> | 2013-11-15 01:02:30 +0100 |
|---|---|---|
| committer | rsudev <rasch@munin-soft.de> | 2013-11-25 23:35:39 +0100 |
| commit | dceae79fd9bc1b4f12a5e35390d5be5c209201b7 (patch) | |
| tree | 6d30528be048e4da1ca65702a378236c56c66609 | |
| parent | 652722134c0d18dbe77dd952903a71ae14755d27 (diff) | |
| download | cgeo-dceae79fd9bc1b4f12a5e35390d5be5c209201b7.zip cgeo-dceae79fd9bc1b4f12a5e35390d5be5c209201b7.tar.gz cgeo-dceae79fd9bc1b4f12a5e35390d5be5c209201b7.tar.bz2 | |
fixes #3348 - Direction to cache still displayed in lists although
deselected
| -rw-r--r-- | main/src/cgeo/geocaching/ui/CacheListAdapter.java | 46 |
1 files changed, 27 insertions, 19 deletions
diff --git a/main/src/cgeo/geocaching/ui/CacheListAdapter.java b/main/src/cgeo/geocaching/ui/CacheListAdapter.java index 9646c6a..e7752d6 100644 --- a/main/src/cgeo/geocaching/ui/CacheListAdapter.java +++ b/main/src/cgeo/geocaching/ui/CacheListAdapter.java @@ -61,6 +61,7 @@ public class CacheListAdapter extends ArrayAdapter<Geocache> { private boolean selectMode = false; private IFilter currentFilter = null; private List<Geocache> originalList = null; + private boolean isLiveList = Settings.isLiveList(); final private Set<CompassMiniView> compasses = new LinkedHashSet<CompassMiniView>(); final private Set<DistanceView> distances = new LinkedHashSet<DistanceView>(); @@ -428,26 +429,33 @@ public class CacheListAdapter extends ArrayAdapter<Geocache> { if (cache.getDistance() != null) { holder.distance.setDistance(cache.getDistance()); } - if (cache.getCoords() != null) { - holder.direction.setVisibility(View.VISIBLE); - holder.dirImg.setVisibility(View.GONE); - holder.direction.updateAzimuth(azimuth); - if (coords != null) { - holder.distance.update(coords); - holder.direction.updateCurrentCoords(coords); + + if (cache.getCoords() != null && coords != null) { + holder.distance.update(coords); + } + + // only show the direction if this is enabled in the settings + if (isLiveList) { + if (cache.getCoords() != null) { + holder.direction.setVisibility(View.VISIBLE); + holder.dirImg.setVisibility(View.GONE); + holder.direction.updateAzimuth(azimuth); + if (coords != null) { + holder.direction.updateCurrentCoords(coords); + } + } else if (cache.getDirection() != null) { + holder.direction.setVisibility(View.VISIBLE); + holder.dirImg.setVisibility(View.GONE); + holder.direction.updateAzimuth(azimuth); + holder.direction.updateHeading(cache.getDirection()); + } else if (StringUtils.isNotBlank(cache.getDirectionImg())) { + holder.dirImg.setImageDrawable(DirectionImage.getDrawable(cache.getDirectionImg())); + holder.dirImg.setVisibility(View.VISIBLE); + holder.direction.setVisibility(View.GONE); + } else { + holder.dirImg.setVisibility(View.GONE); + holder.direction.setVisibility(View.GONE); } - } else if (cache.getDirection() != null) { - holder.direction.setVisibility(View.VISIBLE); - holder.dirImg.setVisibility(View.GONE); - holder.direction.updateAzimuth(azimuth); - holder.direction.updateHeading(cache.getDirection()); - } else if (StringUtils.isNotBlank(cache.getDirectionImg())) { - holder.dirImg.setImageDrawable(DirectionImage.getDrawable(cache.getDirectionImg())); - holder.dirImg.setVisibility(View.VISIBLE); - holder.direction.setVisibility(View.GONE); - } else { - holder.dirImg.setVisibility(View.GONE); - holder.direction.setVisibility(View.GONE); } holder.favorite.setText(Integer.toString(cache.getFavoritePoints())); |
