Merge branch 'master' of github.com:osmandapp/Osmand

This commit is contained in:
Victor Shcherb 2015-11-01 22:55:31 +01:00
commit 917705968a
10 changed files with 69 additions and 28 deletions

View file

@ -230,7 +230,7 @@
<string name="poi_lighthouse">Faro</string>
<string name="poi_bicycle_rental">Alquiler de bicicletas</string>
<string name="poi_bicycle_parking">Bicicletero / Guardería</string>
<string name="poi_bicycle_parking">Bicicletero/Guardería</string>
<string name="poi_aerialway_station">Estación de transporte elevado</string>
<string name="poi_aerialway_cable_car">Teleférico</string>
@ -288,7 +288,7 @@
<string name="poi_quarry">Cantera</string>
<string name="poi_vineyard">Viñedo</string>
<string name="poi_orchard">Huerto</string>
<string name="poi_allotments">Parcelas</string>
<string name="poi_allotments">Huertos comunitarios</string>
<string name="poi_forest">Bosque forestal</string>
<string name="poi_farmyard">Granja</string>
<string name="poi_meadow">Prado</string>
@ -345,7 +345,7 @@
<string name="poi_quarter">Distrito</string>
<string name="poi_neighbourhood">Vecindario</string>
<string name="poi_locality">Paraje</string>
<string name="poi_place_allotments">Parcelas</string>
<string name="poi_place_allotments">Huertos comunitarios</string>
<string name="poi_place_farm">Granja</string>
<string name="poi_residential">Área residencial</string>
@ -608,7 +608,7 @@
<string name="poi_bench">"Banco (asiento) "</string>
<string name="poi_swimming_pool">Piscina</string>
<string name="poi_water_park">Parque acuático</string>
<string name="poi_park">Parque / Plaza</string>
<string name="poi_park">Parque/Plaza</string>
<string name="poi_recreation_ground">Zona recreativa</string>
<string name="poi_village_green">Zona verde</string>
<string name="poi_trail_riding_station">Estación de equitación</string>
@ -1156,7 +1156,7 @@
<string name="poi_bunker_silo">Silo bunker</string>
<string name="poi_content_slurry">Contenido: Mezcla</string>
<string name="poi_brownfield">Suelo abandonado urbanizable</string>
<string name="poi_greenfield">Suelo urbanizable</string>
<string name="poi_greenfield">Suelo virgen urbanizable</string>
<string name="poi_wholesale">Venta mayorista</string>
<string name="poi_trade_building_supplies">Materiales de construcción</string>
@ -1334,7 +1334,7 @@
<string name="poi_grassland">Pastizal</string>
<string name="poi_scrub">Maleza</string>
<string name="poi_farmland">Suelo de cultivo</string>
<string name="poi_logging">Inicio de sesión</string>
<string name="poi_logging">Tala de árboles</string>
<string name="poi_sand">Arena</string>
<string name="poi_dead_wood">Bosque muerto</string>
@ -2086,7 +2086,7 @@
<string name="poi_clothes_oversize">Ropa de grandes tamaños</string>
<string name="poi_clothes_schoolwear">Ropa escolar</string>
<string name="poi_clothes_swimwear">Trajes de baño</string>
<string name="poi_clothes_socks">Medias / Calcetines</string>
<string name="poi_clothes_socks">Medias/Calcetines</string>
<string name="poi_clothes_shirts">Camisas</string>
<string name="poi_clothes_dance">Ropa de baile</string>
<string name="poi_clothes_military">Ropa militar</string>

View file

