diff --git a/OsmAnd/res/values-ca/phrases.xml b/OsmAnd/res/values-ca/phrases.xml
index 1c7e0b00c3..819387bc3e 100644
--- a/OsmAnd/res/values-ca/phrases.xml
+++ b/OsmAnd/res/values-ca/phrases.xml
@@ -1409,4 +1409,22 @@
Tipus: excavació a la roca
Tipus: subterrani
Tipus: volta
+ Nectariner
+ Mango
+ Data
+ Café
+ Refugi d\'animals
+ Cobert
+ Descobert
+
+ Prohibit fumar
+ Només es permet fumar a l\'exterior
+ Es permet fumar
+ Es permet fumar a una sala separada
+ Es permet fumar a una sala aïllada
+ Exclusiu per fumadors
+
+ Peatge
+ Sense peatge
+ Peatge de vehicles pesants
diff --git a/OsmAnd/res/values-ca/strings.xml b/OsmAnd/res/values-ca/strings.xml
index 04778aa61e..201d734284 100644
--- a/OsmAnd/res/values-ca/strings.xml
+++ b/OsmAnd/res/values-ca/strings.xml
@@ -32,7 +32,7 @@
La navegació anterior no ha estat finalitzada. Desitgeu continuar-la? (%1$s segons)
Hores
Minuts
-El cotxe es va aparcar a:
+El cotxe es va aparcar a
Usa la brúixola quan no es pugui determinar la direcció
Usa la brúixola
Localització compartida
@@ -2164,7 +2164,7 @@ Per retornar a l\'estil habitual dels mapes d\'OsmAnd, només cal desactivar aqu
Mapes del món
Regions del món
Mes tard
- Obteniu la versió completa
+ Versió completa
Baixades
Activeu el connector de cartes marines
Activeu el connector de corbes de nivell
@@ -2177,4 +2177,11 @@ Per retornar a l\'estil habitual dels mapes d\'OsmAnd, només cal desactivar aqu
Actualitzeu tot (%1$s MB)
Baixades gratuïtes realitzades
Podeu veure quantes baixades gratuïtes heu fet
+Restaura el senyalitzador de primera engegada, mantenint altres paràmetres en l\'estat original
+ Simula engegada inicial
+ geo:
+ Comparteix la posició
+ Envia
+ Hola fragment buit
+ Trieu on voleu desar els fitxers de mapes.
diff --git a/OsmAnd/res/values-da/phrases.xml b/OsmAnd/res/values-da/phrases.xml
index c47371ead2..c1d5dd8d09 100644
--- a/OsmAnd/res/values-da/phrases.xml
+++ b/OsmAnd/res/values-da/phrases.xml
@@ -25,7 +25,7 @@
Babyudstryr
Tasker
Badeværelsesinventar
- Soveværelsesmøbler
+ sengetøjsbutik
Modebutik
Tæpper
Materialist
@@ -2304,7 +2304,7 @@
Historiskperiode: Arkaisk tid
Historiskperiode: Jernalderen
Historiskperiode: Romerske republik (508 f.kr. - 27 f.kr.)
- Historiskperiode: hellenistisk Grækenland
+ Historiskperiode: Hellenistisk Grækenland
Historiskperiode: nye Kongerige (1550-1069 f.kr.)
Historiskperiode: mellemste rige (2055 -1650 f.kr.)
Historiskperiode: prædynastiske Egypten
@@ -2314,7 +2314,7 @@
Historiskperiode: anden mellemliggende periode (1650 – 1550 f.Kr.)
"Historiskperiode: tredje mellemliggende periode (1069 - 664 f.Kr.) "
Historiskperiode: første persiske periode
- Historiskperiode: sene periode (664 -332 f.Kr.)
+ Historiskperiode: sene periode (664 - 332 f.Kr.)
Historiskperiode: anden Persiske periode
Historiskperiode: Alexander den Store
Historiskperiode: ptolemæiske Egypten (305 f.kr. – 30 f.kr.)
@@ -2325,9 +2325,63 @@
Historiskperiode: romersk græsk (146 f.Kr. – 330 e.Kr)
Historiskperiode: det romerske Kongerige (753 f.Kr. – 509 f.Kr.)
Historiskperiode: Dominatet (285 e.Kr. – 476 e.Kr)
- Historiskperiode: landsbybeboer (epoke I, II, 1580 f.Kr. - 133 e.Kr.)
- Historiskperiode: urban (epoke III, 133 e.Kr. - 374 e.Kr.)
+ Historiskperiode: landsbyboere (epoke I, II, 1580 f.Kr. - 133 e.Kr.)
+ Historiskperiode: bymæssig (epoke III, 133 e.Kr. - 374 e.Kr.)
Historiskperiode: klassisk (epoke IV, 374 e.Kr. - 900 e.Kr.)
Historiskperiode: imperial (epoke V, 900 e.Kr. - 1200 e.Kr.)
+Turistmæssige objekt
+ Historisk æra: Palæolitisk (2,6 millioner år-10000 BP)
+ Historisk æra: Mesolitikum
+ Historisk æra: neolitiske
+ Historisk æra: kalkolitiske (IV-III årtusinde f.Kr.)
+
+ Historisk sten
+ Type: forlig cross
+ Type: coat of arms
+
+ Materiale: træ
+ Materiale: metal
+ Materiale: armeret beton
+ Materiale: beton
+ Materiale: stål
+ Materiale: sten
+ Materiale: murværk
+ Materiale: mursten
+ Materiale: plastik
+ Materiale: sandsten
+ Materiale: granitsten
+ Materiale: metal, træ
+ Materiale: glas
+ Materiale: bronze
+ Materiale: jord
+ Materiale: composit
+ Materiale: kalksten
+ Materiale: marmor
+ Materiale: aluminium
+
+ Type: megalith
+ Type: gravhøj
+ Type: befæstning
+ Type: afregning
+ Type: by
+ Type: hyttecirkel
+ Type: necropolis
+ Type: petroglyph
+ Type: jordvold
+ Megalith type: bautasten
+ Megalith type: dolmen
+ Megalith type: nuraghe
+ Megalith type: sten cirkel
+ Megalith type: jættestue
+ Befæstning type: hill fort
+ Befæstning type: kalk
+ Befæstning type: sconce
+ Befæstning type: ring grøft
+
+ Pa (maori befæstet bosættelse)
+
+ Historisk gård
+ Historisk jernbanestation
+
diff --git a/OsmAnd/res/values-nb/strings.xml b/OsmAnd/res/values-nb/strings.xml
index 5cddbb85f7..275a49239d 100644
--- a/OsmAnd/res/values-nb/strings.xml
+++ b/OsmAnd/res/values-nb/strings.xml
@@ -91,7 +91,7 @@
Rute blir beregnet når posisjon blir funnet
Timer
Minutter
- Bilen ble parkert her:
+ Bilen ble parkert
Opptegningsmodus
Vis koter
Øk mengden av kartdetaljer vist
diff --git a/OsmAnd/res/values-pl/strings.xml b/OsmAnd/res/values-pl/strings.xml
index 2a23ee5897..b117d7f66b 100644
--- a/OsmAnd/res/values-pl/strings.xml
+++ b/OsmAnd/res/values-pl/strings.xml
@@ -821,10 +821,10 @@
Europa
Europa - Francja
Europa - Niemcy
- Europa/Azja - Rosja
+ Rosja
Afryka
Azja
- Oceania
+ Australia i Oceania
Mapy świata i tematyczne
Wikipedia dla POI
Komunikaty głosowe (nagrane, ograniczone możliwości)
@@ -2282,9 +2282,16 @@ Afganistan, Afryka Południowa, Albania, Algieria, Andora, Angola, Anguilla, Ant
Proszę aktywuj plugin latarni morskich
Proszę aktywuj plugin SRTM
Później
- Pobierz pełną wersję
+ Pełna wersja
Pobierz
Dodaj nową kategorię
Nazwa kategorii
Taka nazwa kategorii już istnieje. Proszę wybrać inną.
+ Udostępnij położenie
+ Wyślij
+ %.1f MB
+ Uaktualnij wszystko (%1$s MB)
+ Wykorzystano darmowe pobrania
+ Proszę wybrać położenie zapisywania plików map.
+%1$.1f z %2$.1f MB
diff --git a/OsmAnd/res/values-ru/phrases.xml b/OsmAnd/res/values-ru/phrases.xml
index 8967e446cb..12ecd8020d 100644
--- a/OsmAnd/res/values-ru/phrases.xml
+++ b/OsmAnd/res/values-ru/phrases.xml
@@ -44,7 +44,7 @@
Ксерокопия, полиграфия
Шторы, портьеры
Ткани
- Постельное бельё
+
Снаряжение для дайвинга
Инструменты и стройматериалы
Двери
@@ -863,7 +863,7 @@
Жилой район
Религиозное землепользование
- Достопримечательность (тип неизвестен)
+
Парк атракционов
Лесной домик
Охотничий домик
@@ -2278,4 +2278,59 @@
Исторический период: классический (период IV, 374 – 900 г. н.э.)
Исторический период: имперский (период V, 900 – 1200 г. н.э.)
+ Эра: палеолит (2.6 млн. лет до н.э. – 10000 лет до н.э.)
+ Эра: мезолит
+ Эра: неолит
+ Эра: халколит (медный век) (IV—III тысячелетия до н.э.)
+
+ Исторический камень
+ Тип: примирительный крест
+ Тип: герб
+
+ Материал: дерево
+ Материал: металл
+ Материал: железобетон
+ Материал: бетон
+ Материал: сталь
+ Материал: камень
+ Материал: каменная кладка
+ Материал: кирпич
+ Материал: пластик
+ Материал: песчаник
+ Материал: гранит
+ Материал: металл, дерево
+ Материал: стекло
+ Материал: бронза
+ Материал: земля
+ Материал: составной
+ Материал: известняк
+ Материал: мрамор
+ Материал: алюминий
+
+ Тип: мегалит
+ Тип: тумулус
+ Тип: укрепление
+ Тип: поселение
+ Тип: город
+ Тип: круг из хижин
+ Тип: некрополь
+ Тип: петроглиф
+ Тип: земляное укрепление
+ Тип мегалита: менгир
+ Тип мегалита: дольмен
+ Тип мегалита: нураги
+ Тип мегалита: каменный круг
+ Тип мегалита: коридорная гробница
+ Тип укрепления: городище
+ Тип укрепления: лимес
+ Тип укрепления: шанец
+ Тип укрепления: рондела (кольцевая канава)
+
+ Па (укреплённое поселение маори)
+
+ Историческая ферма
+ Историческая железнодорожная станция
+
+ Туристический объект
+
\ No newline at end of file
diff --git a/OsmAnd/res/values-sc/phrases.xml b/OsmAnd/res/values-sc/phrases.xml
index e24f829a01..19ab90aa94 100644
--- a/OsmAnd/res/values-sc/phrases.xml
+++ b/OsmAnd/res/values-sc/phrases.xml
@@ -1401,4 +1401,16 @@
Obeliscu
Colunna
Stupa
+ Casta: campusantu de gherra
+ Casta: tùmulu
+ Casta: rupestre (iscavada in sa roca)
+ Casta: conchedda
+ Casta: tumba a bòveda
+ Casta: columbàriu
+ Casta: mausoleu
+ Casta: sarcòfagu
+ Casta: cripta
+ Casta: piràmide
+
+ Iscalas
diff --git a/OsmAnd/res/values/phrases.xml b/OsmAnd/res/values/phrases.xml
index 5c78462053..38ce22ab3c 100644
--- a/OsmAnd/res/values/phrases.xml
+++ b/OsmAnd/res/values/phrases.xml
@@ -78,7 +78,7 @@
Baby goods
Bag shop
Bathroom furnishings
- Bed room furnishings
+ Bedding store
Fashion boutique
Cameras and lenses
Carpet shop
@@ -92,7 +92,7 @@
Copy shop
Curtain shop
Drapery shop
- Bedding store
+
Diving equipment
Home improvement store
Doors
@@ -606,8 +606,8 @@
Theme park
Tourist attraction
- Tourist attraction
- General tourist attraction
+
+ Touristic object
Amusement ride
Animal (attraction)
Ferris wheel
@@ -723,7 +723,7 @@
Internet access: no
Monastery
- Historic monastery
+
Religious area
Wayside cross
Wayside shrine
@@ -2284,4 +2284,57 @@
Historic period: classical (epoch IV, 374 AC – 900 AC)
Historic period: imperial (epoch V, 900 AC – 1200 AC)
+ Historic era: paleolithic (2.6 million years – 10000 BP)
+ Historic era: mesolithic
+ Historic era: neolithic
+ Historic era: chalcolithic (IV-III millennium BC.)
+
+ Historic stone
+ Type: conciliation cross
+ Type: coat of arms
+
+ Material: wood
+ Material: metal
+ Material: reinforced concrete
+ Material: concrete
+ Material: steel
+ Material: stone
+ Material: masonry
+ Material: brick
+ Material: plastic
+ Material: sandstone
+ Material: granite stone
+ Material: metal;wood
+ Material: glass
+ Material: bronze
+ Material: earth
+ Material: composite
+ Material: limestone
+ Material: marble
+ Material: aluminium
+
+ Type: megalith
+ Type: tumulus
+ Type: fortification
+ Type: settlement
+ Type: city
+ Type: hut circle
+ Type: necropolis
+ Type: petroglyph
+ Type: earthwork
+ Megalith type: menhir
+ Megalith type: dolmen
+ Megalith type: nuraghe
+ Megalith type: stone circle
+ Megalith type: passage grave
+ Fortification type: hill fort
+ Fortification type: limes
+ Fortification type: sconce
+ Fortification type: ring ditch
+
+ Pa (maori fortified settlement)
+
+ Historic farm
+ Historic railway station
+
diff --git a/OsmAnd/src/net/osmand/data/PointDescription.java b/OsmAnd/src/net/osmand/data/PointDescription.java
index ff8459ee7a..0b1eaca61b 100644
--- a/OsmAnd/src/net/osmand/data/PointDescription.java
+++ b/OsmAnd/src/net/osmand/data/PointDescription.java
@@ -37,6 +37,7 @@ public class PointDescription implements Serializable {
public static final String POINT_TYPE_VIDEO_NOTE = "videonote";
public static final String POINT_TYPE_PHOTO_NOTE = "photonote";
public static final String POINT_TYPE_LOCATION = "location";
+ public static final String POINT_TYPE_MY_LOCATION = "my_location";
public static final String POINT_TYPE_ALARM = "alarm";
public static final String POINT_TYPE_TARGET = "destination";
public static final String POINT_TYPE_OSM_BUG = "bug";
@@ -188,6 +189,10 @@ public class PointDescription implements Serializable {
return POINT_TYPE_PARKING_MARKER.equals(type);
}
+ public boolean isMyLocation() {
+ return POINT_TYPE_MY_LOCATION.equals(type);
+ }
+
@Override
public int hashCode() {
final int prime = 31;
diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/BaseMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/BaseMenuController.java
index 5ea9bf997f..536a333198 100644
--- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/BaseMenuController.java
+++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/BaseMenuController.java
@@ -65,7 +65,6 @@ public abstract class BaseMenuController {
protected Drawable getIcon(int iconId, int colorLightId, int colorDarkId) {
IconsCache iconsCache = getMapActivity().getMyApplication().getIconsCache();
- return iconsCache.getIcon(iconId,
- isLight() ? colorLightId : colorDarkId);
+ return iconsCache.getIcon(iconId, isLight() ? colorLightId : colorDarkId);
}
}
diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java
index 1e2801438f..46193bac7e 100644
--- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java
+++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java
@@ -125,7 +125,7 @@ public class MapContextMenu extends MenuTitleController {
initTitle();
if (menuController != null) {
- menuController.addPlainMenuItems(typeStr, this.pointDescription);
+ menuController.addPlainMenuItems(typeStr, this.pointDescription, this.latLon);
}
if (mapPosition != 0) {
@@ -190,7 +190,7 @@ public class MapContextMenu extends MenuTitleController {
}
private void acquireMenuController() {
- menuController = MenuController.getMenuController(mapActivity, latLon, pointDescription, object);
+ menuController = MenuController.getMenuController(mapActivity, pointDescription, object);
}
public void onSingleTapOnMap() {
@@ -313,7 +313,7 @@ public class MapContextMenu extends MenuTitleController {
acquireIcons();
if (menuController != null) {
- menuController.addPlainMenuItems(typeStr, this.pointDescription);
+ menuController.addPlainMenuItems(typeStr, pointDescription, latLon);
}
}
diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java
index 9a4013848a..aa1cc77a0d 100644
--- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java
+++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java
@@ -23,7 +23,7 @@ import java.util.LinkedList;
import static android.util.TypedValue.COMPLEX_UNIT_DIP;
-public abstract class MenuBuilder {
+public class MenuBuilder {
public static final float SHADOW_HEIGHT_TOP_DP = 16f;
public static final float SHADOW_HEIGHT_BOTTOM_DP = 6f;
@@ -59,6 +59,19 @@ public abstract class MenuBuilder {
public void build(View view) {
firstRow = true;
+ if (needBuildPlainMenuItems()) {
+ buildPlainMenuItems(view);
+ }
+ }
+
+ protected void buildPlainMenuItems(View view) {
+ for (PlainMenuItem item : plainMenuItems) {
+ buildRow(view, item.getIconId(), item.getText(), 0);
+ }
+ }
+
+ protected boolean needBuildPlainMenuItems() {
+ return true;
}
protected boolean isFirstRow() {
@@ -69,6 +82,10 @@ public abstract class MenuBuilder {
firstRow = false;
}
+ private void buildRow(View view, int iconId, String text, int textColor) {
+ buildRow(view, getRowIcon(iconId), text, textColor);
+ }
+
protected void buildRow(final View view, Drawable icon, String text, int textColor) {
LinearLayout ll = new LinearLayout(view.getContext());
ll.setOrientation(LinearLayout.HORIZONTAL);
diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java
index 58cc1b433d..1fda77762f 100644
--- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java
+++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java
@@ -8,7 +8,6 @@ import net.osmand.data.Amenity;
import net.osmand.data.FavouritePoint;
import net.osmand.data.LatLon;
import net.osmand.data.PointDescription;
-import net.osmand.plus.IconsCache;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
import net.osmand.plus.activities.MapActivity;
@@ -16,6 +15,7 @@ import net.osmand.plus.helpers.SearchHistoryHelper;
import net.osmand.plus.mapcontextmenu.details.AmenityMenuController;
import net.osmand.plus.mapcontextmenu.details.FavouritePointMenuController;
import net.osmand.plus.mapcontextmenu.details.HistoryMenuController;
+import net.osmand.plus.mapcontextmenu.details.MyLocationMenuController;
import net.osmand.plus.mapcontextmenu.details.ParkingPositionController;
import net.osmand.plus.mapcontextmenu.details.PointDescriptionMenuController;
@@ -41,7 +41,7 @@ public abstract class MenuController extends BaseMenuController {
}
public static MenuController getMenuController(MapActivity mapActivity,
- LatLon latLon, PointDescription pointDescription, Object object) {
+ PointDescription pointDescription, Object object) {
OsmandApplication app = mapActivity.getMyApplication();
MenuController menuController = null;
if (object != null) {
@@ -54,10 +54,12 @@ public abstract class MenuController extends BaseMenuController {
} else if (object instanceof LatLon) {
if (pointDescription.isParking()) {
menuController = new ParkingPositionController(app, mapActivity, pointDescription, (LatLon) object);
+ } else if (pointDescription.isMyLocation()) {
+ menuController = new MyLocationMenuController(app, mapActivity, pointDescription, (LatLon) object);
}
}
} else {
- menuController = new PointDescriptionMenuController(app, mapActivity, pointDescription, latLon);
+ menuController = new PointDescriptionMenuController(app, mapActivity, pointDescription);
}
return menuController;
}
@@ -66,7 +68,15 @@ public abstract class MenuController extends BaseMenuController {
builder.addPlainMenuItem(iconId, text);
}
- public void addPlainMenuItems(String typeStr, PointDescription pointDescription) {
+ public void addPlainMenuItems(String typeStr, PointDescription pointDescription, LatLon latLon) {
+ addMyLocationToPlainItems(pointDescription, latLon);
+ }
+
+ protected void addMyLocationToPlainItems(PointDescription pointDescription, LatLon latLon) {
+ if (pointDescription != null) {
+ addPlainMenuItem(R.drawable.map_my_location, PointDescription.getLocationName(getMapActivity(),
+ latLon.getLatitude(), latLon.getLongitude(), true).replaceAll("\n", ""));
+ }
}
public int getInitialMenuState() {
diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/details/AmenityMenuBuilder.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/details/AmenityMenuBuilder.java
index 8b98946497..65bfdf7532 100644
--- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/details/AmenityMenuBuilder.java
+++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/details/AmenityMenuBuilder.java
@@ -119,14 +119,9 @@ public class AmenityMenuBuilder extends MenuBuilder {
super.build(view);
boolean hasWiki = false;
-
- for (PlainMenuItem item : plainMenuItems) {
- buildRow(view, item.getIconId(), item.getText(), 0, false);
- }
-
MapPoiTypes poiTypes = app.getPoiTypes();
for (Map.Entry e : amenity.getAdditionalInfo().entrySet()) {
- int iconId = 0;
+ int iconId;
Drawable icon = null;
int textColor = 0;
boolean isWiki = false;
diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/details/AmenityMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/details/AmenityMenuController.java
index bed82d1dab..451491444d 100644
--- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/details/AmenityMenuController.java
+++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/details/AmenityMenuController.java
@@ -3,6 +3,7 @@ package net.osmand.plus.mapcontextmenu.details;
import android.os.Bundle;
import net.osmand.data.Amenity;
+import net.osmand.data.LatLon;
import net.osmand.data.PointDescription;
import net.osmand.osm.PoiCategory;
import net.osmand.osm.PoiType;
@@ -74,14 +75,11 @@ public class AmenityMenuController extends MenuController {
}
@Override
- public void addPlainMenuItems(String typeStr, PointDescription pointDescription) {
+ public void addPlainMenuItems(String typeStr, PointDescription pointDescription, LatLon latLon) {
if (!Algorithms.isEmpty(typeStr)) {
addPlainMenuItem(R.drawable.ic_action_info_dark, typeStr);
}
- if (pointDescription != null) {
- addPlainMenuItem(R.drawable.map_my_location, PointDescription.getLocationName(getMapActivity(),
- amenity.getLocation().getLatitude(), amenity.getLocation().getLongitude(), true).replaceAll("\n", ""));
- }
+ addMyLocationToPlainItems(pointDescription, amenity.getLocation());
}
@Override
diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/details/FavouritePointMenuBuilder.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/details/FavouritePointMenuBuilder.java
index 5b2ac02cb3..5c0c6cfdd5 100644
--- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/details/FavouritePointMenuBuilder.java
+++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/details/FavouritePointMenuBuilder.java
@@ -21,6 +21,11 @@ public class FavouritePointMenuBuilder extends MenuBuilder {
buildRow(view, getRowIcon(iconId), text, textColor);
}
+ @Override
+ protected boolean needBuildPlainMenuItems() {
+ return false;
+ }
+
@Override
public void build(View view) {
super.build(view);
@@ -29,8 +34,6 @@ public class FavouritePointMenuBuilder extends MenuBuilder {
buildRow(view, R.drawable.ic_action_note_dark, fav.getDescription(), 0);
}
- for (PlainMenuItem item : plainMenuItems) {
- buildRow(view, item.getIconId(), item.getText(), 0);
- }
+ buildPlainMenuItems(view);
}
}
diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/details/FavouritePointMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/details/FavouritePointMenuController.java
index e4d6f284be..b7f7862865 100644
--- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/details/FavouritePointMenuController.java
+++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/details/FavouritePointMenuController.java
@@ -5,7 +5,6 @@ import android.os.Bundle;
import android.support.v4.app.Fragment;
import net.osmand.data.FavouritePoint;
-import net.osmand.data.PointDescription;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
import net.osmand.plus.activities.MapActivity;
@@ -79,14 +78,6 @@ public class FavouritePointMenuController extends MenuController {
return fav.getName();
}
- @Override
- public void addPlainMenuItems(String typeStr, PointDescription pointDescription) {
- if (pointDescription != null) {
- addPlainMenuItem(R.drawable.map_my_location, PointDescription.getLocationName(getMapActivity(),
- fav.getLatitude(), fav.getLongitude(), true).replaceAll("\n", ""));
- }
- }
-
@Override
public void saveEntityState(Bundle bundle, String key) {
bundle.putSerializable(key, fav);
diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/details/HistoryMenuBuilder.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/details/HistoryMenuBuilder.java
deleted file mode 100644
index 1d96351211..0000000000
--- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/details/HistoryMenuBuilder.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package net.osmand.plus.mapcontextmenu.details;
-
-import android.view.View;
-
-import net.osmand.plus.OsmandApplication;
-import net.osmand.plus.helpers.SearchHistoryHelper.HistoryEntry;
-import net.osmand.plus.mapcontextmenu.MenuBuilder;
-
-public class HistoryMenuBuilder extends MenuBuilder {
- private final HistoryEntry entry;
-
- public HistoryMenuBuilder(OsmandApplication app, final HistoryEntry entry) {
- super(app);
- this.entry = entry;
- }
-
- private void buildRow(View view, int iconId, String text, int textColor) {
- buildRow(view, getRowIcon(iconId), text, textColor);
- }
-
- @Override
- public void build(View view) {
- super.build(view);
-
- for (PlainMenuItem item : plainMenuItems) {
- buildRow(view, item.getIconId(), item.getText(), 0);
- }
- }
-}
diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/details/HistoryMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/details/HistoryMenuController.java
index 24b1edf6f6..1376c5d110 100644
--- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/details/HistoryMenuController.java
+++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/details/HistoryMenuController.java
@@ -3,12 +3,12 @@ package net.osmand.plus.mapcontextmenu.details;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
-import net.osmand.data.PointDescription;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.activities.search.SearchHistoryFragment;
import net.osmand.plus.helpers.SearchHistoryHelper.HistoryEntry;
+import net.osmand.plus.mapcontextmenu.MenuBuilder;
import net.osmand.plus.mapcontextmenu.MenuController;
public class HistoryMenuController extends MenuController {
@@ -16,7 +16,7 @@ public class HistoryMenuController extends MenuController {
private HistoryEntry entry;
public HistoryMenuController(OsmandApplication app, MapActivity mapActivity, final HistoryEntry entry) {
- super(new HistoryMenuBuilder(app, entry), mapActivity);
+ super(new MenuBuilder(app), mapActivity);
this.entry = entry;
}
@@ -69,14 +69,6 @@ public class HistoryMenuController extends MenuController {
return !entry.getName().isAddress();
}
- @Override
- public void addPlainMenuItems(String typeStr, PointDescription pointDescription) {
- if (pointDescription != null) {
- addPlainMenuItem(R.drawable.map_my_location, PointDescription.getLocationName(getMapActivity(),
- entry.getLat(), entry.getLon(), true).replaceAll("\n", ""));
- }
- }
-
@Override
public void saveEntityState(Bundle bundle, String key) {
bundle.putSerializable(key, entry);
diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/details/MyLocationMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/details/MyLocationMenuController.java
new file mode 100644
index 0000000000..75b86b388b
--- /dev/null
+++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/details/MyLocationMenuController.java
@@ -0,0 +1,50 @@
+package net.osmand.plus.mapcontextmenu.details;
+
+import android.graphics.drawable.Drawable;
+import android.os.Bundle;
+
+import net.osmand.data.LatLon;
+import net.osmand.data.PointDescription;
+import net.osmand.plus.ApplicationMode;
+import net.osmand.plus.OsmandApplication;
+import net.osmand.plus.activities.MapActivity;
+import net.osmand.plus.mapcontextmenu.MenuBuilder;
+import net.osmand.plus.mapcontextmenu.MenuController;
+
+public class MyLocationMenuController extends MenuController {
+
+ private LatLon latLon;
+ private PointDescription pointDescription;
+
+ public MyLocationMenuController(OsmandApplication app, MapActivity mapActivity, final PointDescription pointDescription, LatLon latLon) {
+ super(new MenuBuilder(app), mapActivity);
+ this.pointDescription = pointDescription;
+ this.latLon = latLon;
+ }
+
+ @Override
+ protected int getInitialMenuStatePortrait() {
+ return MenuState.HEADER_ONLY;
+ }
+
+ @Override
+ protected int getSupportedMenuStatesPortrait() {
+ return MenuState.HEADER_ONLY | MenuState.HALF_SCREEN;
+ }
+
+ @Override
+ public Drawable getLeftIcon() {
+ ApplicationMode appMode = getMapActivity().getMyApplication().getSettings().getApplicationMode();
+ return getMapActivity().getResources().getDrawable(appMode.getResourceLocation());
+ }
+
+ @Override
+ public String getNameStr() {
+ return pointDescription.getTypeName();
+ }
+
+ @Override
+ public void saveEntityState(Bundle bundle, String key) {
+ bundle.putSerializable(key, latLon);
+ }
+}
diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/details/ParkingPositionBuilder.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/details/ParkingPositionBuilder.java
deleted file mode 100644
index 76bcf121c6..0000000000
--- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/details/ParkingPositionBuilder.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package net.osmand.plus.mapcontextmenu.details;
-
-import android.view.View;
-
-import net.osmand.plus.OsmandApplication;
-import net.osmand.plus.mapcontextmenu.MenuBuilder;
-
-public class ParkingPositionBuilder extends MenuBuilder {
-
- public ParkingPositionBuilder(OsmandApplication app) {
- super(app);
- }
-
- private void buildRow(View view, int iconId, String text, int textColor) {
- buildRow(view, getRowIcon(iconId), text, textColor);
- }
-
- @Override
- public void build(View view) {
- super.build(view);
-
- for (PlainMenuItem item : plainMenuItems) {
- buildRow(view, item.getIconId(), item.getText(), 0);
- }
- }
-}
diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/details/ParkingPositionController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/details/ParkingPositionController.java
index 92f79b33df..8ef8e891e5 100644
--- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/details/ParkingPositionController.java
+++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/details/ParkingPositionController.java
@@ -9,6 +9,7 @@ import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandPlugin;
import net.osmand.plus.R;
import net.osmand.plus.activities.MapActivity;
+import net.osmand.plus.mapcontextmenu.MenuBuilder;
import net.osmand.plus.mapcontextmenu.MenuController;
import net.osmand.plus.parkingpoint.ParkingPositionPlugin;
import net.osmand.util.Algorithms;
@@ -21,7 +22,7 @@ public class ParkingPositionController extends MenuController {
String parkingDescription = "";
public ParkingPositionController(OsmandApplication app, MapActivity mapActivity, final PointDescription pointDescription, LatLon latLon) {
- super(new ParkingPositionBuilder(app), mapActivity);
+ super(new MenuBuilder(app), mapActivity);
this.pointDescription = pointDescription;
this.latLon = latLon;
plugin = OsmandPlugin.getPlugin(ParkingPositionPlugin.class);
@@ -88,14 +89,6 @@ public class ParkingPositionController extends MenuController {
return false;
}
- @Override
- public void addPlainMenuItems(String typeStr, PointDescription pointDescription) {
- if (pointDescription != null) {
- addPlainMenuItem(R.drawable.map_my_location, PointDescription.getLocationName(getMapActivity(),
- latLon.getLatitude(), latLon.getLongitude(), true).replaceAll("\n", ""));
- }
- }
-
@Override
public void saveEntityState(Bundle bundle, String key) {
bundle.putSerializable(key, latLon);
diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/details/PointDescriptionMenuBuilder.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/details/PointDescriptionMenuBuilder.java
deleted file mode 100644
index e20af03aa6..0000000000
--- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/details/PointDescriptionMenuBuilder.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package net.osmand.plus.mapcontextmenu.details;
-
-import android.view.View;
-
-import net.osmand.data.PointDescription;
-import net.osmand.plus.OsmandApplication;
-import net.osmand.plus.mapcontextmenu.MenuBuilder;
-
-public class PointDescriptionMenuBuilder extends MenuBuilder {
- private final PointDescription pointDescription;
-
- public PointDescriptionMenuBuilder(OsmandApplication app, final PointDescription pointDescription) {
- super(app);
- this.pointDescription = pointDescription;
- }
-
- private void buildRow(View view, int iconId, String text, int textColor) {
- buildRow(view, getRowIcon(iconId), text, textColor);
- }
-
- @Override
- public void build(View view) {
- super.build(view);
-
- for (MenuBuilder.PlainMenuItem item : plainMenuItems) {
- buildRow(view, item.getIconId(), item.getText(), 0);
- }
- }
-}
diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/details/PointDescriptionMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/details/PointDescriptionMenuController.java
index d9993b6561..370625ebcb 100644
--- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/details/PointDescriptionMenuController.java
+++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/details/PointDescriptionMenuController.java
@@ -3,23 +3,21 @@ package net.osmand.plus.mapcontextmenu.details;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
-import net.osmand.data.LatLon;
import net.osmand.data.PointDescription;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.activities.search.SearchHistoryFragment;
+import net.osmand.plus.mapcontextmenu.MenuBuilder;
import net.osmand.plus.mapcontextmenu.MenuController;
public class PointDescriptionMenuController extends MenuController {
private PointDescription pointDescription;
- private LatLon latLon;
- public PointDescriptionMenuController(OsmandApplication app, MapActivity mapActivity, final PointDescription pointDescription, LatLon latLon) {
- super(new PointDescriptionMenuBuilder(app, pointDescription), mapActivity);
+ public PointDescriptionMenuController(OsmandApplication app, MapActivity mapActivity, final PointDescription pointDescription) {
+ super(new MenuBuilder(app), mapActivity);
this.pointDescription = pointDescription;
- this.latLon = latLon;
}
@Override
@@ -71,14 +69,6 @@ public class PointDescriptionMenuController extends MenuController {
return !pointDescription.isAddress();
}
- @Override
- public void addPlainMenuItems(String typeStr, PointDescription pointDescription) {
- if (pointDescription != null) {
- addPlainMenuItem(R.drawable.map_my_location, PointDescription.getLocationName(getMapActivity(),
- latLon.getLatitude(), latLon.getLongitude(), true).replaceAll("\n", ""));
- }
- }
-
@Override
public void saveEntityState(Bundle bundle, String key) {
}
diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/ObjectSelectionMenu.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/ObjectSelectionMenu.java
index 016bb76c71..5866f7f1b1 100644
--- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/ObjectSelectionMenu.java
+++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/ObjectSelectionMenu.java
@@ -47,7 +47,7 @@ public class ObjectSelectionMenu extends BaseMenuController {
}
protected void init() {
- controller = MenuController.getMenuController(mapActivity, latLon, pointDescription, object);
+ controller = MenuController.getMenuController(mapActivity, pointDescription, object);
initTitle();
}
diff --git a/OsmAnd/src/net/osmand/plus/views/PointLocationLayer.java b/OsmAnd/src/net/osmand/plus/views/PointLocationLayer.java
index eb0786a0ee..8cd21bd5a4 100644
--- a/OsmAnd/src/net/osmand/plus/views/PointLocationLayer.java
+++ b/OsmAnd/src/net/osmand/plus/views/PointLocationLayer.java
@@ -2,6 +2,8 @@ package net.osmand.plus.views;
import net.osmand.Location;
+import net.osmand.data.LatLon;
+import net.osmand.data.PointDescription;
import net.osmand.data.RotatedTileBox;
import net.osmand.plus.ApplicationMode;
import net.osmand.plus.OsmAndLocationProvider;
@@ -12,9 +14,12 @@ import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Paint.Style;
+import android.graphics.PointF;
import android.graphics.RectF;
-public class PointLocationLayer extends OsmandMapLayer {
+import java.util.List;
+
+public class PointLocationLayer extends OsmandMapLayer implements ContextMenuLayer.IContextMenuProvider {
protected final static int RADIUS = 7;
protected final static float HEADING_ANGLE = 60;
@@ -124,11 +129,8 @@ public class PointLocationLayer extends OsmandMapLayer {
}
}
- public boolean isLocationVisible(RotatedTileBox tb, Location l){
- if(l == null ){
- return false;
- }
- return tb.containsLatLon(l.getLatitude(), l.getLongitude());
+ public boolean isLocationVisible(RotatedTileBox tb, Location l) {
+ return l != null && tb.containsLatLon(l.getLatitude(), l.getLongitude());
}
@@ -150,4 +152,57 @@ public class PointLocationLayer extends OsmandMapLayer {
}
+ @Override
+ public void collectObjectsFromPoint(PointF point, RotatedTileBox tileBox, List