Merge pull request #8531 from osmandapp/small_fixes

Fix IndexOutOfBoundsException
This commit is contained in:
max-klaus 2020-02-21 17:52:12 +03:00 committed by GitHub
commit 4d71d9b94f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View file

@ -3440,7 +3440,7 @@ Rappresenta l\'area: %1$s x %2$s</string>
<string name="login_and_pass">Nome utente e password</string>
<string name="plugin_global_prefs_info">Queste impostazioni del plugin sono globali e si applicano a tutti i profili.</string>
<string name="osm_editing">Modifica di OpenStreetMap</string>
<string name="osm_edits_view_descr">È possibile visualizzare tutte le modifiche non caricate o le note OSM in Menu - I miei luoghi - Modifiche OSM. I punti caricati non vengono visualizzati in OsmAnd.</string>
<string name="osm_edits_view_descr">È possibile visualizzare tutte le modifiche non caricate o le note OSM in %1$s. I punti caricati non vengono visualizzati in OsmAnd.</string>
<string name="app_mode_osm">OSM</string>
<string name="select_nav_icon_descr">L\'icona viene visualizzata solo durante la navigazione o in movimento.</string>
<string name="logcat_buffer_descr">Controlla e condividi i log dettagliati dell\'applicazione</string>

View file

@ -86,8 +86,10 @@ public class OsmEditingFragment extends BaseSettingsFragment implements OnPrefer
int startIndex = osmEditsPathDescr.indexOf(osmEditsPath);
SpannableString titleSpan = new SpannableString(osmEditsPathDescr);
Typeface typeface = FontCache.getRobotoMedium(getContext());
titleSpan.setSpan(new CustomTypefaceSpan(typeface), startIndex, startIndex + osmEditsPath.length(), 0);
if (startIndex != -1) {
Typeface typeface = FontCache.getRobotoMedium(getContext());
titleSpan.setSpan(new CustomTypefaceSpan(typeface), startIndex, startIndex + osmEditsPath.length(), 0);
}
Preference osmEditsDescription = findPreference("osm_edits_description");
osmEditsDescription.setTitle(titleSpan);