@ -155,7 +155,7 @@
<string name="poi_lighthouse">Faro</string>
<string name="poi_bicycle_rental">Alquiler de bicicletas</string>
<string name="poi_bicycle_parking">Bicicletero / Guardería</string>
<string name="poi_bicycle_parking">Bicicletero/Guardería</string>
<string name="poi_aerialway_gondola">Góndola</string>
<string name="poi_tunnel">Túnel</string>
@ -480,7 +480,7 @@
<string name="poi_quarry">Cantera</string>
<string name="poi_vineyard">Viñedo</string>
<string name="poi_allotments">Parcelas</string>
<string name="poi_allotments">Huertos comunitarios</string>
<string name="poi_forest">Bosque forestal</string>
<string name="poi_landuse_railway">Área ferroviaria</string>
@ -503,7 +503,7 @@
<string name="poi_tax_inspection">Inspecciones fiscales</string>
<string name="poi_customs">Aduanas</string>
<string name="poi_isolated_dwelling">Vivienda aislada</string>
<string name="poi_place_allotments">Parcelas</string>
<string name="poi_place_allotments">Huertos comunitarios</string>
<string name="poi_first_aid">Primeros auxilios</string>
<string name="poi_nursing_home">Residencia de ancianos</string>
<string name="poi_audiologist">Audiólogo</string>
@ -1158,8 +1158,8 @@
<string name="poi_content_salt">Contenido: Sal</string>
<string name="poi_content_grain">Contenido: Granos</string>
<string name="poi_brownfield">Terreno abandonado urbanizable</string>
<string name="poi_greenfield">Suelo urbanizable</string>
<string name="poi_brownfield">Suelo abandonado urbanizable</string>
<string name="poi_greenfield">Suelo virgen urbanizable</string>
<string name="poi_wholesale">Venta mayorista</string>
<string name="poi_trade_building_supplies">Materiales de construcción</string>
@ -1347,7 +1347,7 @@
<string name="poi_horse_riding">Equitación</string>
<string name="poi_heath">Brezal</string>
<string name="poi_logging">Inicio de sesión</string>
<string name="poi_logging">Tala de árboles</string>
<string name="poi_windfall">Fruto caído</string>
<string name="poi_rtsa_scale">Escala RTSA</string>
@ -2091,7 +2091,7 @@
<string name="poi_clothes_oversize">Ropa de grandes tamaños</string>
<string name="poi_clothes_schoolwear">Ropa escolar</string>
<string name="poi_clothes_swimwear">Trajes de baño</string>
<string name="poi_clothes_socks">Medias / Calcetines</string>
<string name="poi_clothes_socks">Medias/Calcetines</string>
<string name="poi_clothes_shirts">Camisas</string>
<string name="poi_clothes_dance">Ropa de baile</string>
<string name="poi_clothes_military">Ropa militar</string>

View file

