Merge pull request #10890 from osmandapp/support_links_in_plain_text
Add support of URLs in plain text inside favourites and waypoints description
This commit is contained in:
commit
81fb35936a
4 changed files with 9 additions and 5 deletions
|
@ -808,7 +808,11 @@ public class MenuBuilder {
|
|||
View.OnClickListener onClickListener = new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (description.contains("</")) {
|
||||
POIMapLayer.showHtmlDescriptionDialog(view.getContext(), app, description, descriptionLabel);
|
||||
} else {
|
||||
POIMapLayer.showPlainDescriptionDialog(view.getContext(), app, description, descriptionLabel);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -302,7 +302,7 @@ public class AmenityMenuBuilder extends MenuBuilder {
|
|||
ll.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
POIMapLayer.showDescriptionDialog(view.getContext(), app, text, textPrefix);
|
||||
POIMapLayer.showPlainDescriptionDialog(view.getContext(), app, text, textPrefix);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ public class WptPtMenuBuilder extends MenuBuilder {
|
|||
View.OnClickListener clickListener = new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
POIMapLayer.showDescriptionDialog(view.getContext(), app, wpt.desc, textPrefix);
|
||||
POIMapLayer.showPlainDescriptionDialog(view.getContext(), app, wpt.desc, textPrefix);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -103,7 +103,7 @@ public class WptPtMenuBuilder extends MenuBuilder {
|
|||
rowc.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
POIMapLayer.showDescriptionDialog(rowc.getContext(), app, wpt.comment,
|
||||
POIMapLayer.showPlainDescriptionDialog(rowc.getContext(), app, wpt.comment,
|
||||
rowc.getResources().getString(R.string.poi_dialog_comment));
|
||||
}
|
||||
});
|
||||
|
|
|
@ -274,7 +274,7 @@ public class POIMapLayer extends OsmandMapLayer implements ContextMenuLayer.ICon
|
|||
return true;
|
||||
}
|
||||
|
||||
public static void showDescriptionDialog(Context ctx, OsmandApplication app, String text, String title) {
|
||||
public static void showPlainDescriptionDialog(Context ctx, OsmandApplication app, String text, String title) {
|
||||
final TextView textView = new TextView(ctx);
|
||||
LinearLayout.LayoutParams llTextParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||
int textMargin = dpToPx(app, 10f);
|
||||
|
|
Loading…
Reference in a new issue