From 2ce258172e1368a751ea27b11e3582ad4a72261c Mon Sep 17 00:00:00 2001 From: Bananeweizen Date: Wed, 24 Apr 2013 09:27:19 +0200 Subject: #2675: remove superfluous separator * non offline caches had a trailing separator --- main/src/cgeo/geocaching/ui/Formatter.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'main') diff --git a/main/src/cgeo/geocaching/ui/Formatter.java b/main/src/cgeo/geocaching/ui/Formatter.java index 412b993..92a0defc 100644 --- a/main/src/cgeo/geocaching/ui/Formatter.java +++ b/main/src/cgeo/geocaching/ui/Formatter.java @@ -115,7 +115,7 @@ public abstract class Formatter { infos.add(cache.getGeocode()); } - infos.add(Formatter.formatCacheInfoShort(cache)); + addShortInfos(cache, infos); if (cache.isPremiumMembersOnly()) { infos.add(cgeoapplication.getInstance().getString(R.string.cache_premium)); @@ -128,6 +128,11 @@ public abstract class Formatter { public static String formatCacheInfoShort(Geocache cache) { final ArrayList infos = new ArrayList(); + addShortInfos(cache, infos); + return StringUtils.join(infos, Formatter.SEPARATOR); + } + + private static void addShortInfos(Geocache cache, final ArrayList infos) { if (cache.hasDifficulty()) { infos.add("D " + String.format("%.1f", cache.getDifficulty())); } @@ -141,7 +146,6 @@ public abstract class Formatter { } else if (cache.isEventCache() && cache.getHiddenDate() != null) { infos.add(Formatter.formatShortDate(cache.getHiddenDate().getTime())); } - return StringUtils.join(infos, Formatter.SEPARATOR); } public static String formatCacheInfoHistory(Geocache cache) { -- cgit v1.1