Fix #7612
This commit is contained in:
parent
eeb814a83c
commit
898950e1d5
2 changed files with 10 additions and 5 deletions
|
@ -11,6 +11,8 @@
|
|||
Thx - Hardy
|
||||
|
||||
-->
|
||||
<string name="swap_two_places">Swap %1$s and %2$s</string>
|
||||
<string name="route_start_point">Starting point</string>
|
||||
<string name="layer_osm_edits">OSM Edits</string>
|
||||
<string name="quick_action_contour_lines_descr">Tapping this action button shows or hides contour lines on the map</string>
|
||||
<string name="quick_action_contour_lines_show">Show contour lines</string>
|
||||
|
|
|
@ -319,13 +319,16 @@ public class AddPointBottomSheetDialog extends MenuBottomSheetDialogFragment {
|
|||
final View switchStartAndEndView = View.inflate(new ContextThemeWrapper(getContext(), themeRes), R.layout.bottom_sheet_item_simple_56dp, null);
|
||||
TextView title = (TextView) switchStartAndEndView.findViewById(R.id.title);
|
||||
|
||||
String titleS = getString(R.string.swap_start_and_destination);
|
||||
String start = getString(R.string.route_start_point).toLowerCase();
|
||||
String destination = getString(R.string.route_descr_destination).toLowerCase();
|
||||
String titleS = getString(R.string.swap_two_places, start, destination);
|
||||
SpannableString titleSpan = new SpannableString(titleS);
|
||||
int firstIndex = titleS.indexOf(" ");
|
||||
if (firstIndex != -1) {
|
||||
int startIndex = titleS.indexOf(start);
|
||||
int destinationIndex = titleS.indexOf(destination);
|
||||
if (startIndex != -1 && destinationIndex != -1) {
|
||||
Typeface typeface = FontCache.getRobotoMedium(getContext());
|
||||
titleSpan.setSpan(new CustomTypefaceSpan(typeface), firstIndex, titleS.indexOf(" ", firstIndex + 1), 0);
|
||||
titleSpan.setSpan(new CustomTypefaceSpan(typeface), titleS.lastIndexOf(" "), titleS.length(), 0);
|
||||
titleSpan.setSpan(new CustomTypefaceSpan(typeface), startIndex, startIndex + start.length(), 0);
|
||||
titleSpan.setSpan(new CustomTypefaceSpan(typeface), destinationIndex, destinationIndex + destination.length(), 0);
|
||||
}
|
||||
title.setText(titleSpan);
|
||||
|
||||
|
|
Loading…
Reference in a new issue