Merge pull request #7108 from osmandapp/issue_6933

fix for #6933 - Routing details: "Walk {time}" string inverted in the…
This commit is contained in:
vshcherb 2019-06-26 16:45:56 +02:00 committed by GitHub
commit f4914cba3c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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() {