@ -235,6 +235,18 @@ public class AudioVideoNotesPlugin extends OsmandPlugin {
return "";
}
public String getType(Context ctx) {
if (this.isAudio()) {
return ctx.getResources().getString(R.string.shared_string_audio);
} else if (this.isVideo()) {
return ctx.getResources().getString(R.string.shared_string_video);
} else if (this.isPhoto()) {
return ctx.getResources().getString(R.string.shared_string_photo);
} else {
return "";
}
}
public String getSearchHistoryType() {
if (isPhoto()) {
return PointDescription.POINT_TYPE_PHOTO_NOTE;

View file

@ -9,6 +9,7 @@ import net.osmand.data.PointDescription;
import net.osmand.plus.ContextMenuAdapter;
import net.osmand.plus.R;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.mapcontextmenu.MenuController.MenuType;
import net.osmand.plus.mapcontextmenu.MenuController.TitleButtonController;
import net.osmand.plus.mapcontextmenu.other.ShareMenu;
import net.osmand.plus.views.ContextMenuLayer;
@ -211,7 +212,7 @@ public class MapContextMenu extends MenuTitleController {
}
private void acquireMenuController() {
menuController = MenuController.getMenuController(mapActivity, pointDescription, object);
menuController = MenuController.getMenuController(mapActivity, pointDescription, object, MenuType.STANDARD);
}
public void onSingleTapOnMap() {

View file

@ -7,7 +7,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.GPXUtilities;
import net.osmand.plus.GPXUtilities.WptPt;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
@ -16,6 +15,7 @@ import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.audionotes.AudioVideoNotesPlugin.Recording;
import net.osmand.plus.helpers.SearchHistoryHelper;
import net.osmand.plus.mapcontextmenu.controllers.AmenityMenuController;
import net.osmand.plus.mapcontextmenu.controllers.AudioVideoNoteMenuController;
import net.osmand.plus.mapcontextmenu.controllers.EditPOIMenuController;
import net.osmand.plus.mapcontextmenu.controllers.FavouritePointMenuController;
import net.osmand.plus.mapcontextmenu.controllers.HistoryMenuController;
@ -23,7 +23,6 @@ import net.osmand.plus.mapcontextmenu.controllers.MyLocationMenuController;
import net.osmand.plus.mapcontextmenu.controllers.OsMoMenuController;
import net.osmand.plus.mapcontextmenu.controllers.ParkingPositionMenuController;
import net.osmand.plus.mapcontextmenu.controllers.PointDescriptionMenuController;
import net.osmand.plus.mapcontextmenu.controllers.AudioVideoNoteMenuController;
import net.osmand.plus.mapcontextmenu.controllers.TargetPointMenuController;
import net.osmand.plus.mapcontextmenu.controllers.WptPtMenuController;
import net.osmand.plus.mapcontextmenu.other.ShareMenu;
@ -38,8 +37,14 @@ public abstract class MenuController extends BaseMenuController {
public static final int FULL_SCREEN = 4;
}
public enum MenuType {
STANDARD,
MULTI_LINE
}
private MenuBuilder builder;
private int currentMenuState;
private MenuType menuType = MenuType.STANDARD;
protected TitleButtonController titleButtonController;
@ -84,7 +89,7 @@ public abstract class MenuController extends BaseMenuController {
}
public static MenuController getMenuController(MapActivity mapActivity,
PointDescription pointDescription, Object object) {
PointDescription pointDescription, Object object, MenuType menuType) {
OsmandApplication app = mapActivity.getMyApplication();
MenuController menuController = null;
if (object != null) {
@ -114,6 +119,9 @@ public abstract class MenuController extends BaseMenuController {
} else {
menuController = new PointDescriptionMenuController(app, mapActivity, pointDescription);
}
if (menuController != null) {
menuController.menuType = menuType;
}
return menuController;
}
@ -160,6 +168,10 @@ public abstract class MenuController extends BaseMenuController {
return currentMenuState;
}
public MenuType getMenuType() {
return menuType;
}
public boolean slideUp() {
int v = currentMenuState;
for (int i = 0; i < 2; i++) {
@ -205,7 +217,7 @@ public abstract class MenuController extends BaseMenuController {
}
public boolean needTypeStr() {
return false;
return menuType != MenuType.STANDARD;
}
public boolean displayStreetNameinTitle() {

View file

@ -121,7 +121,9 @@ public abstract class MenuTitleController {
if (Algorithms.isEmpty(nameStr)) {
if (!Algorithms.isEmpty(typeStr)) {
nameStr = typeStr;
typeStr = "";
if (menuController == null || menuController.getMenuType() == MenuController.MenuType.STANDARD) {
typeStr = "";
}
} else {
nameStr = getMapActivity().getString(R.string.address_unknown);
addressUnknown = true;

View file

@ -67,7 +67,9 @@ public class AudioVideoNoteMenuController extends MenuController {
@Override
public String getNameStr() {
File file = recording.getFile();
if (file != null) {
String recType = recording.getType(getMapActivity());
String recName = recording.getName(getMapActivity());
if (file != null && recType.equals(recName)) {
Date date = new Date(recording.getFile().lastModified());
return dateFormat.format(date);
} else {
@ -75,6 +77,11 @@ public class AudioVideoNoteMenuController extends MenuController {
}
}
@Override
public String getTypeStr() {
return recording.getType(getMapActivity());
}
@Override
public boolean needStreetName() {
return false;

View file

@ -9,6 +9,7 @@ import net.osmand.plus.TargetPointsHelper.TargetPoint;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.mapcontextmenu.MenuBuilder;
import net.osmand.plus.mapcontextmenu.MenuController;
import net.osmand.util.Algorithms;
public class TargetPointMenuController extends MenuController {
@ -61,16 +62,19 @@ public class TargetPointMenuController extends MenuController {
@Override
public String getNameStr() {
String name = "";
if (targetPoint.getOriginalPointDescription() != null) {
return targetPoint.getOriginalPointDescription().getSimpleName(getMapActivity(), false);
} else {
return targetPoint.getOnlyName();
name = targetPoint.getOriginalPointDescription().getSimpleName(getMapActivity(), false);
}
if (Algorithms.isEmpty(name)) {
name = getTypeStr();
}
return name;
}
@Override
public String getTypeStr() {
return targetPoint.getOnlyName();
return targetPoint.getPointDescription(getMapActivity()).getTypeName();
}
@Override
@ -80,6 +84,6 @@ public class TargetPointMenuController extends MenuController {
@Override
public boolean needStreetName() {
return true;
return Algorithms.isEmpty(targetPoint.getOnlyName());
}
}

View file

@ -8,6 +8,7 @@ import net.osmand.data.PointDescription;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.mapcontextmenu.BaseMenuController;
import net.osmand.plus.mapcontextmenu.MenuController;
import net.osmand.plus.mapcontextmenu.MenuController.MenuType;
import net.osmand.plus.mapcontextmenu.MenuTitleController;
import net.osmand.plus.views.ContextMenuLayer;
import net.osmand.plus.views.ContextMenuLayer.IContextMenuProvider;
@ -47,7 +48,7 @@ public class ObjectSelectionMenu extends BaseMenuController {
}
protected void init() {
controller = MenuController.getMenuController(mapActivity, pointDescription, object);
controller = MenuController.getMenuController(mapActivity, pointDescription, object, MenuType.MULTI_LINE);
initTitle();
}

View file

@ -551,7 +551,9 @@ public class ParkingPositionPlugin extends OsmandPlugin {
timeStringBuilder.append(ctx.getString(R.string.osmand_parking_hour));
}
timeStringBuilder.append(" ");
if (timeStringBuilder.length() > 0) {
timeStringBuilder.append(" ");
}
timeStringBuilder.append(minutes);
timeStringBuilder.append(" ");
timeStringBuilder.append(ctx.getString(R.string.osmand_parking_minute));