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

This commit is contained in:
Victor Shcherb 2015-11-16 09:32:05 +01:00
commit 26a5d9f117
14 changed files with 76 additions and 53 deletions

View file

@ -2039,6 +2039,11 @@
<string name="poi_dialog_reopen">Genåbn</string>
<string name="osn_close_dialog_success">Fejl lukket</string>
<string name="osm_edit_modified_poi">Redigeret OSM IP</string>
<string name="osm_edit_modified_poi">Ændret OSM IP</string>
<string name="osm_edit_deleted_poi">Slettet OSM IP</string>
<string name="release_2_2">" • Ny kontekstafhængig brugergrænseflade til at trykke steder på kortet og på andre skærme\n\n  • Kortskærmen vises direkte, medmindre \'Vis Oversigt ved start\' er valgt\n\n  • Oversigten har konfiguration for hvordan kort kan vises\n\n  • Kort kan vælges direkte og hentes fra verdenskortet\n\n  • Bedre rutegenberegning (efter gentagene forsøg foreslås nu en anden vej)\n\n  • IP søgning understøtter nu mere specifikke forespørgsler\n\n  • Forbedret IP og OSM redigeringsfunktionalitet\n\n  • Kort dataoverførsel struktur og grænseflade omarbejdet\n\n  og mere... "</string>
<string name="osm_save_offline">Gem offline</string>
<string name="rendering_attr_currentTrackColor_description">GPX-farve</string>
<string name="rendering_attr_currentTrackWidth_description">GPX-bredde</string>
<string name="rendering_attr_roadStyle_description">Vejformat</string>
</resources>

View file

@ -1956,7 +1956,7 @@
<string name="poi_context_menu_modify_osm_change">Modificar cambio OSM</string>
<string name="osm_edit_modified_poi">PDI de OSM modificado</string>
<string name="osm_edit_deleted_poi">PDI de OSM borrado</string>
<string name="context_menu_item_open_note">Nota OSM abierta</string>
<string name="context_menu_item_open_note">Abrir nota OSM</string>
<string name="osm_edit_reopened_note">Nota OSM reabierta</string>
<string name="osm_edit_commented_note">Nota OSM comentada</string>
<string name="osm_edit_removed_note">Nota OSM borrada</string>
@ -1979,4 +1979,5 @@
<string name="rendering_attr_roadStyle_description">Estilo de carretera</string>
<string name="poi_dialog_reopen">Reabrir</string>
<string name="osm_save_offline">Guardar sin conexión</string>
<string name="release_2_2">" • Nueva interfaz de usuario sensible al contexto para aprovechar lugares en el mapa y en otra pantallas\n\n• La pantalla del mapa, ahora se inicia directamente, a menos que \'Mostrar panel de control en el arranque de la aplicación\' este seleccionado\n\n• El tablero de instrumentos, posee el opción de que tarjetas se visualizarán\n\n• Los mapas, pueden seleccionarse directamente y descargar el mapa mundial\n\n• Mejor recálculo de la ruta (después de reiterados intentos, el motor ahora sugiere una ruta diferente)\n\n• La búsqueda de PDI, ahora soporta consultas más específicas\n\n• Mejoras en PDI y funcionalidad de edición OSM\n\n• Se rediseñó la estructura e interfaz de los datos de mapas\n\n y más... "</string>
</resources>

View file

@ -1953,7 +1953,7 @@
<string name="context_menu_item_delete_waypoint">¿Borrar punto de ruta GPX?</string>
<string name="context_menu_item_edit_waypoint">Editar punto de ruta GPX</string>
<string name="context_menu_item_open_note">Nota OSM abierta</string>
<string name="context_menu_item_open_note">Abrir nota OSM</string>
<string name="osm_edit_reopened_note">Nota OSM reabierta</string>
<string name="osm_edit_commented_note">Nota OSM comentada</string>
<string name="osm_edit_removed_note">Nota OSM borrada</string>
@ -1976,4 +1976,5 @@
<string name="rendering_attr_currentTrackWidth_description">Ancho del GPX</string>
<string name="rendering_attr_roadStyle_description">Estilo de carretera</string>
<string name="osm_save_offline">Guardar sin conexión</string>
<string name="release_2_2">" • Nueva interfaz de usuario sensible al contexto para aprovechar lugares en el mapa y en otra pantallas\n\n• La pantalla del mapa, ahora se inicia directamente, a menos que \'Mostrar panel de control en el arranque de la aplicación\' este seleccionado\n\n• El tablero de instrumentos, posee el opción de que tarjetas se visualizarán\n\n• Los mapas, pueden seleccionarse directamente y descargar el mapa mundial\n\n• Mejor recálculo de la ruta (después de reiterados intentos, el motor ahora sugiere una ruta diferente)\n\n• La búsqueda de PDI, ahora soporta consultas más específicas\n\n• Mejoras en PDI y funcionalidad de edición OSM\n\n• Se rediseñó la estructura e interfaz de los datos de mapas\n\n y más... "</string>
</resources>

