diff --git a/OsmAnd/res/drawable/bg_map_context_menu_dark.xml b/OsmAnd/res/drawable/bg_map_context_menu_dark.xml
new file mode 100644
index 0000000000..3303757168
--- /dev/null
+++ b/OsmAnd/res/drawable/bg_map_context_menu_dark.xml
@@ -0,0 +1,12 @@
+
+
+ -
+
+
+ -
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/drawable/bg_map_context_menu_light.xml b/OsmAnd/res/drawable/bg_map_context_menu_light.xml
new file mode 100644
index 0000000000..f980150e47
--- /dev/null
+++ b/OsmAnd/res/drawable/bg_map_context_menu_light.xml
@@ -0,0 +1,12 @@
+
+
+ -
+
+
+ -
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/layout/map_context_menu_fragment.xml b/OsmAnd/res/layout/map_context_menu_fragment.xml
index b3bce636b9..ca495ba479 100644
--- a/OsmAnd/res/layout/map_context_menu_fragment.xml
+++ b/OsmAnd/res/layout/map_context_menu_fragment.xml
@@ -25,14 +25,13 @@
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="0"
- android:background="@android:color/white"
+ android:background="?attr/bg_map_context_menu"
android:orientation="vertical">
@@ -68,6 +67,7 @@
android:layout_marginRight="12dp"
android:text="@string/search_address_building"
android:textSize="@dimen/default_list_text_size_large"
+ android:textColor="?android:textColorPrimary"
android:textStyle="bold"/>
@@ -107,8 +107,7 @@
android:layout_weight="1"
android:scaleType="center"
android:background="?attr/dashboard_button"
- android:src="@drawable/map_directions"
- android:tint="@color/actionbar_dark_color"/>
+ android:src="@drawable/map_directions"/>
+ android:src="@drawable/ic_action_fav_dark"/>
+ android:src="@drawable/abc_ic_menu_share_mtrl_alpha"/>
+ android:src="@drawable/ic_action_core_overflow_dark"/>
diff --git a/OsmAnd/res/values-ca/phrases.xml b/OsmAnd/res/values-ca/phrases.xml
index e20a557647..49c0a90a6c 100644
--- a/OsmAnd/res/values-ca/phrases.xml
+++ b/OsmAnd/res/values-ca/phrases.xml
@@ -1139,4 +1139,6 @@
Maronita
Budisme mahayana
+ Residus radioactius
+ Camp per rehabilitar
diff --git a/OsmAnd/res/values-da/phrases.xml b/OsmAnd/res/values-da/phrases.xml
index 5afbba780f..c87f40402e 100644
--- a/OsmAnd/res/values-da/phrases.xml
+++ b/OsmAnd/res/values-da/phrases.xml
@@ -1165,14 +1165,14 @@
Spildevand (indhold)
Gas (indhold)
Biomasse (indhold)
- Spildevand (indhold)
+ Afløbsvand (indhold)
Afgrøde (indhold)
Foder (indhold)
Øl (indhold)
Salt (indhold)
Korn (indhold)
- Bunker silo
+ Plansilo
Forladt industrigrund
Byggemodning
diff --git a/OsmAnd/res/values-es-rAR/phrases.xml b/OsmAnd/res/values-es-rAR/phrases.xml
index 90a77c7a12..f99ee89bc0 100644
--- a/OsmAnd/res/values-es-rAR/phrases.xml
+++ b/OsmAnd/res/values-es-rAR/phrases.xml
@@ -72,7 +72,7 @@
Boutique de moda
Alfombras
Negocio benéfico
- Perfumería
+ Higiene personal
Negocio de ropa
Ropa infantil
Zapatería
@@ -92,7 +92,7 @@
Gas líquido
Pulpería
Regalería
- Cristalería
+ Vidriería
Ferretería
Audífonos
Herboristería
@@ -861,7 +861,7 @@
Artículos de calefacción
Almacén de jardinería
Marroquinería
- Gomería
+ Neumáticos
Relojería (watches)
Juegos
Modelos a escala
diff --git a/OsmAnd/res/values-es-rAR/strings.xml b/OsmAnd/res/values-es-rAR/strings.xml
index 9ac0fff794..2b370de55d 100644
--- a/OsmAnd/res/values-es-rAR/strings.xml
+++ b/OsmAnd/res/values-es-rAR/strings.xml
@@ -517,14 +517,14 @@
\n\nPuede elegir \'Iniciar Navegación\', lo que implica que OsmAnd te guiará, te dará indicaciones vocales (si están activas), etc. O puede elegir \'Mostrar ruta\', y solamente mostrará la ruta, sin indicaciones ni reajustes según se mueva.
\n\nPara mostrar una ruta al destino desde cualquier punto diferente de la posición actual, selecciónelo posteriormente en el mapa y pulsa \'Ir desde\'.
\n\nSi usa \'Ir desde\' y luego \'Iniciar Navegación\', OsmAnd cambiará a su ubicación actual tan pronto como la conozca (por lo que se puede usar para iniciar la ruta antes de conocer la ubicación real). Por otro lado, \'Ir desde\' y \'Mostrar ruta\' no realizará actualizaciones de la ruta mostrada. "
- "Puede buscar lugares directamente en el mapa vía \'Usar ubicación\'→\'Buscar cerca de aquí\', o mediante la pantalla de búsqueda vía \'Menú\'→\'Buscar\'.
+ "Puede buscar lugares directamente en el mapa vía \'Usar ubicación\'→\'Buscar cerca\', o mediante la pantalla de búsqueda vía \'Menú\'→\'Buscar\'.
\n\nLa pantalla de búsqueda proporciona plantillas para buscar:
\n\t* por dirección
\n\t* por coordenadas
\n\t* como PDI (por tipo o por nombre)
\n\t* por su historial de búsquedas
\n\t* o en sus favoritos predefinidos.
-\n\nPara los puntos encontrados, se ofrece un menú contextual o barra de acciones con opciones como \'Indicaciones a\' o \'Mostrar en mapa\', etc. "
+\n\nPara los puntos encontrados, se ofrece un menú contextual o barra de acciones con opciones como \'Ir hasta\' o \'Mostrar en mapa\', etc. "
El modo reposo, aún está funcionando. ¿Quiere interrumpirlo también?
¿Interrumpir el modo reposo del GPS?
Elige el intervalo de registro para la grabación de trazas general (activar mediante el control de grabación GPX en el mapa)
@@ -712,8 +712,8 @@
Quitar puntos intermedios
Mantener puntos intermedios
Ya definió puntos intermedios.
- Indicaciones a
- Indicaciones desde
+ Ir hasta
+ Ir desde
"Mapa: "
Lat %1$.3f, Lon %2$.3f
Posición actual
@@ -1196,7 +1196,7 @@
Los mapas vectoriales pueden mostrarse más rápido. Puede no funcionar correctamente en algunos dispositivos.
Reproduce indicaciones de voz elegidas
Dibujo nativo
- Probar indicaciones de voz
+ Probar avisos de voz
No existe mapa vectorial sin conexión presente en esta ubicación. Puede descargar uno en Opciones (Gestionar mapas), o cambiar al mapa en línea (para esto, activar el complemento de mapas en línea).
"Cambios en 0.7.2 :
\n\t- Dibujo nativo para todos los dispositivos
@@ -1313,8 +1313,8 @@
Oceanía
Mapas mundiales y temáticos
Wikipedia mundial
- Indicaciones de voz (grabado, funciones limitadas)
- Indicaciones de voz (sintetizado TTS, preferido)
+ Avisos de voz (grabado, funciones limitadas)
+ Avisos de voz (sintetizado TTS, preferido)
Wikipedia (sin conexión)
Definido por el usuario
Ya existe un archivo anterior con favoritos exportados. ¿Quiere sustituirlo?
@@ -1409,7 +1409,7 @@
Ubicación actual…
Vista actual del mapa
Origen:
- Buscar cerca de aquí
+ Buscar cerca
"Cambios en 0.6.7 :
\n\t- Gestor de datos descargados (descargar, borrar, activar/desactivar datos descargados directamente en OsmAnd)
\n\t- Puntos y grupos favoritos (categorizar, borrar, gestionar favoritos)
@@ -1634,7 +1634,7 @@
Resultados de transporte ({0} al destino):
Reiniciar búsqueda de transporte
Voz grabada
- Indicaciones de voz
+ Avisos de voz
Los mapas vectoriales no están cargados
Navegar usando GPX
Sin archivos GPX en la carpeta de trazas
diff --git a/OsmAnd/res/values-pl/strings.xml b/OsmAnd/res/values-pl/strings.xml
index f16a594cf2..d16b5978b3 100644
--- a/OsmAnd/res/values-pl/strings.xml
+++ b/OsmAnd/res/values-pl/strings.xml
@@ -2213,4 +2213,6 @@ Afganistan, Afryka Południowa, Albania, Algieria, Andora, Angola, Anguilla, Ant
Mapy offline\ni nawigacja
Proszę określić typ POI.
Ilość wierszy na ekranie głównym %1$s
+ Opis
+ Rodzaj POI
diff --git a/OsmAnd/res/values-ru/strings.xml b/OsmAnd/res/values-ru/strings.xml
index ee04519c74..3c3c97e3f9 100644
--- a/OsmAnd/res/values-ru/strings.xml
+++ b/OsmAnd/res/values-ru/strings.xml
@@ -2077,4 +2077,15 @@
Зафиксировать POI
Основные
Расширенные
-
+ Следующий
+ Открытие в
+ Закрытие в
+ название
+ Контактная информация
+ Описание
+ Добавить часы работы
+ Тип POI
+ Количество строк на странице %1$s
+ Пожалуйста, укажите тип POI.
+Жирный контур
+
diff --git a/OsmAnd/res/values-zh-rTW/phrases.xml b/OsmAnd/res/values-zh-rTW/phrases.xml
index 00b734bcf7..dc80a3447e 100644
--- a/OsmAnd/res/values-zh-rTW/phrases.xml
+++ b/OsmAnd/res/values-zh-rTW/phrases.xml
@@ -1132,4 +1132,21 @@
馬若恩教派
大乘佛教
+ 核廢料
+ 棕地
+ 未開發地
+ 燃料貯塔
+ 開始日期
+ 輪椅
+
+ 青貯飼料 (庫容)
+ 水 (庫容)
+ 礦泥 (庫容)
+ 油 (庫容)
+ 燃料 (庫容)
+ 肥料 (庫容)
+ 酒 (庫容)
+ 污水 (庫容)
+ 瓦斯 (庫容)
+ 生物質 (庫容)
diff --git a/OsmAnd/res/values/attrs.xml b/OsmAnd/res/values/attrs.xml
index 9da3667e82..43097f5c88 100644
--- a/OsmAnd/res/values/attrs.xml
+++ b/OsmAnd/res/values/attrs.xml
@@ -11,7 +11,8 @@
-
+
+
diff --git a/OsmAnd/res/values/styles.xml b/OsmAnd/res/values/styles.xml
index e4b28caf99..bb32c32229 100644
--- a/OsmAnd/res/values/styles.xml
+++ b/OsmAnd/res/values/styles.xml
@@ -66,6 +66,7 @@
- @style/Widget.Styled.ActionBarLight
- @color/bg_color_light
- @drawable/bg_card_light
+ - @drawable/bg_map_context_menu_light
- @color/dashboard_divider_light
- @drawable/dashboard_button_light
- @color/search_background_dark
@@ -160,6 +161,7 @@
- @style/Widget.Styled.ActionBarDark
- @color/bg_color_dark
- @drawable/bg_card_dark
+ - @drawable/bg_map_context_menu_dark
- @color/dashboard_divider_dark
- @drawable/dashboard_button_dark
- @color/color_white
diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java
index 6ade2b18ba..4bc646441d 100644
--- a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java
+++ b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java
@@ -106,7 +106,7 @@ public class MapActivityActions implements DialogProvider {
new ShareLocation(mapActivity).run();
}
- public void showNavigationContextMenuPoint(final double latitude, final double longitude, Object selectedObj) {
+ public void showNavigationContextMenuPoint(final double latitude, final double longitude) {
final ContextMenuAdapter adapter = new ContextMenuAdapter(mapActivity);
if(!mapActivity.getRoutingHelper().isFollowingMode() && !mapActivity.getRoutingHelper().isRoutePlanningMode()) {
diff --git a/OsmAnd/src/net/osmand/plus/development/TestVoiceActivity.java b/OsmAnd/src/net/osmand/plus/development/TestVoiceActivity.java
index 11cce0287a..4e9c87a345 100644
--- a/OsmAnd/src/net/osmand/plus/development/TestVoiceActivity.java
+++ b/OsmAnd/src/net/osmand/plus/development/TestVoiceActivity.java
@@ -171,23 +171,23 @@ public class TestVoiceActivity extends OsmandActionBarActivity {
addButton(ll, "New route has been calculated (150m & 2m5sec)", builder(p).newRouteCalculated(150, 125));
addButton(ll, "Route recalculated (23150m & 350sec)", builder(p).routeRecalculated(23150, 350));
- addButton(ll, "In 1520m turn slightly left", builder(p).prepareTurn(AbstractPrologCommandPlayer.A_LEFT_SL, 1520, street(p, "")));
- addButton(ll, "After 850m turn sharply left onto 'Hauptstra"+"\u00df"+"e', then bear right", builder(p).turn(AbstractPrologCommandPlayer.A_LEFT_SH, 850, street(p, "Hauptstrasse")).then().bearRight(street(p, "")));
- addButton(ll, "Turn left, then after 100m turn slightly right", builder(p).turn(AbstractPrologCommandPlayer.A_LEFT, street(p, "")).then().turn(AbstractPrologCommandPlayer.A_RIGHT_SL, 100, street(p, "")));
- addButton(ll, "In 3100 turn right onto 'SR 80'", builder(p).prepareTurn(AbstractPrologCommandPlayer.A_RIGHT, 3100, street(p, "SR 80")));
- addButton(ll, "After 370m turn slightly right onto 'F23' 'Main Street', then bear left", builder(p).turn(AbstractPrologCommandPlayer.A_RIGHT_SL, 370, street(p, "Main Street", "F23")).then().bearLeft(street(p, "")));
+ addButton(ll, "After 1520m turn slightly left", builder(p).prepareTurn(AbstractPrologCommandPlayer.A_LEFT_SL, 1520, street(p, "")));
+ addButton(ll, "In 450m turn sharply left onto 'Hauptstra"+"\u00df"+"e', then bear right", builder(p).turn(AbstractPrologCommandPlayer.A_LEFT_SH, 450, street(p, "Hauptstra�e")).then().bearRight(street(p, "")));
+ addButton(ll, "Turn left, then in 100m turn slightly right", builder(p).turn(AbstractPrologCommandPlayer.A_LEFT, street(p, "")).then().turn(AbstractPrologCommandPlayer.A_RIGHT_SL, 100, street(p, "")));
+ addButton(ll, "After 3100 turn right onto 'SR 80'", builder(p).prepareTurn(AbstractPrologCommandPlayer.A_RIGHT, 3100, street(p, "SR 80")));
+ addButton(ll, "In 370m turn slightly right onto 'F23' 'Main Street', then bear left", builder(p).turn(AbstractPrologCommandPlayer.A_RIGHT_SL, 370, street(p, "Main Street", "F23")).then().bearLeft(street(p, "")));
addButton(ll, "Turn sharply right onto 'Main Street'", builder(p).turn(AbstractPrologCommandPlayer.A_RIGHT_SH, street(p, "Main Street")));
- addButton(ll, "In 1810m keep left ' '", builder(p).prepareTurn(AbstractPrologCommandPlayer.A_LEFT_KEEP, 1810, street(p, "")));
- addButton(ll, "After 400m keep left ' ' then after 80m keep right 'A1'", builder(p).turn(AbstractPrologCommandPlayer.A_LEFT_KEEP, 400, street(p, "")).then().turn(AbstractPrologCommandPlayer.A_RIGHT_KEEP, 80, street(p,"", "A1")));
+ addButton(ll, "After 1810m keep left ' '", builder(p).prepareTurn(AbstractPrologCommandPlayer.A_LEFT_KEEP, 1810, street(p, "")));
+ addButton(ll, "In 400m keep left ' ' then in 80m keep right 'A1'", builder(p).turn(AbstractPrologCommandPlayer.A_LEFT_KEEP, 400, street(p, "")).then().turn(AbstractPrologCommandPlayer.A_RIGHT_KEEP, 80, street(p,"", "A1")));
- addButton(ll, "In 640m make a U-turn", builder(p).prepareMakeUT(640, street(p, "")));
- addButton(ll, "After 400m make a U-turn", builder(p).makeUT(400, street(p, "")));
+ addButton(ll, "After 640m make a U-turn", builder(p).prepareMakeUT(640, street(p, "")));
+ addButton(ll, "In 400m make a U-turn", builder(p).makeUT(400, street(p, "")));
addButton(ll, "Make a U-turn on 'Riviera'", builder(p).makeUT(street(p, "Riviera")));
addButton(ll, "When possible, make a U-turn", builder(p).makeUTwp());
- addButton(ll, "In 1250m enter a roundabout [and take the 3rd exit onto 'Liberty']", builder(p).prepareRoundAbout(1250, 3, street(p,"Liberty")));
- addButton(ll, "After 450m enter the roundabout and take the 1st exit onto 'Market Square'", builder(p).roundAbout(450, 0, 1, street(p,"", "", "Market Square")));
+ addButton(ll, "After 1250m enter a roundabout [and take the 3rd exit onto 'Liberty']", builder(p).prepareRoundAbout(1250, 3, street(p,"Liberty")));
+ addButton(ll, "In 450m enter the roundabout and take the 1st exit onto 'Market Square'", builder(p).roundAbout(450, 0, 1, street(p,"", "", "Market Square")));
addButton(ll, "Roundabout: Take the 2nd exit onto 'Bridge Avenue'", builder(p).roundAbout(0, 2, street(p, "Bridge Avenue")));
addButton(ll, "Follow the road for 2350m to ' '", builder(p).goAhead(2350, street(p, "")));
diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java
index 5473f2311e..2048005c63 100644
--- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java
+++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java
@@ -14,6 +14,7 @@ import net.osmand.plus.OsmandSettings;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.render.RenderingIcons;
import net.osmand.plus.routing.RoutingHelper;
+import net.osmand.plus.views.OsmandMapLayer;
import net.osmand.util.Algorithms;
public class MapContextMenu {
@@ -24,7 +25,6 @@ public class MapContextMenu {
private PointDescription pointDescription;
private Object object;
- private ContextMenuAdapter menuAdapter;
private String foundStreetName;
@@ -59,14 +59,13 @@ public class MapContextMenu {
}
- public void show(PointDescription pointDescription, Object object, ContextMenuAdapter menuAdapter) {
+ public void show(PointDescription pointDescription, Object object) {
if (isMenuVisible())
hide();
this.pointDescription = pointDescription;
this.object = object;
- this.menuAdapter = menuAdapter;
acquireStretName();
@@ -92,34 +91,37 @@ public class MapContextMenu {
}
public int getLeftIconId() {
- if (object instanceof Amenity) {
- String id = null;
- Amenity o = (Amenity)object;
- PoiType st = o.getType().getPoiTypeByKeyName(o.getSubType());
- if (st != null) {
- if (RenderingIcons.containsSmallIcon(st.getIconKeyName())) {
- id = st.getIconKeyName();
- } else if (RenderingIcons.containsSmallIcon(st.getOsmTag() + "_" + st.getOsmValue())) {
- id = st.getOsmTag() + "_" + st.getOsmValue();
+ if (object != null) {
+ if (object instanceof Amenity) {
+ String id = null;
+ Amenity o = (Amenity) object;
+ PoiType st = o.getType().getPoiTypeByKeyName(o.getSubType());
+ if (st != null) {
+ if (RenderingIcons.containsSmallIcon(st.getIconKeyName())) {
+ id = st.getIconKeyName();
+ } else if (RenderingIcons.containsSmallIcon(st.getOsmTag() + "_" + st.getOsmValue())) {
+ id = st.getOsmTag() + "_" + st.getOsmValue();
+ }
}
- }
- if (id != null) {
- Integer resId = RenderingIcons.getResId(id);
- if (resId != null) {
- return resId;
+ if (id != null) {
+ Integer resId = RenderingIcons.getResId(id);
+ if (resId != null) {
+ return resId;
+ }
}
}
}
-
return 0;
}
public String getAddressStr() {
String res = null;
- if (object instanceof Amenity) {
- Amenity amenity = (Amenity) object;
- res = OsmAndFormatter.getPoiStringWithoutType(amenity, settings.MAP_PREFERRED_LOCALE.get());
+ if (object != null) {
+ if (object instanceof Amenity) {
+ Amenity amenity = (Amenity) object;
+ res = OsmAndFormatter.getPoiStringWithoutType(amenity, settings.MAP_PREFERRED_LOCALE.get());
+ }
}
if (Algorithms.isEmpty(res)) {
@@ -132,7 +134,7 @@ public class MapContextMenu {
res = typeName;
}
- return Algorithms.isEmpty(res) ? "???" : res;
+ return Algorithms.isEmpty(res) ? "Address is unknown yet" : res;
}
public String getLocationStr() {
@@ -143,11 +145,11 @@ public class MapContextMenu {
}
public void buttonNavigatePressed() {
- mapActivity.getMapActions().showNavigationContextMenuPoint(pointDescription.getLat(), pointDescription.getLon(), object);
+ mapActivity.getMapActions().showNavigationContextMenuPoint(pointDescription.getLat(), pointDescription.getLon());
}
public void buttonFavoritePressed() {
- if (object instanceof FavouritePoint) {
+ if (object != null && object instanceof FavouritePoint) {
mapActivity.getMapActions().editFavoritePoint((FavouritePoint)object);
} else {
mapActivity.getMapActions().addFavouritePoint(pointDescription.getLat(), pointDescription.getLon());
@@ -159,6 +161,13 @@ public class MapContextMenu {
}
public void buttonMorePressed() {
+ final ContextMenuAdapter menuAdapter = new ContextMenuAdapter(mapActivity);
+ if (object != null) {
+ for (OsmandMapLayer layer : mapActivity.getMapView().getLayers()) {
+ layer.populateObjectContextMenu(object, menuAdapter);
+ }
+ }
+
mapActivity.getMapActions().contextMenuPoint(pointDescription.getLat(), pointDescription.getLon(), menuAdapter, object);
}
}
diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java
index 5a49f196ea..a98de676c5 100644
--- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java
+++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java
@@ -10,14 +10,18 @@ import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.DecelerateInterpolator;
+import android.widget.Button;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import net.osmand.PlatformUtil;
+import net.osmand.plus.IconsCache;
+import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
import net.osmand.plus.activities.MapActivity;
+import net.osmand.plus.activities.search.SearchActivity;
import org.apache.commons.logging.Log;
@@ -122,6 +126,9 @@ public class MapContextMenuFragment extends Fragment {
}
});
+ IconsCache iconsCache = getMyApplication().getIconsCache();
+ boolean light = getMyApplication().getSettings().isLightContent();
+
int iconId = MapContextMenu.getInstance().getLeftIconId();
final View iconLayout = view.findViewById(R.id.context_menu_icon_layout);
@@ -129,7 +136,8 @@ public class MapContextMenuFragment extends Fragment {
if (iconId == 0) {
iconLayout.setVisibility(View.GONE);
} else {
- iconView.setImageResource(iconId);
+ iconView.setImageDrawable(iconsCache.getIcon(iconId,
+ light ? R.color.icon_color : R.color.icon_color_light));
}
TextView line1 = (TextView) view.findViewById(R.id.context_menu_line1);
@@ -139,6 +147,8 @@ public class MapContextMenuFragment extends Fragment {
line2.setText(MapContextMenu.getInstance().getLocationStr());
final ImageButton buttonNavigate = (ImageButton) view.findViewById(R.id.context_menu_route_button);
+ buttonNavigate.setImageDrawable(iconsCache.getIcon(R.drawable.map_directions,
+ light ? R.color.actionbar_dark_color : R.color.actionbar_light_color));
buttonNavigate.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
@@ -147,6 +157,8 @@ public class MapContextMenuFragment extends Fragment {
});
final ImageButton buttonFavorite = (ImageButton) view.findViewById(R.id.context_menu_fav_button);
+ buttonFavorite.setImageDrawable(iconsCache.getIcon(R.drawable.ic_action_fav_dark,
+ light ? R.color.actionbar_dark_color : R.color.actionbar_light_color));
buttonFavorite.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
@@ -155,6 +167,8 @@ public class MapContextMenuFragment extends Fragment {
});
final ImageButton buttonShare = (ImageButton) view.findViewById(R.id.context_menu_share_button);
+ buttonShare.setImageDrawable(iconsCache.getIcon(R.drawable.abc_ic_menu_share_mtrl_alpha,
+ light ? R.color.actionbar_dark_color : R.color.actionbar_light_color));
buttonShare.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
@@ -163,6 +177,8 @@ public class MapContextMenuFragment extends Fragment {
});
final ImageButton buttonMore = (ImageButton) view.findViewById(R.id.context_menu_more_button);
+ buttonMore.setImageDrawable(iconsCache.getIcon(R.drawable.ic_action_core_overflow_dark,
+ light ? R.color.actionbar_dark_color : R.color.actionbar_light_color));
buttonMore.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
@@ -215,6 +231,13 @@ public class MapContextMenuFragment extends Fragment {
getActivity().getSupportFragmentManager().popBackStack();
}
+ public OsmandApplication getMyApplication() {
+ if (getActivity() == null) {
+ return null;
+ }
+ return (OsmandApplication) getActivity().getApplication();
+ }
+
public static void showInstance(final MapActivity mapActivity) {
MapContextMenuFragment fragment = new MapContextMenuFragment();
mapActivity.getSupportFragmentManager().beginTransaction()
diff --git a/OsmAnd/src/net/osmand/plus/routing/VoiceRouter.java b/OsmAnd/src/net/osmand/plus/routing/VoiceRouter.java
index d1d6ca2a0c..0b1a5cdf8a 100644
--- a/OsmAnd/src/net/osmand/plus/routing/VoiceRouter.java
+++ b/OsmAnd/src/net/osmand/plus/routing/VoiceRouter.java
@@ -128,7 +128,7 @@ public class VoiceRouter {
PREPARE_DISTANCE = 1500; // [125 sec]
PREPARE_DISTANCE_END = 1200; // [100 sec]
TURN_IN_DISTANCE = 300; // 23 sec
- TURN_IN_DISTANCE_END = 195; // 15 sec
+ TURN_IN_DISTANCE_END = 210; // 16 sec
TURN_DISTANCE = 50; // 7 sec
TURN_DEFAULT_SPEED = 7f; // 25 km/h
DEFAULT_SPEED = 13; // 48 km/h
@@ -164,7 +164,7 @@ public class VoiceRouter {
PREPARE_DISTANCE = (int) (DEFAULT_SPEED * 115);
PREPARE_DISTANCE_END = (int) (DEFAULT_SPEED * 92);
TURN_IN_DISTANCE = (int) (DEFAULT_SPEED * 23);
- TURN_IN_DISTANCE_END = (int) (DEFAULT_SPEED * 15);
+ TURN_IN_DISTANCE_END = (int) (DEFAULT_SPEED * 16);
TURN_DISTANCE = (int) (DEFAULT_SPEED * 7);
}
}
diff --git a/OsmAnd/src/net/osmand/plus/views/ContextMenuLayer.java b/OsmAnd/src/net/osmand/plus/views/ContextMenuLayer.java
index bfdf03855e..0282f751cb 100644
--- a/OsmAnd/src/net/osmand/plus/views/ContextMenuLayer.java
+++ b/OsmAnd/src/net/osmand/plus/views/ContextMenuLayer.java
@@ -271,12 +271,20 @@ public class ContextMenuLayer extends OsmandMapLayer {
}
LatLon latLon = selectObjectsForContextMenu(tileBox, point);
if (latLon != null) {
- String description = getSelectedObjectDescription();
- setLocation(latLon, description);
+ if (selectedObjects.size() == 1) {
+ setLocation(null, "");
+ Object selectedObj = selectedObjects.keySet().iterator().next();
+ showMapContextMenu(selectedObj, latLon);
+ } else {
+ String description = getSelectedObjectDescription();
+ setLocation(latLon, description);
+ }
} else {
+ setLocation(null, "");
final double lat = tileBox.getLatFromPixel((int) point.x, (int) point.y);
final double lon = tileBox.getLonFromPixel((int) point.x, (int) point.y);
- setLocation(new LatLon(lat, lon), null);
+ showMapContextMenu(null, new LatLon(lat, lon));
+ //setLocation(new LatLon(lat, lon), null);
}
view.refreshMap();
return true;
@@ -337,7 +345,7 @@ public class ContextMenuLayer extends OsmandMapLayer {
}
public int pressedInTextView(RotatedTileBox tb, float px, float py) {
- if (latLon != null) {
+ if (latLon != null && textView.getText().length() > 0) {
Rect bs = textView.getBackground().getBounds();
Rect closes = closeButton.getDrawable().getBounds();
int dx = (int) (px - tb.getPixXFromLatLon(latLon.getLatitude(), latLon.getLongitude()));
@@ -429,8 +437,9 @@ public class ContextMenuLayer extends OsmandMapLayer {
LatLon latLon = selectObjectsForContextMenu(tileBox, point);
if (latLon != null) {
if (selectedObjects.size() == 1) {
+ setLocation(null, "");
Object selectedObj = selectedObjects.keySet().iterator().next();
- showMapContextMenu(selectedObj, latLon, null);
+ showMapContextMenu(selectedObj, latLon);
} else {
String description = getSelectedObjectDescription();
setLocation(latLon, description);
@@ -459,33 +468,29 @@ public class ContextMenuLayer extends OsmandMapLayer {
@Override
public void onClick(DialogInterface dialog, int which) {
Object selectedObj = s.get(which);
- for (OsmandMapLayer layer : view.getLayers()) {
- layer.populateObjectContextMenu(selectedObj, menuAdapter);
- }
- showMapContextMenu(selectedObj, l, menuAdapter);
- //activity.getMapActions().contextMenuPoint(l.getLatitude(), l.getLongitude(), menuAdapter, selectedObj);
+ showMapContextMenu(selectedObj, l);
}
});
builder.show();
} else {
Object selectedObj = selectedObjects.keySet().iterator().next();
- for (OsmandMapLayer layer : view.getLayers()) {
- layer.populateObjectContextMenu(selectedObj, menuAdapter);
- }
-
- showMapContextMenu(selectedObj, l, menuAdapter);
- //activity.getMapActions().contextMenuPoint(l.getLatitude(), l.getLongitude(), menuAdapter, selectedObj);
+ showMapContextMenu(selectedObj, l);
}
}
- private void showMapContextMenu(Object obj, LatLon latLon, final ContextMenuAdapter menuAdapter) {
- PointDescription pointDescription = selectedObjects.get(obj).getObjectName(obj);
- pointDescription.setLat(latLon.getLatitude());
- pointDescription.setLon(latLon.getLongitude());
+ private void showMapContextMenu(Object obj, LatLon latLon) {
+ PointDescription pointDescription;
+ if (obj != null) {
+ pointDescription = selectedObjects.get(obj).getObjectName(obj);
+ pointDescription.setLat(latLon.getLatitude());
+ pointDescription.setLon(latLon.getLongitude());
+ } else {
+ pointDescription = new PointDescription(latLon.getLatitude(), latLon.getLongitude());
+ }
this.latLon = latLon;
showMapContextMenuMarker();
- MapContextMenu.getInstance().show(pointDescription, obj, menuAdapter);
+ MapContextMenu.getInstance().show(pointDescription, obj);
}