fix for #6933 - Routing details: "Walk {time}" string inverted in the 2nd walk

This commit is contained in:
madwasp79 2019-06-26 16:49:11 +03:00
parent 388b3103cd
commit daf851cfbf

View file

@ -797,13 +797,13 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
if (walkTime < 60) { if (walkTime < 60) {
walkTime = 60; walkTime = 60;
} }
SpannableStringBuilder spannable = new SpannableStringBuilder("~"); SpannableStringBuilder spannable = new SpannableStringBuilder(getString(R.string.shared_string_walk)).append(" ");
spannable.setSpan(new ForegroundColorSpan(getSecondaryColor()), 0, spannable.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); spannable.setSpan(new ForegroundColorSpan(getSecondaryColor()), 0, spannable.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
int startIndex = spannable.length(); int startIndex = spannable.length();
spannable.append(OsmAndFormatter.getFormattedDuration(walkTime, app)).append(" "); spannable.append("~").append(OsmAndFormatter.getFormattedDuration(walkTime, app));
spannable.setSpan(new CustomTypefaceSpan(typeface), startIndex, spannable.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); spannable.setSpan(new CustomTypefaceSpan(typeface), startIndex, spannable.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
startIndex = spannable.length(); startIndex = spannable.length();
spannable.append(getString(R.string.shared_string_walk)).append(", ").append(OsmAndFormatter.getFormattedDistance((float) walkDist, app)); spannable.append(", ").append(OsmAndFormatter.getFormattedDistance((float) walkDist, app));
spannable.setSpan(new ForegroundColorSpan(getSecondaryColor()), startIndex, spannable.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); spannable.setSpan(new ForegroundColorSpan(getSecondaryColor()), startIndex, spannable.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
buildWalkRow(infoContainer, spannable, imagesContainer, new OnClickListener() { buildWalkRow(infoContainer, spannable, imagesContainer, new OnClickListener() {