View file

@ -2003,4 +2003,5 @@
<string name="rendering_attr_roadStyle_description">道路樣式</string>
<string name="poi_dialog_reopen">重新開啟</string>
<string name="osm_save_offline">離線儲存</string>
<string name="release_2_2">" •在地圖上和其它螢幕上,為點擊位置做了新的敏捷內容選單使用者界面\n\n•地圖螢幕上現在除了直接啟動外還有\'在應用程式時啟動顯示儀表板\'可選\n\n •儀表板能組態怎樣的卡可以顯示\n\n •在全球地圖上地圖可以直接選擇和下載\n\n •更好的重新計算路線現在引擎經過反復的嘗試建議一條不同的路線\n\n •興趣點搜尋現在支援更具體的查詢\n\n •改善過的興趣點和 OSM 編輯功能\n\n •地圖資料下載結構和界面重新設計\n\n 還有更多... "</string>
</resources>

View file

@ -1,4 +1,4 @@
package net.osmand.plus.mapcontextmenu.builders;
package net.osmand.plus.audionotes;
import android.content.Intent;
import android.graphics.Bitmap;

View file

@ -1,4 +1,4 @@
package net.osmand.plus.mapcontextmenu.controllers;
package net.osmand.plus.audionotes;
import android.content.DialogInterface;
import android.content.Intent;
@ -12,11 +12,9 @@ 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.audionotes.AudioVideoNotesPlugin;
import net.osmand.plus.audionotes.AudioVideoNotesPlugin.Recording;
import net.osmand.plus.mapcontextmenu.MapContextMenuFragment;
import net.osmand.plus.mapcontextmenu.MenuController;
import net.osmand.plus.mapcontextmenu.builders.AudioVideoNoteMenuBuilder;
import java.lang.ref.WeakReference;

View file

@ -10,6 +10,7 @@ import net.osmand.plus.ContextMenuAdapter;
import net.osmand.plus.GPXUtilities.WptPt;
import net.osmand.plus.R;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.mapcontextmenu.MenuController.MenuState;
import net.osmand.plus.mapcontextmenu.MenuController.MenuType;
import net.osmand.plus.mapcontextmenu.MenuController.TitleButtonController;
import net.osmand.plus.mapcontextmenu.MenuController.TitleProgressController;
@ -443,7 +444,7 @@ public class MapContextMenu extends MenuTitleController {
if (menuController != null) {
return menuController.getCurrentMenuState();
} else {
return MenuController.MenuState.HEADER_ONLY;
return MenuState.HEADER_ONLY;
}
}

View file

