This commit is contained in:
parent
fef2d1c648
commit
c5b197beaf
1 changed files with 7 additions and 7 deletions
|
@ -305,11 +305,7 @@ public class POIMapLayer extends OsmandMapLayer implements ContextMenuLayer.ICon
|
||||||
public static void showWikipediaDialog(Context ctx, OsmandApplication app, Amenity a) {
|
public static void showWikipediaDialog(Context ctx, OsmandApplication app, Amenity a) {
|
||||||
String lang = app.getSettings().MAP_PREFERRED_LOCALE.get();
|
String lang = app.getSettings().MAP_PREFERRED_LOCALE.get();
|
||||||
if (a.getType().isWiki()) {
|
if (a.getType().isWiki()) {
|
||||||
String preferredLang = lang;
|
showWiki(ctx, app, a, lang);
|
||||||
if (Algorithms.isEmpty(preferredLang)) {
|
|
||||||
preferredLang = app.getLanguage();
|
|
||||||
}
|
|
||||||
showWiki(ctx, app, a, preferredLang);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -326,11 +322,15 @@ public class POIMapLayer extends OsmandMapLayer implements ContextMenuLayer.ICon
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void showWiki(final Context ctx, final OsmandApplication app, final Amenity a, final String lang) {
|
private static void showWiki(final Context ctx, final OsmandApplication app, final Amenity a, final String lang) {
|
||||||
|
String preferredLang = lang;
|
||||||
|
if (Algorithms.isEmpty(preferredLang)) {
|
||||||
|
preferredLang = app.getLanguage();
|
||||||
|
}
|
||||||
final Dialog dialog = new Dialog(ctx,
|
final Dialog dialog = new Dialog(ctx,
|
||||||
app.getSettings().isLightContent() ?
|
app.getSettings().isLightContent() ?
|
||||||
R.style.OsmandLightTheme :
|
R.style.OsmandLightTheme :
|
||||||
R.style.OsmandDarkTheme);
|
R.style.OsmandDarkTheme);
|
||||||
final String title = a.getName(lang);
|
final String title = Algorithms.isEmpty(lang) ? a.getName() : a.getName(lang);
|
||||||
LinearLayout ll = new LinearLayout(ctx);
|
LinearLayout ll = new LinearLayout(ctx);
|
||||||
ll.setOrientation(LinearLayout.VERTICAL);
|
ll.setOrientation(LinearLayout.VERTICAL);
|
||||||
|
|
||||||
|
@ -342,7 +342,7 @@ public class POIMapLayer extends OsmandMapLayer implements ContextMenuLayer.ICon
|
||||||
topBar.setBackgroundColor(ctx.getResources().getColor(getResIdFromAttribute(ctx, R.attr.pstsTabBackground)));
|
topBar.setBackgroundColor(ctx.getResources().getColor(getResIdFromAttribute(ctx, R.attr.pstsTabBackground)));
|
||||||
topBar.setTitleTextColor(ctx.getResources().getColor(getResIdFromAttribute(ctx, R.attr.pstsTextColor)));
|
topBar.setTitleTextColor(ctx.getResources().getColor(getResIdFromAttribute(ctx, R.attr.pstsTextColor)));
|
||||||
|
|
||||||
String lng = a.getContentSelected("content", lang, "en");
|
String lng = a.getContentSelected("content", preferredLang, "en");
|
||||||
if (Algorithms.isEmpty(lng)) {
|
if (Algorithms.isEmpty(lng)) {
|
||||||
lng = "en";
|
lng = "en";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue