From dc664c131edc5748b4fb6737f11a50bb387fa2b7 Mon Sep 17 00:00:00 2001 From: PavelRatushny Date: Tue, 3 Oct 2017 12:45:49 +0300 Subject: [PATCH] Show title in all builders --- .../plus/mapcontextmenu/builders/AmenityMenuBuilder.java | 8 ++++++++ .../plus/mapcontextmenu/builders/GpxItemMenuBuilder.java | 8 ++++++++ .../plus/mapcontextmenu/builders/WptPtMenuBuilder.java | 8 ++++++++ .../src/net/osmand/plus/osmedit/EditPOIMenuBuilder.java | 8 ++++++++ 4 files changed, 32 insertions(+) diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/AmenityMenuBuilder.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/AmenityMenuBuilder.java index 632fc71213..7e709cd00d 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/AmenityMenuBuilder.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/AmenityMenuBuilder.java @@ -56,6 +56,14 @@ public class AmenityMenuBuilder extends MenuBuilder { protected void buildNearestWikiRow(View view) { } + @Override + protected void buildTitleRow(View view) { + String title = mapActivity.getContextMenu().getTitleStr(); + if (title.length() > 60) { + buildRow(view, R.drawable.ic_action_note_dark, title, 0, false, null, false, 0, false, null); + } + } + private void buildRow(View view, int iconId, String text, String textPrefix, boolean collapsable, final CollapsableView collapsableView, int textColor, boolean isWiki, boolean isText, boolean needLinks, diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/GpxItemMenuBuilder.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/GpxItemMenuBuilder.java index 3e60a8952d..4a74f89e2c 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/GpxItemMenuBuilder.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/GpxItemMenuBuilder.java @@ -38,6 +38,14 @@ public class GpxItemMenuBuilder extends MenuBuilder { } } + @Override + protected void buildTitleRow(View view) { + String title = mapActivity.getContextMenu().getTitleStr(); + if (title.length() > 60) { + buildRow(view, R.drawable.ic_action_note_dark, title, 0, false, null, false, 0, false, null); + } + } + @Override public boolean hasCustomAddressLine() { return true; diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/WptPtMenuBuilder.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/WptPtMenuBuilder.java index 2bd01a0222..494a5428ba 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/WptPtMenuBuilder.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/WptPtMenuBuilder.java @@ -29,6 +29,14 @@ public class WptPtMenuBuilder extends MenuBuilder { return false; } + @Override + protected void buildTitleRow(View view) { + String title = mapActivity.getContextMenu().getTitleStr(); + if (title.length() > 60) { + buildRow(view, R.drawable.ic_action_note_dark, title, 0, false, null, false, 0, false, null); + } + } + @Override public void buildInternal(View view) { if (wpt.time > 0) { diff --git a/OsmAnd/src/net/osmand/plus/osmedit/EditPOIMenuBuilder.java b/OsmAnd/src/net/osmand/plus/osmedit/EditPOIMenuBuilder.java index 595fe592aa..52c3144f2b 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/EditPOIMenuBuilder.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/EditPOIMenuBuilder.java @@ -25,6 +25,14 @@ public class EditPOIMenuBuilder extends MenuBuilder { return false; } + @Override + protected void buildTitleRow(View view) { + String title = mapActivity.getContextMenu().getTitleStr(); + if (title.length() > 60) { + buildRow(view, R.drawable.ic_action_note_dark, title, 0, false, null, false, 0, false, null); + } + } + @Override public void buildInternal(View view) { if (osmPoint instanceof OsmNotesPoint) {