@ -36,10 +36,10 @@ import net.osmand.plus.IconsCache;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.R;
import net.osmand.plus.TargetPointsHelper.TargetPoint;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.dashboard.DashLocationFragment;
import net.osmand.plus.download.DownloadIndexesThread.DownloadEvents;
import net.osmand.plus.mapcontextmenu.MenuController.MenuState;
import net.osmand.plus.mapcontextmenu.MenuController.TitleButtonController;
import net.osmand.plus.mapcontextmenu.MenuController.TitleProgressController;
import net.osmand.plus.views.AnimateDraggingMapThread;
@ -251,7 +251,7 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents {
showOnMap(menu.getLatLon(), true, false);
if (hasMoved) {
applyPosY(getViewY(), false, false);
applyPosY(getViewY(), false, false, 0, 0);
}
return true;
}
@ -318,9 +318,13 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents {
}
}
int newMenuState = menu.getCurrentMenuState();
boolean needMapAdjust = oldMenuState != newMenuState && newMenuState != MenuController.MenuState.FULL_SCREEN;
boolean needMapAdjust = oldMenuState != newMenuState && newMenuState != MenuState.FULL_SCREEN;
applyPosY(currentY, needCloseMenu, needMapAdjust);
if (newMenuState != oldMenuState) {
doBeforeMenuStateChange(oldMenuState, newMenuState);
}
applyPosY(currentY, needCloseMenu, needMapAdjust, oldMenuState, newMenuState);
break;
@ -328,7 +332,8 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents {
return true;
}
private void applyPosY(final int currentY, final boolean needCloseMenu, boolean needMapAdjust) {
private void applyPosY(final int currentY, final boolean needCloseMenu, boolean needMapAdjust,
final int previousMenuState, final int newMenuState) {
final int posY = getPosY(needCloseMenu);
if (currentY != posY) {
if (posY < currentY) {
@ -346,6 +351,9 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents {
menu.close();
} else {
updateMainViewLayout(posY);
if (previousMenuState != 0 && newMenuState != 0 && previousMenuState != newMenuState) {
doAfterMenuStateChange(previousMenuState, newMenuState);
}
}
}
@ -355,6 +363,9 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents {
menu.close();
} else {
updateMainViewLayout(posY);
if (previousMenuState != 0 && newMenuState != 0 && previousMenuState != newMenuState) {
doAfterMenuStateChange(previousMenuState, newMenuState);
}
}
}
})
@ -370,7 +381,14 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents {
}
} else {
setViewY(posY, false, needMapAdjust);
updateMainViewLayout(posY);
if (needCloseMenu) {
menu.close();
} else {
updateMainViewLayout(posY);
if (previousMenuState != 0 && newMenuState != 0 && previousMenuState != newMenuState) {
doAfterMenuStateChange(previousMenuState, newMenuState);
}
}
}
}
}
@ -721,12 +739,20 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents {
}
line2.setText(line2Str.toString());
updateCompassVisibility();
}
private void updateCompassVisibility() {
View compassView = view.findViewById(R.id.compass_layout);
if (menu.displayDistanceDirection()) {
if (menu.displayDistanceDirection() && menu.getCurrentMenuState() != MenuState.FULL_SCREEN) {
updateDistanceDirection();
compassView.setVisibility(View.VISIBLE);
} else {
compassView.setVisibility(View.GONE);
if (!menu.displayDistanceDirection()) {
compassView.setVisibility(View.GONE);
} else {
compassView.setVisibility(View.INVISIBLE);
}
}
}
@ -754,20 +780,20 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents {
destinationState = menu.getCurrentMenuState();
minHalfY = viewHeight - (int)(viewHeight * menu.getHalfScreenMaxHeightKoef());
} else {
destinationState = MenuController.MenuState.HEADER_ONLY;
destinationState = MenuState.HEADER_ONLY;
minHalfY = viewHeight;
}
int posY = 0;
switch (destinationState) {
case MenuController.MenuState.HEADER_ONLY:
case MenuState.HEADER_ONLY:
posY = viewHeight - (menuTitleHeight - dpToPx(SHADOW_HEIGHT_BOTTOM_DP));
break;
case MenuController.MenuState.HALF_SCREEN:
case MenuState.HALF_SCREEN:
posY = viewHeight - menuFullHeightMax;
posY = Math.max(posY, minHalfY);
break;
case MenuController.MenuState.FULL_SCREEN:
case MenuState.FULL_SCREEN:
posY = -menuTopShadowHeight - dpToPx(SHADOW_HEIGHT_TOP_DP);
break;
default:
@ -978,5 +1004,12 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents {
public void updateLocation(boolean centerChanged, boolean locationChanged, boolean compassChanged) {
updateDistanceDirection();
}
private void doBeforeMenuStateChange(int previousState, int newState) {
}
private void doAfterMenuStateChange(int previousState, int newState) {
updateCompassVisibility();
}
}

View file

@ -9,7 +9,6 @@ import net.osmand.data.FavouritePoint;
import net.osmand.data.LatLon;
import net.osmand.data.PointDescription;
import net.osmand.plus.GPXUtilities.WptPt;
import net.osmand.plus.GpxSelectionHelper;
import net.osmand.plus.GpxSelectionHelper.GpxDisplayItem;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
@ -18,16 +17,16 @@ 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.audionotes.AudioVideoNoteMenuController;
import net.osmand.plus.osmedit.EditPOIMenuController;
import net.osmand.plus.mapcontextmenu.controllers.FavouritePointMenuController;
import net.osmand.plus.mapcontextmenu.controllers.GpxItemMenuController;
import net.osmand.plus.mapcontextmenu.controllers.HistoryMenuController;
import net.osmand.plus.mapcontextmenu.controllers.MapDataMenuController;
import net.osmand.plus.mapcontextmenu.controllers.MyLocationMenuController;
import net.osmand.plus.mapcontextmenu.controllers.OsMoMenuController;
import net.osmand.plus.mapcontextmenu.controllers.OsmBugMenuController;
import net.osmand.plus.mapcontextmenu.controllers.ParkingPositionMenuController;
import net.osmand.plus.osmo.OsMoMenuController;
import net.osmand.plus.osmedit.OsmBugMenuController;
import net.osmand.plus.parkingpoint.ParkingPositionMenuController;
import net.osmand.plus.mapcontextmenu.controllers.PointDescriptionMenuController;
import net.osmand.plus.mapcontextmenu.controllers.TargetPointMenuController;
import net.osmand.plus.mapcontextmenu.controllers.WptPtMenuController;
@ -38,7 +37,7 @@ import net.osmand.plus.osmo.OsMoGroupsStorage.OsMoDevice;
public abstract class MenuController extends BaseMenuController {
public class MenuState {
public static class MenuState {
public static final int HEADER_ONLY = 1;
public static final int HALF_SCREEN = 2;
public static final int FULL_SCREEN = 4;

View file

@ -1,4 +1,4 @@
package net.osmand.plus.mapcontextmenu.builders;
package net.osmand.plus.osmedit;
import android.graphics.drawable.Drawable;
import android.text.TextUtils;
@ -12,9 +12,6 @@ import android.widget.TextView;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
import net.osmand.plus.mapcontextmenu.MenuBuilder;
import net.osmand.plus.osmedit.OpenstreetmapPoint;
import net.osmand.plus.osmedit.OsmNotesPoint;
import net.osmand.plus.osmedit.OsmPoint;
import java.util.Map;

View file

@ -1,6 +1,8 @@
package net.osmand.plus.mapcontextmenu.controllers;
package net.osmand.plus.osmedit;
import java.util.Map;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.graphics.drawable.Drawable;
import net.osmand.access.AccessibleAlertBuilder;
import net.osmand.data.PointDescription;
@ -10,22 +12,12 @@ import net.osmand.plus.ProgressImplementation;
import net.osmand.plus.R;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.mapcontextmenu.MenuController;
import net.osmand.plus.mapcontextmenu.builders.EditPOIMenuBuilder;
import net.osmand.plus.osmedit.OpenstreetmapPoint;
import net.osmand.plus.osmedit.OsmBugsLayer;
import net.osmand.plus.osmedit.OsmEditingPlugin;
import net.osmand.plus.osmedit.OsmEditsUploadListener;
import net.osmand.plus.osmedit.OsmEditsUploadListenerHelper;
import net.osmand.plus.osmedit.OsmNotesPoint;
import net.osmand.plus.osmedit.OsmPoint;
import net.osmand.plus.osmedit.OsmPoint.Action;
import net.osmand.plus.osmedit.UploadOpenstreetmapPointAsyncTask;
import net.osmand.plus.osmedit.dialogs.SendPoiDialogFragment;
import net.osmand.plus.osmedit.dialogs.SendPoiDialogFragment.ProgressDialogPoiUploader;
import net.osmand.util.Algorithms;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.graphics.drawable.Drawable;
import java.util.Map;
public class EditPOIMenuController extends MenuController {

View file

@ -1,4 +1,4 @@
package net.osmand.plus.mapcontextmenu.controllers;
package net.osmand.plus.osmedit;
import android.graphics.drawable.Drawable;
@ -11,7 +11,6 @@ import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.mapcontextmenu.MenuBuilder;
import net.osmand.plus.mapcontextmenu.MenuController;
import net.osmand.plus.osmedit.OsmBugsLayer.OpenStreetNote;
import net.osmand.plus.osmedit.OsmEditingPlugin;
public class OsmBugMenuController extends MenuController {

View file

@ -1,4 +1,4 @@
package net.osmand.plus.mapcontextmenu.controllers;
package net.osmand.plus.osmo;
import android.graphics.drawable.Drawable;
@ -13,10 +13,7 @@ import net.osmand.plus.TargetPointsHelper;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.mapcontextmenu.MenuBuilder;
import net.osmand.plus.mapcontextmenu.MenuController;
import net.osmand.plus.osmo.OsMoGroupsActivity;
import net.osmand.plus.osmo.OsMoGroupsStorage.OsMoDevice;
import net.osmand.plus.osmo.OsMoPlugin;
import net.osmand.plus.osmo.OsMoPositionLayer;
public class OsMoMenuController extends MenuController {

View file

@ -1,4 +1,4 @@
package net.osmand.plus.mapcontextmenu.controllers;
package net.osmand.plus.parkingpoint;
import android.graphics.drawable.Drawable;
@ -9,7 +9,6 @@ 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;
public class ParkingPositionMenuController extends MenuController {