From 3131818e0c2bc1aeff28240656a19672e87b4db1 Mon Sep 17 00:00:00 2001 From: Chumva Date: Wed, 16 May 2018 18:47:22 +0300 Subject: [PATCH] cleaned replaceIconsInString --- OsmAnd/src/net/osmand/AndroidUtils.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/OsmAnd/src/net/osmand/AndroidUtils.java b/OsmAnd/src/net/osmand/AndroidUtils.java index 11e3463a4d..678ae4c098 100644 --- a/OsmAnd/src/net/osmand/AndroidUtils.java +++ b/OsmAnd/src/net/osmand/AndroidUtils.java @@ -116,19 +116,16 @@ public class AndroidUtils { Matcher matcher = Pattern.compile(entry).matcher(spannable); while (matcher.find()) { boolean set = true; - for (ImageSpan span : spannable.getSpans(matcher.start(), - matcher.end(), ImageSpan.class)) + for (ImageSpan span : spannable.getSpans(matcher.start(), matcher.end(), ImageSpan.class)) if (spannable.getSpanStart(span) >= matcher.start() - && spannable.getSpanEnd(span) <= matcher.end()) + && spannable.getSpanEnd(span) <= matcher.end()) { spannable.removeSpan(span); - else { + } else { set = false; break; } if (set) { - spannable.setSpan(new ImageSpan(arrow), - matcher.start(), matcher.end(), - Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); + spannable.setSpan(new ImageSpan(arrow), matcher.start(), matcher.end(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); } } }