From f8616e04d71f40ee1344848ff804c27fb70f8882 Mon Sep 17 00:00:00 2001 From: jan madsen Date: Wed, 18 Nov 2015 17:11:11 +0100 Subject: [PATCH 01/36] Translated using Weblate (Danish) Currently translated at 100.0% (1831 of 1831 strings) --- OsmAnd/res/values-da/strings.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OsmAnd/res/values-da/strings.xml b/OsmAnd/res/values-da/strings.xml index 5f9dbc35a6..ce74a313dc 100644 --- a/OsmAnd/res/values-da/strings.xml +++ b/OsmAnd/res/values-da/strings.xml @@ -2105,8 +2105,8 @@ Nyt valg for opstart Vælg om programmet starter med at vise korter eller oversigtspanel først. Kan ændres i indstillinger for oversigtspanel. - Start altid med oversigtspanel - Start altid med kortet + Start med oversigtspanel + Start med kortet Placerer en knap til oversigtspanelet på kortskærmen Adgang fra kort From 3abb5772c8da86e327116b05fbd1f2313e0afb4c Mon Sep 17 00:00:00 2001 From: Alexey Kulish Date: Wed, 18 Nov 2015 20:03:58 +0300 Subject: [PATCH 02/36] Context menu fixes --- OsmAnd/src/net/osmand/plus/helpers/GpxUiHelper.java | 4 +++- OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java | 2 +- .../mapcontextmenu/other/MapMultiSelectionMenuFragment.java | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/helpers/GpxUiHelper.java b/OsmAnd/src/net/osmand/plus/helpers/GpxUiHelper.java index 8313b62955..a0a72aadf7 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/GpxUiHelper.java +++ b/OsmAnd/src/net/osmand/plus/helpers/GpxUiHelper.java @@ -182,7 +182,9 @@ public class GpxUiHelper { } for (SelectedGpxFile selectedGpx : selectedGpxFiles) { - list.add(selectedGpx.getGpxFile().path.substring(gpxDirLength + 1)); + if (!selectedGpx.getGpxFile().showCurrentTrack) { + list.add(selectedGpx.getGpxFile().path.substring(gpxDirLength + 1)); + } } final ContextMenuAdapter adapter = createGpxContextMenuAdapter(activity, list, null, false, diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java index 3502269c7a..a4be0bf18d 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java @@ -406,7 +406,7 @@ public class MapContextMenu extends MenuTitleController { final List list = mapActivity.getMyApplication().getSelectedGpxHelper().getSelectedGPXFiles(); - if (list.isEmpty()) { + if (list.isEmpty() || (list.size() == 1 && list.get(0).getGpxFile().showCurrentTrack)) { GPXFile gpxFile = mapActivity.getMyApplication().getSavingTrackHelper().getCurrentGpx(); getWptPtPointEditor().add(gpxFile, latLon, title); } else { diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/MapMultiSelectionMenuFragment.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/MapMultiSelectionMenuFragment.java index 4394724d06..7cddc6dddb 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/MapMultiSelectionMenuFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/MapMultiSelectionMenuFragment.java @@ -59,6 +59,7 @@ public class MapMultiSelectionMenuFragment extends Fragment implements AdapterVi @Override public void onStart() { super.onStart(); + menu.getMapActivity().getMapLayers().getMapControlsLayer().setControlsClickable(false); menu.getMapActivity().getContextMenu().setBaseFragmentVisibility(false); } @@ -69,6 +70,7 @@ public class MapMultiSelectionMenuFragment extends Fragment implements AdapterVi menu.onStop(); } menu.getMapActivity().getContextMenu().setBaseFragmentVisibility(true); + menu.getMapActivity().getMapLayers().getMapControlsLayer().setControlsClickable(true); } public static void showInstance(final MapActivity mapActivity) { From 8fa327849a6b4a9402e56adb86a3b8754ac595cd Mon Sep 17 00:00:00 2001 From: xmd5a Date: Wed, 18 Nov 2015 21:48:11 +0300 Subject: [PATCH 03/36] Fix ru string --- OsmAnd/res/values-ru/phrases.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/res/values-ru/phrases.xml b/OsmAnd/res/values-ru/phrases.xml index 417d1cad9a..82eb9f556b 100644 --- a/OsmAnd/res/values-ru/phrases.xml +++ b/OsmAnd/res/values-ru/phrases.xml @@ -773,7 +773,7 @@ Здоровье Еда Проживание - Инфраструктура + Рукотворное Административные объекты Морские объекты Доступ в Интернет: беспроводной From 5464031d8eabc03d21ad42030f0414d9d4c994b2 Mon Sep 17 00:00:00 2001 From: ace shadow Date: Wed, 18 Nov 2015 20:14:10 +0100 Subject: [PATCH 04/36] Translated using Weblate (Slovak) Currently translated at 100.0% (1831 of 1831 strings) --- OsmAnd/res/values-sk/strings.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OsmAnd/res/values-sk/strings.xml b/OsmAnd/res/values-sk/strings.xml index 5df0e45c28..cd4ae5548e 100644 --- a/OsmAnd/res/values-sk/strings.xml +++ b/OsmAnd/res/values-sk/strings.xml @@ -1931,6 +1931,6 @@ Afganistan, Albánsko, Alžírsko, Andora, Angola, Anguilla, Antigua a Barbuda, Teraz si môžete zvoliť či aplikácia po štarte spustí obrazovku mapy alebo úvodný panel. Toto nastavenie môžete neskôr zmeniť v nastaveniach panela. Umiestni na obrazovku mapy tlačidlo úvodného panela Prístup z mapy - Vždy spustiť úvodný panel - Vždy spustiť mapu + Spustiť úvodný panel + Spustiť mapu From 4d7134d831b5845db66adbb5b50145749c849bb0 Mon Sep 17 00:00:00 2001 From: xmd5a Date: Wed, 18 Nov 2015 22:52:53 +0300 Subject: [PATCH 05/36] Update strings --- OsmAnd/res/values-ru/strings.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OsmAnd/res/values-ru/strings.xml b/OsmAnd/res/values-ru/strings.xml index 300600293b..ad862b6b92 100644 --- a/OsmAnd/res/values-ru/strings.xml +++ b/OsmAnd/res/values-ru/strings.xml @@ -1,5 +1,7 @@ + Цвет трека GPX + Толщина трека GPX Скопировано в буфер обмена Стиль отображения дорог Нижненемецкий From f6825bc921a70dc95db454d6b9aca5d69dfb884e Mon Sep 17 00:00:00 2001 From: xmd5a Date: Wed, 18 Nov 2015 23:02:01 +0300 Subject: [PATCH 06/36] Update ru strings --- OsmAnd/res/values-ru/strings.xml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/OsmAnd/res/values-ru/strings.xml b/OsmAnd/res/values-ru/strings.xml index ad862b6b92..8daf7a3122 100644 --- a/OsmAnd/res/values-ru/strings.xml +++ b/OsmAnd/res/values-ru/strings.xml @@ -1,5 +1,22 @@ + Заметка OSM открыта снова + К заметке OSM добавлен комментарий + Заметка OSM удалена + Заметка OSM создана + Заметка OSM + Создание заметки + Добавление комментария + Повторное открытие заметки + Закрытие заметки + Заметка успешно создана + Ошибка: заметка не была создана + Заметка было успешно закрыта + Ошибка: заметка не была закрыта + OSM POI удалена + OSM POI отредактирована + Сохранить локально + Добавить заметку OSM Цвет трека GPX Толщина трека GPX Скопировано в буфер обмена From 23c1cc4d5fc4b5f5fbe7acb1536b33c572723032 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Wed, 18 Nov 2015 21:38:23 +0100 Subject: [PATCH 07/36] Fix poi issues for editing --- .../src/net/osmand/osm/MapPoiTypes.java | 3 + .../plus/osmedit/EditPoiDialogFragment.java | 74 ++++++++++--------- .../dialogs/PoiSubTypeDialogFragment.java | 12 ++- .../dialogs/PoiTypeDialogFragment.java | 2 +- 4 files changed, 53 insertions(+), 38 deletions(-) diff --git a/OsmAnd-java/src/net/osmand/osm/MapPoiTypes.java b/OsmAnd-java/src/net/osmand/osm/MapPoiTypes.java index 151d9e2913..d2f14e9f36 100644 --- a/OsmAnd-java/src/net/osmand/osm/MapPoiTypes.java +++ b/OsmAnd-java/src/net/osmand/osm/MapPoiTypes.java @@ -146,6 +146,9 @@ public class MapPoiTypes { public Map getAllTranslatedNames(boolean skipNonEditable) { Map translation = new HashMap(); for(PoiCategory pc : categories) { + if(skipNonEditable && pc.isNotEditableOsm()) { + continue; + } for(PoiType pt : pc.getPoiTypes()) { if(pt.isReference() ) { continue; diff --git a/OsmAnd/src/net/osmand/plus/osmedit/EditPoiDialogFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/EditPoiDialogFragment.java index dd632e82e4..dd989f1f6e 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/EditPoiDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/EditPoiDialogFragment.java @@ -44,7 +44,6 @@ import android.widget.ImageButton; import android.widget.LinearLayout; import android.widget.TextView; import android.widget.Toast; - import net.osmand.CallbackWithObject; import net.osmand.PlatformUtil; import net.osmand.access.AccessibleToast; @@ -253,17 +252,35 @@ public class EditPoiDialogFragment extends DialogFragment { @Override public void afterTextChanged(Editable s) { if (!getEditPoiData().isInEdit()) { - PoiType pt = getEditPoiData().getAllTranslatedSubTypes().get(s.toString().toLowerCase()); - if(pt != null) { - poiTypeTextInputLayout.setHint(pt.getCategory().getTranslation()); - } getEditPoiData().updateTypeTag(s.toString()); + poiTypeTextInputLayout.setHint(editPoiData.getPoiCategory().getTranslation()); } } }); poiNameEditText.setOnEditorActionListener(mOnEditorActionListener); poiTypeEditText.setOnEditorActionListener(mOnEditorActionListener); poiTypeEditText.setText(editPoiData.getPoiTypeString()); + poiTypeEditText.setOnTouchListener(new View.OnTouchListener() { + @Override + public boolean onTouch(final View v, MotionEvent event) { + final EditText editText = (EditText) v; + final int DRAWABLE_RIGHT = 2; + if (event.getAction() == MotionEvent.ACTION_UP) { + if (event.getX() >= (editText.getRight() + - editText.getCompoundDrawables()[DRAWABLE_RIGHT].getBounds().width() + - editText.getPaddingRight())) { + if (editPoiData.getPoiCategory() != null) { + DialogFragment dialogFragment = + PoiSubTypeDialogFragment.createInstance(editPoiData.getPoiCategory()); + dialogFragment.show(getChildFragmentManager(), "PoiSubTypeDialogFragment"); + } + + return true; + } + } + return false; + } + }); Button saveButton = (Button) view.findViewById(R.id.saveButton); saveButton.setText(mOpenstreetmapUtil instanceof OpenstreetmapRemoteUtil @@ -299,7 +316,7 @@ public class EditPoiDialogFragment extends DialogFragment { HashSet tagsCopy = new HashSet<>(); tagsCopy.addAll(editPoiData.getTagValues().keySet()); tagsCopy.removeAll(BASIC_TAGS); - if (tagsCopy.isEmpty()) { + if (tagsCopy.isEmpty() || editPoiData.getPoiCategory() == getMyApplication().getPoiTypes().getOtherPoiCategory()) { poiTypeEditText.setError(getResources().getString(R.string.please_specify_poi_type)); } else { new SaveWithAdvancedTagsDialogFragment().show(getChildFragmentManager(), "dialog"); @@ -446,41 +463,26 @@ public class EditPoiDialogFragment extends DialogFragment { }.execute(); } - public void updateType(PoiCategory type) { + public void setPoiCategory(PoiCategory type) { editPoiData.updateType(type); poiTypeEditText.setText(editPoiData.getPoiTypeString()); - poiTypeTextInputLayout.setHint(editPoiData.getPoiCategory().getTranslation()); setAdapterForPoiTypeEditText(); - poiTypeEditText.setOnTouchListener(new View.OnTouchListener() { - @Override - public boolean onTouch(final View v, MotionEvent event) { - final EditText editText = (EditText) v; - final int DRAWABLE_RIGHT = 2; - if (event.getAction() == MotionEvent.ACTION_UP) { - if (event.getX() >= (editText.getRight() - - editText.getCompoundDrawables()[DRAWABLE_RIGHT].getBounds().width() - - editText.getPaddingRight())) { - if (editPoiData.getPoiCategory() != null) { - DialogFragment dialogFragment = - PoiSubTypeDialogFragment.createInstance(editPoiData.getPoiCategory()); - dialogFragment.show(getChildFragmentManager(), "PoiSubTypeDialogFragment"); - } - - return true; - } - } - return false; - } - }); } private void setAdapterForPoiTypeEditText() { final Map subCategories = new LinkedHashMap<>(); - for (Map.Entry s : editPoiData.getAllTranslatedSubTypes().entrySet()) { - if (!subCategories.containsKey(s.getKey())) { - subCategories.put(Algorithms.capitalizeFirstLetterAndLowercase(s.getKey()), s.getValue()); + PoiCategory ct = editPoiData.getPoiCategory(); + if(ct != null) { + for (PoiType s : ct.getPoiTypes()) { + if(!s.isReference() && !s.isNotEditableOsm() && s.getBaseLangType() == null) { + addMapEntryAdapter(subCategories, s.getTranslation(), s); + addMapEntryAdapter(subCategories, s.getKeyName().replace('_', ' '), s); + } } } + for (Map.Entry s : editPoiData.getAllTranslatedSubTypes().entrySet()) { + addMapEntryAdapter(subCategories, s.getKey(), s.getValue()); + } final ArrayAdapter adapter; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { adapter = new ArrayAdapter<>(getActivity(), @@ -518,7 +520,7 @@ public class EditPoiDialogFragment extends DialogFragment { //noinspection SuspiciousMethodCalls PoiType pt = subCategories.get(item); String keyName = pt.getKeyName(); - poiTypeTextInputLayout.setHint(pt.getCategory().getTranslation()); + setAdapterForPoiTypeEditText(); poiTypeEditText.setText(keyName); } } @@ -530,6 +532,12 @@ public class EditPoiDialogFragment extends DialogFragment { } + private void addMapEntryAdapter(final Map subCategories, String key, PoiType v) { + if (!subCategories.containsKey(key.toLowerCase())) { + subCategories.put(Algorithms.capitalizeFirstLetterAndLowercase(key), v); + } + } + private OsmandApplication getMyApplication() { return (OsmandApplication) getActivity().getApplication(); } diff --git a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/PoiSubTypeDialogFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/PoiSubTypeDialogFragment.java index 1b4cd7495d..a25295985f 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/PoiSubTypeDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/PoiSubTypeDialogFragment.java @@ -1,7 +1,7 @@ package net.osmand.plus.osmedit.dialogs; -import java.util.Map; -import java.util.Set; +import java.util.ArrayList; +import java.util.List; import net.osmand.osm.MapPoiTypes; import net.osmand.osm.PoiCategory; @@ -24,8 +24,12 @@ public class PoiSubTypeDialogFragment extends DialogFragment { MapPoiTypes poiTypes = ((OsmandApplication) getActivity().getApplication()).getPoiTypes(); AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); final PoiCategory a = poiTypes.getPoiCategoryByName((String) getArguments().getSerializable(KEY_POI_CATEGORY)); - final Map allTranslatedNames = poiTypes.getAllTranslatedNames(a, true); - Set strings = allTranslatedNames.keySet(); + List strings = new ArrayList<>(); + for (PoiType s : a.getPoiTypes()) { + if (!s.isReference() && !s.isNotEditableOsm() && s.getBaseLangType() == null) { + strings.add(s.getTranslation()); + } + } final String[] subCats = strings.toArray(new String[strings.size()]); builder.setItems(subCats, new DialogInterface.OnClickListener() { @Override diff --git a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/PoiTypeDialogFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/PoiTypeDialogFragment.java index 87503ca636..287d9b27a9 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/PoiTypeDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/PoiTypeDialogFragment.java @@ -36,7 +36,7 @@ public class PoiTypeDialogFragment extends DialogFragment { @Override public void onClick(DialogInterface dialog, int which) { PoiCategory aType = categories.get(which); - ((EditPoiDialogFragment) getParentFragment()).updateType(aType); + ((EditPoiDialogFragment) getParentFragment()).setPoiCategory(aType); dismiss(); } }); From 2b619d4c2c124e50a5f3194b98507357e8adad41 Mon Sep 17 00:00:00 2001 From: Ajeje Brazorf Date: Wed, 18 Nov 2015 21:40:14 +0100 Subject: [PATCH 08/36] Translated using Weblate (Sardinian) Currently translated at 100.0% (1831 of 1831 strings) --- OsmAnd/res/values-sc/strings.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OsmAnd/res/values-sc/strings.xml b/OsmAnd/res/values-sc/strings.xml index 48a3b839b2..eaf9e9d270 100644 --- a/OsmAnd/res/values-sc/strings.xml +++ b/OsmAnd/res/values-sc/strings.xml @@ -2020,8 +2020,8 @@ Istile pro sas istradas Issèbera noa de allumìngiu Como podes isseberare sa mègius manera de allumìngiu de s\'aplicatzione, deretamente dae sa mapa o cun su pannellu de controllu in antis. As a pòdere semper cambiare s’issèbera tua prus a tardu in sas impostatziones de su pannellu. - Ammustra semper su pannellu de controllu - Ammustra semper sa mapa + Ammustra su pannellu de controllu + Ammustra sa mapa Pone unu butone pro su pannellu de controllu in s’ischermu de sa mapa Intra dae sa mapa " • Interfache impitadore noa pro incarcare positziones in sa mapa e in àteros ischermos\n\n • S\'ischermu de sa mapa est como postu come prima cosa a s’allumìngiu de s’aplicatzione, semper chi \'Ammustra pannellu de controllu in s\'allumìngiu\' no siet ischertadu\n\n • Como podes cunfigurare sas impostatziones pro isseberare cales sunt sas ischedas chi diant dèper’èssere ammustradas in su pannellu e comente\n\n • Pro iscarrigare mapas, sas regiones podent èssere ischertadas deretamente incarcande in sa mapa generale de su mundu\n\n • Sa chirca de PDI como suportat chircas prus dislindadas\n\n • Megioradas sas funtzionalidades de modìficas de PDI e OSM\n\n • Istrutura e s\'interfache de iscarrigamentu datos mapas torrada a fàghere\n\n e àteru... " From b4981eecb55f48322c87fa4fc0de67c77ba798be Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Wed, 18 Nov 2015 21:43:12 +0100 Subject: [PATCH 09/36] Fix issues related to poi editing --- .../osmedit/dialogs/PoiSubTypeDialogFragment.java | 4 +++- .../plus/osmedit/dialogs/PoiTypeDialogFragment.java | 13 +++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/PoiSubTypeDialogFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/PoiSubTypeDialogFragment.java index a25295985f..c2872e6e68 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/PoiSubTypeDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/PoiSubTypeDialogFragment.java @@ -2,6 +2,8 @@ package net.osmand.plus.osmedit.dialogs; import java.util.ArrayList; import java.util.List; +import java.util.Set; +import java.util.TreeSet; import net.osmand.osm.MapPoiTypes; import net.osmand.osm.PoiCategory; @@ -24,7 +26,7 @@ public class PoiSubTypeDialogFragment extends DialogFragment { MapPoiTypes poiTypes = ((OsmandApplication) getActivity().getApplication()).getPoiTypes(); AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); final PoiCategory a = poiTypes.getPoiCategoryByName((String) getArguments().getSerializable(KEY_POI_CATEGORY)); - List strings = new ArrayList<>(); + Set strings = new TreeSet<>(); for (PoiType s : a.getPoiTypes()) { if (!s.isReference() && !s.isNotEditableOsm() && s.getBaseLangType() == null) { strings.add(s.getTranslation()); diff --git a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/PoiTypeDialogFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/PoiTypeDialogFragment.java index 287d9b27a9..808ce6acf4 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/PoiTypeDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/PoiTypeDialogFragment.java @@ -21,17 +21,14 @@ public class PoiTypeDialogFragment extends DialogFragment { public Dialog onCreateDialog(Bundle savedInstanceState) { MapPoiTypes poiTypes = ((OsmandApplication) getActivity().getApplication()).getPoiTypes(); AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); - final List categories = poiTypes.getCategories(false); - ArrayList vals = new ArrayList<>(categories.size()); - ArrayList toDelete = new ArrayList<>(); - for (PoiCategory category : categories) { - if (category.isNotEditableOsm()) { - toDelete.add(category); - } else { + final List categories = new ArrayList(); + ArrayList vals = new ArrayList<>(); + for (PoiCategory category : poiTypes.getCategories(false)) { + if (!category.isNotEditableOsm()) { vals.add(category.getTranslation()); + categories.add(category); } } - categories.removeAll(toDelete); builder.setItems(vals.toArray(new String[vals.size()]), new Dialog.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { From 02319947f7cc5b2df984da1ec07d44ccf4da2bd7 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Wed, 18 Nov 2015 21:47:46 +0100 Subject: [PATCH 10/36] Fix issues related to poi editing --- .../net/osmand/plus/osmedit/EditPoiDialogFragment.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/osmedit/EditPoiDialogFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/EditPoiDialogFragment.java index dd989f1f6e..9a8c05879c 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/EditPoiDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/EditPoiDialogFragment.java @@ -515,14 +515,8 @@ public class EditPoiDialogFragment extends DialogFragment { @Override public void onItemSelected(AdapterView parent, View view, int position, long id) { Object item = parent.getAdapter().getItem(position); - //noinspection SuspiciousMethodCalls - if (subCategories.containsKey(item.toString().toLowerCase())) { - //noinspection SuspiciousMethodCalls - PoiType pt = subCategories.get(item); - String keyName = pt.getKeyName(); - setAdapterForPoiTypeEditText(); - poiTypeEditText.setText(keyName); - } + poiTypeEditText.setText(item.toString()); + setAdapterForPoiTypeEditText(); } @Override From efdae448b1316557a7cdf7fff1890249fc3a555b Mon Sep 17 00:00:00 2001 From: stephan 75 Date: Wed, 18 Nov 2015 21:59:15 +0100 Subject: [PATCH 11/36] Translated using Weblate (German) Currently translated at 99.3% (1819 of 1831 strings) --- OsmAnd/res/values-de/strings.xml | 42 +++++++++++++++++--------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/OsmAnd/res/values-de/strings.xml b/OsmAnd/res/values-de/strings.xml index 28b0a13f67..e1d6dca6ef 100644 --- a/OsmAnd/res/values-de/strings.xml +++ b/OsmAnd/res/values-de/strings.xml @@ -19,8 +19,8 @@ Verkehrsberuhigung Geschwindigkeitskontrolle Verkehrswarnung - Nahegelegene Favoriten ankündigen - Nahegelegene POI ankündigen + Nahegelegene Favoriten + Nahegelegene POI @@ -286,10 +286,10 @@ Europa Europa - Frankreich Europa - Deutschland - Europa/Asien - Russland + Russland Afrika Asien - Ozeanien + Australien und Ozeanien Weltweite und thematische Karten Weltweite Wikipedia POIs Sprachpakete (Aufnahmen - begrenzte Funktionalität) @@ -328,7 +328,7 @@ OSM-Kennwort Nötig für openstreetmap.org-Beiträge Hintergrunddienst - Für Verwendung von OsmAnd bei ausgeschalteter Anzeige + OsmAnd läuft bei ausgeschalteter Anzeige im Hintergrund @@ -687,7 +687,7 @@ Min. Art der Standortbestimmung beim Hintergrunddienst Standortbestimmung - Die Hintergrundnavigation erfordert aktiviertes GPS. + Die Hintergrundnavigation erfordert aktivierte Standortdienste. Filter verstecken Filter zeigen Filter @@ -1166,7 +1166,7 @@ Ankunftszeit GPS-Info - Straße + Straßenname Hausnummer @@ -1225,9 +1225,9 @@ Ton bei Auslösung abspielen Auswählen, ob beim Aufnehmen eines Fotos ein Ton abgespielt werden soll - Höchstgeschwindigkeit ansagen - Blitzer ansagen - Verkehrswarnungen ansagen + Tempolimit + Blitzer + Verkehrswarnungen Bitte OSM-Nutzername und Passwort in den Einstellungen eingeben Zwischenziele löschen Zwischenziele behalten @@ -1252,7 +1252,7 @@ Kanada Europa und Asien GB, Indien, Australien u.a. - GPX-Wegpunkte ansagen + GPX-Wegpunkte Fahrgebiet Version : Über @@ -1721,7 +1721,7 @@ Afghanistan, Ägypten, Albanien, Algerien, Andorra, Angola, Anguilla, Antigua an Fehlende Karten herunterladen: %1$s (%2$d MB)? Mehr… Bitte ID eingeben - Übersicht + Dashboard Bus-, Oberleitungsbus-, Sammeltaxi-Linien Streckenaufzeichnung h @@ -1814,7 +1814,7 @@ Afghanistan, Ägypten, Albanien, Algerien, Andorra, Angola, Anguilla, Antigua an Amerikanischer Straßenatlas Routing-Regeln v1.9 nicht verwenden Neuen Routenalgorithmus nicht verwenden - Fußgängerübergänge ankündigen + Fußgängerübergänge Parkplätze TAG ENTFERNEN @@ -2034,7 +2034,7 @@ Afghanistan, Ägypten, Albanien, Algerien, Andorra, Angola, Anguilla, Antigua an Erfolgreich hochgeladen {0}/{1} Erneut versuchen Fehler: {0} - Übersicht konfigurieren + Dashboard konfigurieren Rückgängig machen Überspringen OsmAnd @@ -2047,7 +2047,7 @@ Afghanistan, Ägypten, Albanien, Algerien, Andorra, Angola, Anguilla, Antigua an Pendelzug vermeiden Pendelzug vermeiden Plugins - Gebäude-Nummer + Hausnummer geöffnet ab geschlossen ab Nautische Meilen @@ -2145,7 +2145,7 @@ Afghanistan, Ägypten, Albanien, Algerien, Andorra, Angola, Anguilla, Antigua an offline speichern geänderter OSM-POI OSM-POI löschen - Offene OSM-Notiz + OSM-Notiz erstellen Wiedereröffnete OSM-Notiz Kommentierte OSM-Notiz Gelöschte OSM-Notiz @@ -2182,8 +2182,12 @@ Afghanistan, Ägypten, Albanien, Algerien, Andorra, Angola, Anguilla, Antigua an Name des Landes eingeben Soll der POI wirklich ohne Art des POI gespeichert werden? OSM-Änderung bearbeiten - Dashboard immer starten - Kartenansicht immer starten + Dashboard starten + Kartenansicht starten Neue Auswahl des Startvorgangs Es ist nun auswählbar, ob beim Start der App gleich die Kartenansicht oder das Dashboard angezeigt wird. (Jederzeit in den Dashboard-Einstellungen änderbar) - +Aufruf von der Karte aus + neu erstellen + Weiter + %.1f MB + From fc4eae874a9d638d182986634374455f000698db Mon Sep 17 00:00:00 2001 From: Ajeje Brazorf Date: Wed, 18 Nov 2015 21:41:07 +0100 Subject: [PATCH 12/36] Translated using Weblate (Sardinian) Currently translated at 100.0% (1831 of 1831 strings) --- OsmAnd/res/values-sc/strings.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OsmAnd/res/values-sc/strings.xml b/OsmAnd/res/values-sc/strings.xml index eaf9e9d270..1943b0b3eb 100644 --- a/OsmAnd/res/values-sc/strings.xml +++ b/OsmAnd/res/values-sc/strings.xml @@ -2020,8 +2020,8 @@ Istile pro sas istradas Issèbera noa de allumìngiu Como podes isseberare sa mègius manera de allumìngiu de s\'aplicatzione, deretamente dae sa mapa o cun su pannellu de controllu in antis. As a pòdere semper cambiare s’issèbera tua prus a tardu in sas impostatziones de su pannellu. - Ammustra su pannellu de controllu - Ammustra sa mapa + Allue cun su pannellu de controllu + Allue cun sa mapa Pone unu butone pro su pannellu de controllu in s’ischermu de sa mapa Intra dae sa mapa " • Interfache impitadore noa pro incarcare positziones in sa mapa e in àteros ischermos\n\n • S\'ischermu de sa mapa est como postu come prima cosa a s’allumìngiu de s’aplicatzione, semper chi \'Ammustra pannellu de controllu in s\'allumìngiu\' no siet ischertadu\n\n • Como podes cunfigurare sas impostatziones pro isseberare cales sunt sas ischedas chi diant dèper’èssere ammustradas in su pannellu e comente\n\n • Pro iscarrigare mapas, sas regiones podent èssere ischertadas deretamente incarcande in sa mapa generale de su mundu\n\n • Sa chirca de PDI como suportat chircas prus dislindadas\n\n • Megioradas sas funtzionalidades de modìficas de PDI e OSM\n\n • Istrutura e s\'interfache de iscarrigamentu datos mapas torrada a fàghere\n\n e àteru... " From 64345810e025ced8978365766552cb39d7ab1211 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Wed, 18 Nov 2015 22:03:55 +0100 Subject: [PATCH 13/36] Fix poi editing --- OsmAnd/res/values/strings.xml | 2 +- .../net/osmand/plus/osmedit/EditPoiData.java | 1 + .../plus/osmedit/EditPoiDialogFragment.java | 8 +++++--- .../dialogs/PoiSubTypeDialogFragment.java | 20 ++++++++++++++----- 4 files changed, 22 insertions(+), 9 deletions(-) diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index aac2d4a289..ddb9821f44 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -8,7 +8,7 @@ If you are making/correcting English translations make sure: 3. All your modified/created strings are in the top of the file (to make easier find what\'s translated). PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy - --> + --> Places a dashboard button on the map screen Access from map \'Off\' directly launches the map screen diff --git a/OsmAnd/src/net/osmand/plus/osmedit/EditPoiData.java b/OsmAnd/src/net/osmand/plus/osmedit/EditPoiData.java index 313089dda7..731cde3284 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/EditPoiData.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/EditPoiData.java @@ -187,6 +187,7 @@ public class EditPoiData { if(pt != null) { tagValues.remove(pt.getOsmTag()); tagValues.remove(pt.getOsmTag2()); + category = pt.getCategory(); } notifyDatasetChanged(POI_TYPE_TAG); } diff --git a/OsmAnd/src/net/osmand/plus/osmedit/EditPoiDialogFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/EditPoiDialogFragment.java index 9a8c05879c..e7497756ad 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/EditPoiDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/EditPoiDialogFragment.java @@ -316,14 +316,16 @@ public class EditPoiDialogFragment extends DialogFragment { HashSet tagsCopy = new HashSet<>(); tagsCopy.addAll(editPoiData.getTagValues().keySet()); tagsCopy.removeAll(BASIC_TAGS); - if (tagsCopy.isEmpty() || editPoiData.getPoiCategory() == getMyApplication().getPoiTypes().getOtherPoiCategory()) { + if (tagsCopy.isEmpty()) { poiTypeEditText.setError(getResources().getString(R.string.please_specify_poi_type)); } else { new SaveWithAdvancedTagsDialogFragment().show(getChildFragmentManager(), "dialog"); } - return; + } else if(editPoiData.getPoiCategory() == getMyApplication().getPoiTypes().getOtherPoiCategory()) { + poiTypeEditText.setError(getResources().getString(R.string.please_specify_poi_type)); + } else { + save(); } - save(); } private void save() { diff --git a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/PoiSubTypeDialogFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/PoiSubTypeDialogFragment.java index c2872e6e68..f02248f683 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/PoiSubTypeDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/PoiSubTypeDialogFragment.java @@ -1,7 +1,5 @@ package net.osmand.plus.osmedit.dialogs; -import java.util.ArrayList; -import java.util.List; import java.util.Set; import java.util.TreeSet; @@ -27,10 +25,14 @@ public class PoiSubTypeDialogFragment extends DialogFragment { AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); final PoiCategory a = poiTypes.getPoiCategoryByName((String) getArguments().getSerializable(KEY_POI_CATEGORY)); Set strings = new TreeSet<>(); - for (PoiType s : a.getPoiTypes()) { - if (!s.isReference() && !s.isNotEditableOsm() && s.getBaseLangType() == null) { - strings.add(s.getTranslation()); + if(a == poiTypes.getOtherPoiCategory()) { + for (PoiCategory category : poiTypes.getCategories(false)) { + if (!category.isNotEditableOsm()) { + addCategory(category, strings); + } } + } else { + addCategory(a, strings); } final String[] subCats = strings.toArray(new String[strings.size()]); builder.setItems(subCats, new DialogInterface.OnClickListener() { @@ -43,6 +45,14 @@ public class PoiSubTypeDialogFragment extends DialogFragment { return builder.create(); } + private void addCategory(final PoiCategory a, Set strings) { + for (PoiType s : a.getPoiTypes()) { + if (!s.isReference() && !s.isNotEditableOsm() && s.getBaseLangType() == null) { + strings.add(s.getTranslation()); + } + } + } + public static PoiSubTypeDialogFragment createInstance(PoiCategory cat) { PoiSubTypeDialogFragment fragment = new PoiSubTypeDialogFragment(); Bundle args = new Bundle(); From 9ffcb85853570e7406da81c46ac0ead7d0a18225 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Wed, 18 Nov 2015 22:40:50 +0100 Subject: [PATCH 14/36] Add local poi search as 1st item --- .../plus/activities/MapActivityLayers.java | 4 +-- .../search/SearchPoiFilterFragment.java | 4 +-- .../net/osmand/plus/poi/PoiFiltersHelper.java | 32 ++++++++++++++++--- .../src/net/osmand/plus/poi/PoiUIFilter.java | 14 +++++--- 4 files changed, 40 insertions(+), 14 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivityLayers.java b/OsmAnd/src/net/osmand/plus/activities/MapActivityLayers.java index d5cbea1cf5..461b4d2dcf 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivityLayers.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivityLayers.java @@ -292,8 +292,8 @@ public class MapActivityLayers { private void addFilterToList(final ContextMenuAdapter adapter, final List list, PoiUIFilter f) { list.add(f); Item it = adapter.item(f.getName()).selected(-1); - if (RenderingIcons.containsBigIcon(f.getSimplifiedId())) { - it.icon(RenderingIcons.getBigIconResourceId(f.getSimplifiedId())); + if (RenderingIcons.containsBigIcon(f.getIconId())) { + it.icon(RenderingIcons.getBigIconResourceId(f.getIconId())); } else { it.icon(R.drawable.mx_user_defined); } diff --git a/OsmAnd/src/net/osmand/plus/activities/search/SearchPoiFilterFragment.java b/OsmAnd/src/net/osmand/plus/activities/search/SearchPoiFilterFragment.java index 7ca54e1ca5..7c80a1ba7e 100644 --- a/OsmAnd/src/net/osmand/plus/activities/search/SearchPoiFilterFragment.java +++ b/OsmAnd/src/net/osmand/plus/activities/search/SearchPoiFilterFragment.java @@ -268,8 +268,8 @@ public class SearchPoiFilterFragment extends OsmAndListFragment implements Searc String name; if (item instanceof PoiUIFilter) { final PoiUIFilter model = (PoiUIFilter) item; - if (RenderingIcons.containsBigIcon(model.getSimplifiedId())) { - icon.setImageDrawable(RenderingIcons.getBigIcon(getActivity(), model.getSimplifiedId())); + if (RenderingIcons.containsBigIcon(model.getIconId())) { + icon.setImageDrawable(RenderingIcons.getBigIcon(getActivity(), model.getIconId())); } else if(PoiUIFilter.BY_NAME_FILTER_ID.equals(model.getFilterId()) || model instanceof NominatimPoiFilter){ icon.setImageResource(R.drawable.mx_name_finder); diff --git a/OsmAnd/src/net/osmand/plus/poi/PoiFiltersHelper.java b/OsmAnd/src/net/osmand/plus/poi/PoiFiltersHelper.java index 4aebe527d5..51b00f81ba 100644 --- a/OsmAnd/src/net/osmand/plus/poi/PoiFiltersHelper.java +++ b/OsmAnd/src/net/osmand/plus/poi/PoiFiltersHelper.java @@ -23,6 +23,7 @@ import net.osmand.plus.R; import net.osmand.plus.api.SQLiteAPI.SQLiteConnection; import net.osmand.plus.api.SQLiteAPI.SQLiteCursor; import net.osmand.plus.api.SQLiteAPI.SQLiteStatement; +import net.osmand.util.Algorithms; public class PoiFiltersHelper { private final OsmandApplication application; @@ -33,7 +34,9 @@ public class PoiFiltersHelper { private PoiUIFilter searchByNamePOIFilter; private PoiUIFilter customPOIFilter; private PoiUIFilter showAllPOIFilter; + private PoiUIFilter localWikiPoiFilter; private List cacheTopStandardFilters; + private static final String UDF_CAR_AID = "car_aid"; private static final String UDF_FOR_TOURISTS = "for_tourists"; @@ -78,6 +81,8 @@ public class PoiFiltersHelper { return searchByNamePOIFilter; } + + public PoiUIFilter getCustomPOIFilter() { if(customPOIFilter == null){ PoiUIFilter filter = new PoiUIFilter(application.getString(R.string.poi_filter_custom_filter), @@ -88,9 +93,23 @@ public class PoiFiltersHelper { return customPOIFilter; } + public PoiUIFilter getLocalWikiPOIFilter() { + if(localWikiPoiFilter == null){ + PoiType place = application.getPoiTypes().getPoiTypeByKey("wiki_place"); + if (place != null && !Algorithms.isEmpty(application.getLanguage())) { + PoiUIFilter filter = new PoiUIFilter(place, application, " " + + application.getLangTranslation(application.getLanguage())); //$NON-NLS-1$ + filter.setFilterByName("wiki:lang:"+application.getLanguage()); + filter.setStandardFilter(true); + localWikiPoiFilter = filter; + } + } + return localWikiPoiFilter; + } + public PoiUIFilter getShowAllPOIFilter() { if(showAllPOIFilter == null){ - PoiUIFilter filter = new PoiUIFilter(null, application); //$NON-NLS-1$ + PoiUIFilter filter = new PoiUIFilter(null, application, ""); //$NON-NLS-1$ filter.setStandardFilter(true); showAllPOIFilter = filter; } @@ -117,7 +136,7 @@ public class PoiFiltersHelper { } } PoiUIFilter ff = getFilterById(filterId, getCustomPOIFilter(), getSearchByNamePOIFilter(), - getShowAllPOIFilter(), getNominatimPOIFilter(), getNominatimAddressFilter()); + getLocalWikiPOIFilter(), getShowAllPOIFilter(), getNominatimPOIFilter(), getNominatimAddressFilter()); if (ff != null) { return ff; } @@ -125,7 +144,7 @@ public class PoiFiltersHelper { String typeId = filterId.substring(PoiUIFilter.STD_PREFIX.length()); AbstractPoiType tp = application.getPoiTypes().getAnyPoiTypeByKey(typeId); if(tp != null) { - PoiUIFilter lf = new PoiUIFilter(tp, application); + PoiUIFilter lf = new PoiUIFilter(tp, application, ""); ArrayList copy = new ArrayList(cacheTopStandardFilters); copy.add(lf); sortListOfFilters(copy); @@ -134,7 +153,7 @@ public class PoiFiltersHelper { } AbstractPoiType lt = application.getPoiTypes().getAnyPoiAdditionalTypeByKey(typeId); if(lt != null) { - PoiUIFilter lf = new PoiUIFilter(lt, application); + PoiUIFilter lf = new PoiUIFilter(lt, application, ""); ArrayList copy = new ArrayList(cacheTopStandardFilters); copy.add(lf); sortListOfFilters(copy); @@ -182,10 +201,13 @@ public class PoiFiltersHelper { List top = new ArrayList(); // user defined top.addAll(getUserDefinedPoiFilters()); + if(getLocalWikiPOIFilter() != null) { + top.add(getLocalWikiPOIFilter()); + } // default MapPoiTypes poiTypes = application.getPoiTypes(); for (PoiFilter t : poiTypes.getTopVisibleFilters()) { - top.add(new PoiUIFilter(t, application)); + top.add(new PoiUIFilter(t, application, "")); } sortListOfFilters(top); cacheTopStandardFilters = top; diff --git a/OsmAnd/src/net/osmand/plus/poi/PoiUIFilter.java b/OsmAnd/src/net/osmand/plus/poi/PoiUIFilter.java index 38e97fb976..6589577497 100644 --- a/OsmAnd/src/net/osmand/plus/poi/PoiUIFilter.java +++ b/OsmAnd/src/net/osmand/plus/poi/PoiUIFilter.java @@ -46,6 +46,7 @@ public class PoiUIFilter implements SearchPoiTypeFilter { private Map poiAdditionals = new HashMap(); protected String filterId; + protected String standardIconId = ""; protected String name; protected boolean isStandardFilter; @@ -62,12 +63,14 @@ public class PoiUIFilter implements SearchPoiTypeFilter { protected List currentSearchResult = null; // constructor for standard filters - public PoiUIFilter(AbstractPoiType type, OsmandApplication application) { + public PoiUIFilter(AbstractPoiType type, OsmandApplication application, String idSuffix) { this.app = application; isStandardFilter = true; - filterId = STD_PREFIX + (type == null ? null : type.getKeyName()); + standardIconId = (type == null ? null : type.getKeyName()); + filterId = STD_PREFIX + standardIconId + idSuffix; + poiTypes = application.getPoiTypes(); - name = type == null ? application.getString(R.string.poi_filter_closest_poi) : type.getTranslation(); //$NON-NLS-1$ + name = type == null ? application.getString(R.string.poi_filter_closest_poi) : (type.getTranslation() + idSuffix); //$NON-NLS-1$ if (type == null) { initSearchAll(); updatePoiAdditionals(); @@ -79,6 +82,7 @@ public class PoiUIFilter implements SearchPoiTypeFilter { } } + // search by name standard protected PoiUIFilter(OsmandApplication application) { this.app = application; @@ -520,9 +524,9 @@ public class PoiUIFilter implements SearchPoiTypeFilter { return poiAdditionals; } - public String getSimplifiedId(){ + public String getIconId(){ if(filterId.startsWith(STD_PREFIX)) { - return filterId.substring(STD_PREFIX.length()).toLowerCase(); + return standardIconId; } else if(filterId.startsWith(USER_PREFIX)) { return filterId.substring(USER_PREFIX.length()).toLowerCase(); } From 671d67d88b7a2f930f7412c4dc644118e50fb686 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Wed, 18 Nov 2015 23:03:51 +0100 Subject: [PATCH 15/36] Add wikipedia local --- OsmAnd/src/net/osmand/plus/poi/PoiFiltersHelper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/poi/PoiFiltersHelper.java b/OsmAnd/src/net/osmand/plus/poi/PoiFiltersHelper.java index 51b00f81ba..92ef6f5b99 100644 --- a/OsmAnd/src/net/osmand/plus/poi/PoiFiltersHelper.java +++ b/OsmAnd/src/net/osmand/plus/poi/PoiFiltersHelper.java @@ -99,7 +99,7 @@ public class PoiFiltersHelper { if (place != null && !Algorithms.isEmpty(application.getLanguage())) { PoiUIFilter filter = new PoiUIFilter(place, application, " " + application.getLangTranslation(application.getLanguage())); //$NON-NLS-1$ - filter.setFilterByName("wiki:lang:"+application.getLanguage()); + filter.setSavedFilterByName("wiki:lang:"+application.getLanguage()); filter.setStandardFilter(true); localWikiPoiFilter = filter; } From 37a05456b0ec2e79da99bba3c1e278336b902ecf Mon Sep 17 00:00:00 2001 From: Leif Larsson Date: Wed, 18 Nov 2015 22:08:29 +0100 Subject: [PATCH 16/36] Translated using Weblate (Swedish) Currently translated at 99.2% (1817 of 1831 strings) --- OsmAnd/res/values-sv/strings.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OsmAnd/res/values-sv/strings.xml b/OsmAnd/res/values-sv/strings.xml index 0a1773c806..7863d3ca80 100644 --- a/OsmAnd/res/values-sv/strings.xml +++ b/OsmAnd/res/values-sv/strings.xml @@ -2002,8 +2002,8 @@ GPX-bredd " • Nytt kontextkänsligt gränssnitt för att peta på platser på kartan och på andra skärmar\n\n • Kartskärmen startar nu automatiskt om inte \'Visa panelen vid appstart\' är vald\n\n • Konfigurera vilka kort och hur de ska visas i panelen\n\n • För att hämta kartor kan regioner väljas direkt genom att peta på världskartan\n\n • Sökning efter intressepunkter (POI) understöder nu mer specifika frågor\n\n • Förbättrad funktion för POI- och OSM-redigering\n\n • Strukturen för hämtning av kartdata och gränssnittet har omarbetats\n\n och mer ... " Du kan nu välja om appen ska starta direkt med kartskärmen eller alltid visa panelen först. Detta val kan du alltid ändra på under inställningarna i panelen. -Starta alltid med panelen - Starta alltid med kartan +Öppna panelen + Visa kartan Nytt val för uppstarten Öppna igen Skicka in From c488166e5b9a7f04a62240ae50593e36f801899f Mon Sep 17 00:00:00 2001 From: sonora Date: Wed, 18 Nov 2015 23:38:16 +0100 Subject: [PATCH 17/36] see if this fixes smalll layout issue --- OsmAnd/res/layout/map_hud_bottom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OsmAnd/res/layout/map_hud_bottom.xml b/OsmAnd/res/layout/map_hud_bottom.xml index 7e49c3a013..a59e633a57 100644 --- a/OsmAnd/res/layout/map_hud_bottom.xml +++ b/OsmAnd/res/layout/map_hud_bottom.xml @@ -125,7 +125,7 @@ android:layout_height="fill_parent" android:layout_gravity="bottom" android:gravity="center_horizontal" - android:text="100 m" + android:text="200 m" android:textSize="@dimen/map_widget_text_size_small" /> From d534332fd6b2f5409f0a68b417d073aa890b2cfb Mon Sep 17 00:00:00 2001 From: sonora Date: Thu, 19 Nov 2015 00:43:28 +0100 Subject: [PATCH 18/36] try fix issue 1931 --- OsmAnd/res/layout/map_hud_bottom.xml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/OsmAnd/res/layout/map_hud_bottom.xml b/OsmAnd/res/layout/map_hud_bottom.xml index a59e633a57..ec688dfabd 100644 --- a/OsmAnd/res/layout/map_hud_bottom.xml +++ b/OsmAnd/res/layout/map_hud_bottom.xml @@ -125,7 +125,8 @@ android:layout_height="fill_parent" android:layout_gravity="bottom" android:gravity="center_horizontal" - android:text="200 m" + android:lineSpacingMultiplier="0.8" + android:text="100 m" android:textSize="@dimen/map_widget_text_size_small" /> From c83d806cce7cfbeb958a8c692cc0e7f54e81c937 Mon Sep 17 00:00:00 2001 From: sonora Date: Thu, 19 Nov 2015 00:56:02 +0100 Subject: [PATCH 19/36] fix Issue 1931 --- OsmAnd/res/layout-land/map_hud_bottom.xml | 2 ++ OsmAnd/res/layout/map_hud_bottom.xml | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/OsmAnd/res/layout-land/map_hud_bottom.xml b/OsmAnd/res/layout-land/map_hud_bottom.xml index 2fe5df02a2..1a7d82b199 100644 --- a/OsmAnd/res/layout-land/map_hud_bottom.xml +++ b/OsmAnd/res/layout-land/map_hud_bottom.xml @@ -133,6 +133,7 @@ android:layout_height="fill_parent" android:layout_gravity="bottom" android:gravity="center_horizontal" + android:lineSpacingMultiplier="0.8" android:text="100 m" android:textSize="@dimen/map_widget_text_size_small" /> @@ -142,6 +143,7 @@ android:layout_height="fill_parent" android:layout_gravity="bottom" android:gravity="center_horizontal" + android:lineSpacingMultiplier="0.8" android:text="100 m" android:textSize="@dimen/map_widget_text_size_small" /> diff --git a/OsmAnd/res/layout/map_hud_bottom.xml b/OsmAnd/res/layout/map_hud_bottom.xml index ec688dfabd..6ecad34f26 100644 --- a/OsmAnd/res/layout/map_hud_bottom.xml +++ b/OsmAnd/res/layout/map_hud_bottom.xml @@ -125,7 +125,7 @@ android:layout_height="fill_parent" android:layout_gravity="bottom" android:gravity="center_horizontal" - android:lineSpacingMultiplier="0.8" + android:lineSpacingMultiplier="0.8" android:text="100 m" android:textSize="@dimen/map_widget_text_size_small" /> @@ -135,7 +135,7 @@ android:layout_height="fill_parent" android:layout_gravity="bottom" android:gravity="center_horizontal" - android:lineSpacingMultiplier="0.8" + android:lineSpacingMultiplier="0.8" android:text="100 m" android:textSize="@dimen/map_widget_text_size_small" /> From f600bf162f79a7930c92898dff91a3404f991a3d Mon Sep 17 00:00:00 2001 From: sonora Date: Thu, 19 Nov 2015 01:01:14 +0100 Subject: [PATCH 20/36] tweak --- OsmAnd/res/layout-land/map_hud_bottom.xml | 4 ++-- OsmAnd/res/layout/map_hud_bottom.xml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/OsmAnd/res/layout-land/map_hud_bottom.xml b/OsmAnd/res/layout-land/map_hud_bottom.xml index 1a7d82b199..4144e846bc 100644 --- a/OsmAnd/res/layout-land/map_hud_bottom.xml +++ b/OsmAnd/res/layout-land/map_hud_bottom.xml @@ -133,7 +133,7 @@ android:layout_height="fill_parent" android:layout_gravity="bottom" android:gravity="center_horizontal" - android:lineSpacingMultiplier="0.8" + android:lineSpacingMultiplier="0.9" android:text="100 m" android:textSize="@dimen/map_widget_text_size_small" /> @@ -143,7 +143,7 @@ android:layout_height="fill_parent" android:layout_gravity="bottom" android:gravity="center_horizontal" - android:lineSpacingMultiplier="0.8" + android:lineSpacingMultiplier="0.9" android:text="100 m" android:textSize="@dimen/map_widget_text_size_small" /> diff --git a/OsmAnd/res/layout/map_hud_bottom.xml b/OsmAnd/res/layout/map_hud_bottom.xml index 6ecad34f26..940493919a 100644 --- a/OsmAnd/res/layout/map_hud_bottom.xml +++ b/OsmAnd/res/layout/map_hud_bottom.xml @@ -125,7 +125,7 @@ android:layout_height="fill_parent" android:layout_gravity="bottom" android:gravity="center_horizontal" - android:lineSpacingMultiplier="0.8" + android:lineSpacingMultiplier="0.9" android:text="100 m" android:textSize="@dimen/map_widget_text_size_small" /> @@ -135,7 +135,7 @@ android:layout_height="fill_parent" android:layout_gravity="bottom" android:gravity="center_horizontal" - android:lineSpacingMultiplier="0.8" + android:lineSpacingMultiplier="0.9" android:text="100 m" android:textSize="@dimen/map_widget_text_size_small" /> From b789ffdf6f6a821ebc0b1eed9fbc0818758341fc Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Thu, 19 Nov 2015 01:06:32 +0100 Subject: [PATCH 21/36] Update map controls --- .../osmand/plus/OsmAndAppCustomization.java | 2 - .../src/net/osmand/plus/OsmandSettings.java | 7 +- .../osmand/plus/activities/MapActivity.java | 4 +- .../plus/activities/MapActivityActions.java | 77 +++---------------- .../SettingsNavigationActivity.java | 23 +++--- .../plus/base/MapViewTrackingUtilities.java | 8 +- .../osmand/plus/dashboard/DashboardOnMap.java | 2 +- .../plus/mapcontextmenu/MapContextMenu.java | 8 +- .../osmand/plus/views/MapControlsLayer.java | 18 ++--- .../views/controls/MapRouteInfoControl.java | 4 +- 10 files changed, 47 insertions(+), 106 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/OsmAndAppCustomization.java b/OsmAnd/src/net/osmand/plus/OsmAndAppCustomization.java index 628f1b1135..4caab396c7 100644 --- a/OsmAnd/src/net/osmand/plus/OsmAndAppCustomization.java +++ b/OsmAnd/src/net/osmand/plus/OsmAndAppCustomization.java @@ -96,8 +96,6 @@ public class OsmAndAppCustomization { public void prepareOptionsMenu(MapActivity mapActivity, ContextMenuAdapter optionsMenuHelper) { } - public void prepareLocationMenu(MapActivity mapActivity, ContextMenuAdapter adapter) { - } public String getIndexesUrl() { return "http://"+IndexConstants.INDEX_DOWNLOAD_DOMAIN+"/get_indexes?gzip&" + Version.getVersionAsURLParam(app); //$NON-NLS-1$; diff --git a/OsmAnd/src/net/osmand/plus/OsmandSettings.java b/OsmAnd/src/net/osmand/plus/OsmandSettings.java index d58a653779..bbce25e02f 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandSettings.java +++ b/OsmAnd/src/net/osmand/plus/OsmandSettings.java @@ -1449,7 +1449,6 @@ public class OsmandSettings { public final static String POINT_NAVIGATE_LAT = "point_navigate_lat"; //$NON-NLS-1$ public final static String POINT_NAVIGATE_LON = "point_navigate_lon"; //$NON-NLS-1$ public final static String POINT_NAVIGATE_ROUTE = "point_navigate_route_integer"; //$NON-NLS-1$ - public final static int NAVIGATE_CURRENT_GPX = 2; public final static int NAVIGATE = 1; public final static String POINT_NAVIGATE_DESCRIPTION = "point_navigate_description"; //$NON-NLS-1$ public final static String START_POINT_LAT = "start_point_lat"; //$NON-NLS-1$ @@ -1604,11 +1603,7 @@ public class OsmandSettings { } public boolean navigateDialog() { - return navigateDialog(false); - } - - public boolean navigateDialog(boolean gpx) { - return settingsAPI.edit(globalPreferences).putInt(POINT_NAVIGATE_ROUTE, gpx ? NAVIGATE_CURRENT_GPX : NAVIGATE).commit(); + return settingsAPI.edit(globalPreferences).putInt(POINT_NAVIGATE_ROUTE, NAVIGATE).commit(); } diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java index 6fdf2af98f..f8c936c54c 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java @@ -516,7 +516,7 @@ public class MapActivity extends AccessibleActivity implements DownloadEvents { getMyApplication().getTargetPointsHelper().navigateToPoint(new LatLon(lat, lon), false, -1); - getMapActions().enterRoutePlanningMode(null, null, false); + getMapActions().enterRoutePlanningModeGivenGpx(null, null, null); } catch (NumberFormatException e) { AccessibleToast.makeText(this, getString(R.string.navigation_intent_invalid, schemeSpecificPart), @@ -541,7 +541,7 @@ public class MapActivity extends AccessibleActivity implements DownloadEvents { Location loc = new Location("map"); loc.setLatitude(mapView.getLatitude()); loc.setLongitude(mapView.getLongitude()); - getMapActions().enterRoutePlanningMode(null, null, status == OsmandSettings.NAVIGATE_CURRENT_GPX); + getMapActions().enterRoutePlanningModeGivenGpx(null, null, null); if (dashboardOnMap.isVisible()) { dashboardOnMap.hideDashboard(); } diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java index 1ae573f7fc..8ec78765a0 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java @@ -87,64 +87,6 @@ public class MapActivityActions implements DialogProvider { routingHelper = mapActivity.getMyApplication().getRoutingHelper(); } - public void showNavigationContextMenuPoint(final double latitude, final double longitude) { - final ContextMenuAdapter adapter = new ContextMenuAdapter(mapActivity); - - if (!mapActivity.getRoutingHelper().isFollowingMode() && !mapActivity.getRoutingHelper().isRoutePlanningMode()) { - adapter.item(R.string.context_menu_item_directions_to).iconColor( - R.drawable.ic_action_gdirections_dark).reg(); - adapter.item(R.string.context_menu_item_directions_from).iconColor( - R.drawable.ic_action_gdirections_dark).reg(); - } - final TargetPointsHelper targets = getMyApplication().getTargetPointsHelper(); - if (targets.getPointToNavigate() != null) { - adapter.item(R.string.context_menu_item_destination_point).iconColor(R.drawable.ic_action_flag_dark).reg(); - adapter.item(R.string.context_menu_item_intermediate_point).iconColor(R.drawable.ic_action_flage_dark).reg(); - // For button-less search UI - } else { - adapter.item(R.string.context_menu_item_destination_point).iconColor(R.drawable.ic_action_flag_dark).reg(); - } - - getMyApplication().getAppCustomization().prepareLocationMenu(mapActivity, adapter); - - final AlertDialog.Builder builder = new AlertDialog.Builder(mapActivity); - builder.setTitle(R.string.get_directions); - final ArrayAdapter listAdapter = - adapter.createListAdapter(mapActivity, getMyApplication().getSettings().isLightContent()); - builder.setAdapter(listAdapter, new DialogInterface.OnClickListener() { - - @Override - public void onClick(DialogInterface dialog, int which) { - int standardId = adapter.getElementId(which); - OnContextMenuClick click = adapter.getClickAdapter(which); - if (click != null) { - click.onContextMenuClick(listAdapter, standardId, which, false); - } else if (standardId == R.string.context_menu_item_directions_to) { - targets.navigateToPoint(new LatLon(latitude, longitude), true, -1, null); - enterRoutePlanningMode(null, null, false); - } else if (standardId == R.string.context_menu_item_directions_from) { - enterRoutePlanningMode(new LatLon(latitude, longitude), - mapActivity.getContextMenu().getPointDescription(), false); - } else if (standardId == R.string.context_menu_item_intermediate_point || - standardId == R.string.context_menu_item_destination_point) { - boolean dest = standardId == R.string.context_menu_item_destination_point; - targets.navigateToPoint(new LatLon(latitude, longitude), true, - dest ? -1 : targets.getIntermediatePoints().size(), - mapActivity.getContextMenu().getPointDescription()); - if (targets.getIntermediatePoints().size() > 0) { - openIntermediatePointsDialog(); - } - } - } - }); - builder.create().show(); - } - - public void directionTo(double latitude, double longitude, PointDescription pd) { - final TargetPointsHelper targets = getMyApplication().getTargetPointsHelper(); - targets.navigateToPoint(new LatLon(latitude, longitude), true, targets.getIntermediatePoints().size() + 1, pd); - enterRoutePlanningMode(null, null, false); - } public void addAsWaypoint(double latitude, double longitude, PointDescription pd) { TargetPointsHelper targets = getMyApplication().getTargetPointsHelper(); @@ -336,7 +278,6 @@ public class MapActivityActions implements DialogProvider { R.drawable.ic_action_gdirections_dark).reg(); } OsmandPlugin.registerMapContextMenu(mapActivity, latitude, longitude, adapter, selectedObj); - getMyApplication().getAppCustomization().prepareLocationMenu(mapActivity, adapter); final AlertDialog.Builder builder = new AlertDialog.Builder(mapActivity); final ArrayAdapter listAdapter = @@ -358,7 +299,7 @@ public class MapActivityActions implements DialogProvider { } else if (standardId == R.string.context_menu_item_directions_from) { mapActivity.getContextMenu().hide(); enterRoutePlanningMode(new LatLon(latitude, longitude), - mapActivity.getContextMenu().getPointDescription(), false); + mapActivity.getContextMenu().getPointDescription()); } } }); @@ -395,7 +336,7 @@ public class MapActivityActions implements DialogProvider { } } - public void enterRoutePlanningMode(final LatLon from, final PointDescription fromName, boolean useCurrentGPX) { + public void enterRoutePlanningMode(final LatLon from, final PointDescription fromName) { List selectedGPXFiles = mapActivity.getMyApplication().getSelectedGpxHelper() .getSelectedGPXFiles(); final List gpxFiles = new ArrayList(); @@ -407,14 +348,14 @@ public class MapActivityActions implements DialogProvider { } } - if (gpxFiles.size() > 0 && !useCurrentGPX) { + if (gpxFiles.size() > 0) { AlertDialog.Builder bld = new AlertDialog.Builder(mapActivity); if (gpxFiles.size() == 1) { bld.setMessage(R.string.use_displayed_track_for_navigation); bld.setPositiveButton(R.string.shared_string_yes, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { - enterRoutePlanningModeImpl(gpxFiles.get(0), from, fromName); + enterRoutePlanningModeGivenGpx(gpxFiles.get(0), from, fromName); } }); } else { @@ -436,7 +377,7 @@ public class MapActivityActions implements DialogProvider { bld.setAdapter(adapter, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { - enterRoutePlanningModeImpl(gpxFiles.get(i), from, fromName); + enterRoutePlanningModeGivenGpx(gpxFiles.get(i), from, fromName); } }); } @@ -444,16 +385,16 @@ public class MapActivityActions implements DialogProvider { bld.setNegativeButton(R.string.shared_string_no, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { - enterRoutePlanningModeImpl(null, from, fromName); + enterRoutePlanningModeGivenGpx(null, from, fromName); } }); bld.show(); } else { - enterRoutePlanningModeImpl(useCurrentGPX ? gpxFiles.get(0) : null, from, fromName); + enterRoutePlanningModeGivenGpx(null, from, fromName); } } - private void enterRoutePlanningModeImpl(GPXFile gpxFile, LatLon from, PointDescription fromName) { + public void enterRoutePlanningModeGivenGpx(GPXFile gpxFile, LatLon from, PointDescription fromName) { OsmandApplication app = mapActivity.getMyApplication(); TargetPointsHelper targets = app.getTargetPointsHelper(); @@ -627,7 +568,7 @@ public class MapActivityActions implements DialogProvider { @Override public boolean onContextMenuClick(ArrayAdapter adapter, int itemId, int pos, boolean isChecked) { if (!routingHelper.isFollowingMode() && !routingHelper.isRoutePlanningMode()) { - enterRoutePlanningMode(null, null, false); + enterRoutePlanningMode(null, null); } else { mapActivity.getMapViewTrackingUtilities().switchToRoutePlanningMode(); mapActivity.refreshMap(); diff --git a/OsmAnd/src/net/osmand/plus/activities/SettingsNavigationActivity.java b/OsmAnd/src/net/osmand/plus/activities/SettingsNavigationActivity.java index 7680ec07e6..d50dad07e6 100644 --- a/OsmAnd/src/net/osmand/plus/activities/SettingsNavigationActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/SettingsNavigationActivity.java @@ -199,17 +199,18 @@ public class SettingsNavigationActivity extends SettingsBaseActivity { if (!mode.isDerivedRoutingFrom(ApplicationMode.CAR)) { category.removePreference(speedLimitExceed); } - - Integer[] delayIntervals = new Integer[] { -1, 3, 5, 7, 10, 15, 20 }; - String[] delayIntervalNames = new String[delayIntervals.length]; - for (int i = 0; i < delayIntervals.length; i++) { - if (i == 0) { - delayIntervalNames[i] = getString(R.string.auto_follow_route_never); - } else { - delayIntervalNames[i] = delayIntervals[i] + " " + getString(R.string.int_seconds); - } - } - registerListPreference(settings.DELAY_TO_START_NAVIGATION, screen, delayIntervalNames, delayIntervals); + + // deprecated 2.2 +// Integer[] delayIntervals = new Integer[] { -1, 3, 5, 7, 10, 15, 20 }; +// String[] delayIntervalNames = new String[delayIntervals.length]; +// for (int i = 0; i < delayIntervals.length; i++) { +// if (i == 0) { +// delayIntervalNames[i] = getString(R.string.auto_follow_route_never); +// } else { +// delayIntervalNames[i] = delayIntervals[i] + " " + getString(R.string.int_seconds); +// } +// } + // registerListPreference(settings.DELAY_TO_START_NAVIGATION, screen, delayIntervalNames, delayIntervals); if(getIntent() != null && getIntent().hasExtra(INTENT_SKIP_DIALOG)) { diff --git a/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java b/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java index 493dbe8abf..f3c1604d5d 100644 --- a/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java +++ b/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java @@ -334,9 +334,13 @@ public class MapViewTrackingUtilities implements OsmAndLocationListener, IMapLoc bottom = Math.min(bottom, l.getLatitude()); } RotatedTileBox tb = new RotatedTileBox(rt); - tb.setPixelDimensions(3 * tb.getPixWidth() / 4, 3 * tb.getPixHeight() / 4); - double clat = bottom / 2 + top / 2; + + tb.setPixelDimensions(4 * tb.getPixWidth() / 5, 4 * tb.getPixHeight() / 5); + double clat = bottom + top / 5; double clon = left / 2 + right / 2; + // TODO for landscape menu +// double clat = bottom / 2 + top / 2; +// double clon = left + right / 5; tb.setLatLonCenter(clat, clon); while(tb.getZoom() >= 7 && (!tb.containsLatLon(top, left) || !tb.containsLatLon(bottom, right))) { tb.setZoom(tb.getZoom() - 1); diff --git a/OsmAnd/src/net/osmand/plus/dashboard/DashboardOnMap.java b/OsmAnd/src/net/osmand/plus/dashboard/DashboardOnMap.java index 5ff4b81077..ea7f0f47d0 100644 --- a/OsmAnd/src/net/osmand/plus/dashboard/DashboardOnMap.java +++ b/OsmAnd/src/net/osmand/plus/dashboard/DashboardOnMap.java @@ -597,7 +597,7 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks { public void navigationAction() { RoutingHelper routingHelper = mapActivity.getRoutingHelper(); if (!routingHelper.isFollowingMode() && !routingHelper.isRoutePlanningMode()) { - mapActivity.getMapActions().enterRoutePlanningMode(null, null, false); + mapActivity.getMapActions().enterRoutePlanningMode(null, null); } else { mapActivity.getRoutingHelper().setRoutePlanningMode(true); mapActivity.getMapViewTrackingUtilities().switchToRoutePlanningMode(); diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java index a4be0bf18d..f8fd92074d 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java @@ -4,12 +4,12 @@ import android.support.v4.app.Fragment; import android.support.v7.app.AlertDialog; import android.view.View; import android.widget.LinearLayout; - import net.osmand.CallbackWithObject; import net.osmand.data.FavouritePoint; import net.osmand.data.LatLon; import net.osmand.data.PointDescription; import net.osmand.plus.ContextMenuAdapter; +import net.osmand.plus.TargetPointsHelper; import net.osmand.plus.GPXUtilities.GPXFile; import net.osmand.plus.GPXUtilities.WptPt; import net.osmand.plus.GpxSelectionHelper.SelectedGpxFile; @@ -352,9 +352,11 @@ public class MapContextMenu extends MenuTitleController { } public void fabPressed() { - mapActivity.getMapActions().directionTo(latLon.getLatitude(), latLon.getLongitude(), getPointDescription()); hide(); - mapActivity.getMapLayers().getMapControlsLayer().showRouteInfoControlDialog(); + final TargetPointsHelper targets = mapActivity.getMyApplication().getTargetPointsHelper(); + targets.navigateToPoint(latLon, true, targets.getIntermediatePoints().size() + 1, getPointDescription()); + mapActivity.getMapActions().enterRoutePlanningModeGivenGpx(null, null, null); +// mapActivity.getMapLayers().getMapControlsLayer().showRouteInfoControlDialog(); } public void buttonWaypointPressed() { diff --git a/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java b/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java index b90bccf9cf..1a264e24a9 100644 --- a/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java @@ -374,12 +374,13 @@ public class MapControlsLayer extends OsmandMapLayer { notifyClicked(); mapRouteInfoControlDialog.hideDialog(); optionsRouteControlDialog.hideDialog(); - RoutingHelper routingHelper = mapActivity.getMyApplication().getRoutingHelper(); - if (!routingHelper.isFollowingMode() && !routingHelper.isRoutePlanningMode()) { - mapActivity.getMapActions().enterRoutePlanningMode(null, null, false); - } else { +// RoutingHelper routingHelper = mapActivity.getMyApplication().getRoutingHelper(); +// if (!routingHelper.isFollowingMode() && !routingHelper.isRoutePlanningMode()) { + // never possible +// mapActivity.getMapActions().enterRoutePlanningMode(null, null, false); +// } else { startNavigation(); - } +// } } public void showRouteInfoControlDialog() { @@ -446,13 +447,11 @@ public class MapControlsLayer extends OsmandMapLayer { notifyClicked(); RoutingHelper routingHelper = mapActivity.getRoutingHelper(); if (!routingHelper.isFollowingMode() && !routingHelper.isRoutePlanningMode()) { - mapActivity.getMapActions().enterRoutePlanningMode(null, null, false); + mapActivity.getMapActions().enterRoutePlanningMode(null, null); } else { switchToRoutePlanningLayout(); } } - - }); } @@ -537,9 +536,10 @@ public class MapControlsLayer extends OsmandMapLayer { } + @Deprecated public void startCounter() { OsmandSettings settings = mapActivity.getMyApplication().getSettings(); - int del = settings.DELAY_TO_START_NAVIGATION.get(); + int del = 0; // settings.DELAY_TO_START_NAVIGATION.get(); if (del <= 0) { return; } diff --git a/OsmAnd/src/net/osmand/plus/views/controls/MapRouteInfoControl.java b/OsmAnd/src/net/osmand/plus/views/controls/MapRouteInfoControl.java index 1c0c059f42..77112e1e9e 100644 --- a/OsmAnd/src/net/osmand/plus/views/controls/MapRouteInfoControl.java +++ b/OsmAnd/src/net/osmand/plus/views/controls/MapRouteInfoControl.java @@ -92,9 +92,9 @@ public class MapRouteInfoControl implements IRouteInformationListener { public void setVisible(boolean visible) { if(visible) { if (showDialog){ - if (getTargets().getPointToNavigate() == null){ + //if (getTargets().getPointToNavigate() == null){ showDialog(); - } + //} showDialog = false; } controlVisible = true; From 6f6089f9a1eee4cb827a42cf4da4e4d23367cbf0 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Thu, 19 Nov 2015 01:15:18 +0100 Subject: [PATCH 22/36] Update center map --- OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java b/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java index f3c1604d5d..b34b0efe93 100644 --- a/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java +++ b/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java @@ -336,11 +336,11 @@ public class MapViewTrackingUtilities implements OsmAndLocationListener, IMapLoc RotatedTileBox tb = new RotatedTileBox(rt); tb.setPixelDimensions(4 * tb.getPixWidth() / 5, 4 * tb.getPixHeight() / 5); - double clat = bottom + top / 5; + double clat = 5 * bottom / 4 - top / 4; double clon = left / 2 + right / 2; // TODO for landscape menu // double clat = bottom / 2 + top / 2; -// double clon = left + right / 5; +// double clon = 5 * left / 4 - right / 4; tb.setLatLonCenter(clat, clon); while(tb.getZoom() >= 7 && (!tb.containsLatLon(top, left) || !tb.containsLatLon(bottom, right))) { tb.setZoom(tb.getZoom() - 1); From c3e4ccb040fdc6ca6bedbebb8f5417de6829850d Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Thu, 19 Nov 2015 01:19:08 +0100 Subject: [PATCH 23/36] Update center map --- OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java b/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java index b34b0efe93..060c06167a 100644 --- a/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java +++ b/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java @@ -335,7 +335,7 @@ public class MapViewTrackingUtilities implements OsmAndLocationListener, IMapLoc } RotatedTileBox tb = new RotatedTileBox(rt); - tb.setPixelDimensions(4 * tb.getPixWidth() / 5, 4 * tb.getPixHeight() / 5); + tb.setPixelDimensions(5 * tb.getPixWidth() / 6, 5 * tb.getPixHeight() / 6); double clat = 5 * bottom / 4 - top / 4; double clon = left / 2 + right / 2; // TODO for landscape menu From 2e64a27a8562d2d748bae7b8a7a5b658e1627e6a Mon Sep 17 00:00:00 2001 From: sonora Date: Thu, 19 Nov 2015 01:49:27 +0100 Subject: [PATCH 24/36] make zoom level visible longer --- OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java b/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java index 1a264e24a9..e6e507c3c6 100644 --- a/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java @@ -95,6 +95,7 @@ public class MapControlsLayer extends OsmandMapLayer { private MapHudButton mapZoomIn; private MapHudButton layersHud; private MapHudButton mapDashControl; + private long lastZoom; public MapControlsLayer(MapActivity activity) { this.mapActivity = activity; @@ -619,16 +620,20 @@ public class MapControlsLayer extends OsmandMapLayer { if(routeFollowingMode || routePlanningMode) { mapAppModeShadow.setVisibility(View.GONE); } else { + if (mapView.isZooming()) { + lastZoom = System.currentTimeMillis(); + } mapAppModeShadow.setVisibility(View.VISIBLE); - if (!mapView.isZooming() || !OsmandPlugin.isDevelopment()) { + //if (!mapView.isZooming() || !OsmandPlugin.isDevelopment()) { + //if ((System.currentTimeMillis()-lastZoom > 1000) || !OsmandPlugin.isDevelopment()) { zoomText.setVisibility(View.GONE); appModeIcon.setVisibility(View.VISIBLE); appModeIcon.setImageDrawable( app.getIconsCache().getIcon( settings.getApplicationMode().getSmallIconDark(), !isNight)); } else { - zoomText.setVisibility(View.VISIBLE); appModeIcon.setVisibility(View.GONE); + zoomText.setVisibility(View.VISIBLE); zoomText.setText(getZoomLevel(tileBox)); } } From 5afba1e0f9b2078ace0298fceb45e46c9c7fcc02 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Thu, 19 Nov 2015 01:52:09 +0100 Subject: [PATCH 25/36] Cacluate route without intermediates when click on fab --- .../src/net/osmand/plus/OsmandSettings.java | 3 ++ .../net/osmand/plus/TargetPointsHelper.java | 27 +++++++++++++++--- .../osmand/plus/activities/MapActivity.java | 6 ++-- .../plus/activities/MapActivityActions.java | 13 +++++---- .../plus/mapcontextmenu/MapContextMenu.java | 2 +- .../osmand/plus/routing/RoutingHelper.java | 28 +++++++++++-------- .../views/controls/MapRouteInfoControl.java | 2 +- 7 files changed, 55 insertions(+), 26 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/OsmandSettings.java b/OsmAnd/src/net/osmand/plus/OsmandSettings.java index bbce25e02f..042d5dffd3 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandSettings.java +++ b/OsmAnd/src/net/osmand/plus/OsmandSettings.java @@ -1500,6 +1500,9 @@ public class OsmandSettings { return settingsAPI.edit(globalPreferences).remove(INTERMEDIATE_POINTS).remove(INTERMEDIATE_POINTS_DESCRIPTION).commit(); } + public final CommonPreference USE_INTERMEDIATE_POINTS_NAVIGATION = + new BooleanPreference("use_intermediate_points_navigation", false).makeGlobal().cache(); + public List getIntermediatePointDescriptions(int sz) { List list = new ArrayList(); String ip = settingsAPI.getString(globalPreferences,INTERMEDIATE_POINTS_DESCRIPTION, ""); diff --git a/OsmAnd/src/net/osmand/plus/TargetPointsHelper.java b/OsmAnd/src/net/osmand/plus/TargetPointsHelper.java index e748b2036e..08f8ba4a37 100644 --- a/OsmAnd/src/net/osmand/plus/TargetPointsHelper.java +++ b/OsmAnd/src/net/osmand/plus/TargetPointsHelper.java @@ -123,13 +123,31 @@ public class TargetPointsHelper { return intermediatePoints; } + public List getIntermediatePointsNavigation() { + List intermediatePoints = new ArrayList<>(); + if (settings.USE_INTERMEDIATE_POINTS_NAVIGATION.get()) { + for (TargetPoint t : intermediatePoints) { + intermediatePoints.add(t); + } + } + return intermediatePoints; + } + public List getIntermediatePointsLatLon() { List intermediatePointsLatLon = new ArrayList(); - for (TargetPoint t : intermediatePoints) { intermediatePointsLatLon.add(t.point); } - + return intermediatePointsLatLon; + } + + public List getIntermediatePointsLatLonNavigation() { + List intermediatePointsLatLon = new ArrayList(); + if (settings.USE_INTERMEDIATE_POINTS_NAVIGATION.get()) { + for (TargetPoint t : intermediatePoints) { + intermediatePointsLatLon.add(t.point); + } + } return intermediatePointsLatLon; } @@ -209,13 +227,14 @@ public class TargetPointsHelper { private void updateRoutingHelper() { LatLon start = settings.getPointToStart(); Location lastKnownLocation = ctx.getLocationProvider().getLastKnownLocation(); + List is = getIntermediatePointsLatLonNavigation(); if((routingHelper.isFollowingMode() && lastKnownLocation != null) || start == null) { routingHelper.setFinalAndCurrentLocation(settings.getPointToNavigate(), - settings.getIntermediatePoints(), lastKnownLocation); + is, lastKnownLocation); } else { Location loc = wrap(start); routingHelper.setFinalAndCurrentLocation(settings.getPointToNavigate(), - settings.getIntermediatePoints(), loc); + is, loc); } } diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java index f8c936c54c..171613109d 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java @@ -442,7 +442,7 @@ public class MapActivity extends AccessibleActivity implements DownloadEvents { RoutingHelper routingHelper = app.getRoutingHelper(); if (routingHelper.isFollowingMode() && (!Algorithms.objectEquals(targets.getPointToNavigate().point, routingHelper.getFinalLocation()) || !Algorithms - .objectEquals(targets.getIntermediatePointsLatLon(), routingHelper.getIntermediatePoints()))) { + .objectEquals(targets.getIntermediatePointsLatLonNavigation(), routingHelper.getIntermediatePoints()))) { targets.updateRouteAndReferesh(true); } app.getLocationProvider().resumeAllUpdates(); @@ -516,7 +516,7 @@ public class MapActivity extends AccessibleActivity implements DownloadEvents { getMyApplication().getTargetPointsHelper().navigateToPoint(new LatLon(lat, lon), false, -1); - getMapActions().enterRoutePlanningModeGivenGpx(null, null, null); + getMapActions().enterRoutePlanningModeGivenGpx(null, null, null, false); } catch (NumberFormatException e) { AccessibleToast.makeText(this, getString(R.string.navigation_intent_invalid, schemeSpecificPart), @@ -541,7 +541,7 @@ public class MapActivity extends AccessibleActivity implements DownloadEvents { Location loc = new Location("map"); loc.setLatitude(mapView.getLatitude()); loc.setLongitude(mapView.getLongitude()); - getMapActions().enterRoutePlanningModeGivenGpx(null, null, null); + getMapActions().enterRoutePlanningModeGivenGpx(null, null, null, true); if (dashboardOnMap.isVisible()) { dashboardOnMap.hideDashboard(); } diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java index 8ec78765a0..d6bb4c270d 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java @@ -337,6 +337,7 @@ public class MapActivityActions implements DialogProvider { } public void enterRoutePlanningMode(final LatLon from, final PointDescription fromName) { + final boolean useIntermediatePointsByDefault = true; List selectedGPXFiles = mapActivity.getMyApplication().getSelectedGpxHelper() .getSelectedGPXFiles(); final List gpxFiles = new ArrayList(); @@ -355,7 +356,7 @@ public class MapActivityActions implements DialogProvider { bld.setPositiveButton(R.string.shared_string_yes, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { - enterRoutePlanningModeGivenGpx(gpxFiles.get(0), from, fromName); + enterRoutePlanningModeGivenGpx(gpxFiles.get(0), from, fromName, useIntermediatePointsByDefault); } }); } else { @@ -377,7 +378,7 @@ public class MapActivityActions implements DialogProvider { bld.setAdapter(adapter, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { - enterRoutePlanningModeGivenGpx(gpxFiles.get(i), from, fromName); + enterRoutePlanningModeGivenGpx(gpxFiles.get(i), from, fromName, useIntermediatePointsByDefault); } }); } @@ -385,17 +386,17 @@ public class MapActivityActions implements DialogProvider { bld.setNegativeButton(R.string.shared_string_no, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { - enterRoutePlanningModeGivenGpx(null, from, fromName); + enterRoutePlanningModeGivenGpx(null, from, fromName, useIntermediatePointsByDefault); } }); bld.show(); } else { - enterRoutePlanningModeGivenGpx(null, from, fromName); + enterRoutePlanningModeGivenGpx(null, from, fromName, useIntermediatePointsByDefault); } } - public void enterRoutePlanningModeGivenGpx(GPXFile gpxFile, LatLon from, PointDescription fromName) { - + public void enterRoutePlanningModeGivenGpx(GPXFile gpxFile, LatLon from, PointDescription fromName, boolean useIntermediatePointsByDefault) { + settings.USE_INTERMEDIATE_POINTS_NAVIGATION.set(useIntermediatePointsByDefault); OsmandApplication app = mapActivity.getMyApplication(); TargetPointsHelper targets = app.getTargetPointsHelper(); diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java index f8fd92074d..aade631f5d 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java @@ -355,7 +355,7 @@ public class MapContextMenu extends MenuTitleController { hide(); final TargetPointsHelper targets = mapActivity.getMyApplication().getTargetPointsHelper(); targets.navigateToPoint(latLon, true, targets.getIntermediatePoints().size() + 1, getPointDescription()); - mapActivity.getMapActions().enterRoutePlanningModeGivenGpx(null, null, null); + mapActivity.getMapActions().enterRoutePlanningModeGivenGpx(null, null, null, false); // mapActivity.getMapLayers().getMapControlsLayer().showRouteInfoControlDialog(); } diff --git a/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java b/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java index 188810e295..de02b50bd6 100644 --- a/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java +++ b/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java @@ -458,21 +458,27 @@ public class RoutingHelper { if(route.getIntermediatePointsToPass() > 0 && route.getDistanceToNextIntermediate(lastFixedLocation) < POSITION_TOLERANCE * 2) { showMessage(app.getString(R.string.arrived_at_intermediate_point)); route.passIntermediatePoint(); - TargetPointsHelper targets = app.getTargetPointsHelper(); - List ns = targets.getIntermediatePoints(); - int toDel = targets.getIntermediatePoints().size() - route.getIntermediatePointsToPass(); - int currentIndex = toDel - 1; - String name = currentIndex < 0 || currentIndex >= ns.size() || - ns.get(currentIndex ) == null ? "" : ns.get(currentIndex ).getOnlyName(); + String name = ""; + if(intermediatePoints != null ) { + LatLon rm = intermediatePoints.remove(0); + List ll = targets.getIntermediatePointsNavigation(); + int ind = -1; + for(int i = 0; i < ll.size(); i++) { + if(ll.get(i).point != null && MapUtils.getDistance(ll.get(i).point, rm) < 5) { + name = ll.get(i).getOnlyName(); + ind = i; + break; + } + } + if(ind >= 0) { + targets.removeWayPoint(false, ind); + } + } if(isFollowingMode) { voiceRouter.arrivedIntermediatePoint(name); } - while(toDel > 0) { - targets.removeWayPoint(false, 0); - toDel--; - } - + // double check while(intermediatePoints != null && route.getIntermediatePointsToPass() < intermediatePoints.size()) { intermediatePoints.remove(0); } diff --git a/OsmAnd/src/net/osmand/plus/views/controls/MapRouteInfoControl.java b/OsmAnd/src/net/osmand/plus/views/controls/MapRouteInfoControl.java index 77112e1e9e..c469543cf9 100644 --- a/OsmAnd/src/net/osmand/plus/views/controls/MapRouteInfoControl.java +++ b/OsmAnd/src/net/osmand/plus/views/controls/MapRouteInfoControl.java @@ -441,7 +441,7 @@ public class MapRouteInfoControl implements IRouteInformationListener { public String generateViaDescription() { TargetPointsHelper targets = getTargets(); String via = ""; - List points = targets.getIntermediatePoints(); + List points = targets.getIntermediatePointsNavigation(); if (points.size() == 0) { return via; } From 692dd68db92291a87db6125110399f9733a3bfdd Mon Sep 17 00:00:00 2001 From: sonora Date: Thu, 19 Nov 2015 01:55:04 +0100 Subject: [PATCH 26/36] fix build --- OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java b/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java index e6e507c3c6..38668c1175 100644 --- a/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java @@ -625,7 +625,7 @@ public class MapControlsLayer extends OsmandMapLayer { } mapAppModeShadow.setVisibility(View.VISIBLE); //if (!mapView.isZooming() || !OsmandPlugin.isDevelopment()) { - //if ((System.currentTimeMillis()-lastZoom > 1000) || !OsmandPlugin.isDevelopment()) { + if ((System.currentTimeMillis()-lastZoom > 1000) || !OsmandPlugin.isDevelopment()) { zoomText.setVisibility(View.GONE); appModeIcon.setVisibility(View.VISIBLE); appModeIcon.setImageDrawable( From efcda46adb5d47ee366f24d41b3e9c55fed9b2f6 Mon Sep 17 00:00:00 2001 From: sonora Date: Thu, 19 Nov 2015 03:45:08 +0100 Subject: [PATCH 27/36] string clarification --- OsmAnd/res/values/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index ddb9821f44..0f1e8f8437 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -9,7 +9,7 @@ 3. All your modified/created strings are in the top of the file (to make easier find what\'s translated). PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy --> - Places a dashboard button on the map screen + Menu button launches dashboard, not menu Access from map \'Off\' directly launches the map screen Show on start From dafafec0b5efe7b686958979cbe8e0831640fe12 Mon Sep 17 00:00:00 2001 From: sonora Date: Thu, 19 Nov 2015 03:52:45 +0100 Subject: [PATCH 28/36] string improvement (de) --- OsmAnd/res/values-de/strings.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OsmAnd/res/values-de/strings.xml b/OsmAnd/res/values-de/strings.xml index e1d6dca6ef..38c646471f 100644 --- a/OsmAnd/res/values-de/strings.xml +++ b/OsmAnd/res/values-de/strings.xml @@ -2138,7 +2138,7 @@ Afghanistan, Ägypten, Albanien, Algerien, Andorra, Angola, Anguilla, Antigua an Feedback Kontakt Kartenlegende - Plaziert einen Dashboard-Knopf auf dem Bildschirm + Menü-Knopf zeigt Dashboard, nicht Menü \"Aus\" startet direkt die Kartenansicht. in die Zwischenablage kopiert " • Neue Kontext-bezogene Benutzeroberfläche bei Auswahl von Orten auf der Karte und anderen Ansichten\n\n • Kartenansicht wird nun direkt gestartet, außer bei Auswahl von \'Zeige Dashboard bei App-Start\'\n\n • Auswahl der anzuzeigenden Elemente im Dashboard möglich\n\n • Zum Herunterladen von Kartendateien können nun Regionen direkt durch Tippen auf der Weltkarte ausgewählt werden\n\n • Die POI-Suche ermöglicht nun speziellere Abfragen\n\n • Verbesserungen beim Editieren von POI- und OSM-Objekten\n\n • Oberfläche und Struktur zum Herunterladen der Karten wurden überarbeitet\n\n und mehr ... " @@ -2186,7 +2186,7 @@ Afghanistan, Ägypten, Albanien, Algerien, Andorra, Angola, Anguilla, Antigua an Kartenansicht starten Neue Auswahl des Startvorgangs Es ist nun auswählbar, ob beim Start der App gleich die Kartenansicht oder das Dashboard angezeigt wird. (Jederzeit in den Dashboard-Einstellungen änderbar) -Aufruf von der Karte aus + Aufruf von der Karte aus neu erstellen Weiter %.1f MB From 8a9a8331af0dc87e22d62fadb340645ce8a13d66 Mon Sep 17 00:00:00 2001 From: sonora Date: Thu, 19 Nov 2015 04:11:20 +0100 Subject: [PATCH 29/36] string correction --- OsmAnd/res/values/strings.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index 0f1e8f8437..06a3f6d5f0 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -2091,8 +2091,8 @@ Afghanistan, Albania, Algeria, Andorra, Angola, Anguilla, Antigua and Barbuda, A Map legend Do you really want to save poi without POI type? Modify OSM change - Launch dashboard - Launch map - New startup choice - You can now select if the app directly launches the map screen or always displays the dashboard first. Your choice can always be changed in the dashboard settings. + Use dashboard + Use menu + Dashboard or menu control + There is a new choice to primarily control the app via the flexible dashboard or a static menu. Your choice can always be changed in the dashboard settings. From 96ee8d015d8c3d599a44cbb4ec7e828f940fde16 Mon Sep 17 00:00:00 2001 From: sonora Date: Thu, 19 Nov 2015 04:14:32 +0100 Subject: [PATCH 30/36] string improvement (de) --- OsmAnd/res/values-de/strings.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/OsmAnd/res/values-de/strings.xml b/OsmAnd/res/values-de/strings.xml index 38c646471f..5b762dcb82 100644 --- a/OsmAnd/res/values-de/strings.xml +++ b/OsmAnd/res/values-de/strings.xml @@ -2182,10 +2182,10 @@ Afghanistan, Ägypten, Albanien, Algerien, Andorra, Angola, Anguilla, Antigua an Name des Landes eingeben Soll der POI wirklich ohne Art des POI gespeichert werden? OSM-Änderung bearbeiten - Dashboard starten - Kartenansicht starten - Neue Auswahl des Startvorgangs - Es ist nun auswählbar, ob beim Start der App gleich die Kartenansicht oder das Dashboard angezeigt wird. (Jederzeit in den Dashboard-Einstellungen änderbar) + Dashboard verwenden + Menü verwenden + Auswahl der App-Bedienung + Es ist nun auswählbar, ob die App primär über das flexible Dashboard oder über ein statisches Menü bedient werden soll. (Jederzeit in den Dashboard-Einstellungen änderbar) Aufruf von der Karte aus neu erstellen Weiter From 90779de044b0ee13066e2f49cf4793d36ad59ba1 Mon Sep 17 00:00:00 2001 From: sonora Date: Thu, 19 Nov 2015 04:22:04 +0100 Subject: [PATCH 31/36] string improvement --- OsmAnd/res/values-de/strings.xml | 2 +- OsmAnd/res/values/strings.xml | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/OsmAnd/res/values-de/strings.xml b/OsmAnd/res/values-de/strings.xml index 5b762dcb82..2cd5d62ecf 100644 --- a/OsmAnd/res/values-de/strings.xml +++ b/OsmAnd/res/values-de/strings.xml @@ -2141,7 +2141,7 @@ Afghanistan, Ägypten, Albanien, Algerien, Andorra, Angola, Anguilla, Antigua an Menü-Knopf zeigt Dashboard, nicht Menü \"Aus\" startet direkt die Kartenansicht. in die Zwischenablage kopiert - " • Neue Kontext-bezogene Benutzeroberfläche bei Auswahl von Orten auf der Karte und anderen Ansichten\n\n • Kartenansicht wird nun direkt gestartet, außer bei Auswahl von \'Zeige Dashboard bei App-Start\'\n\n • Auswahl der anzuzeigenden Elemente im Dashboard möglich\n\n • Zum Herunterladen von Kartendateien können nun Regionen direkt durch Tippen auf der Weltkarte ausgewählt werden\n\n • Die POI-Suche ermöglicht nun speziellere Abfragen\n\n • Verbesserungen beim Editieren von POI- und OSM-Objekten\n\n • Oberfläche und Struktur zum Herunterladen der Karten wurden überarbeitet\n\n und mehr ... " + " • Neue Kontext-bezogene Benutzeroberfläche bei Auswahl von Orten auf der Karte und anderen Ansichten\n\n • Kartenansicht wird nun direkt gestartet, außer bei Auswahl von \'Zeige Dashboard bei App-Start\'\n\n • Auswahl der anzuzeigenden Elemente im Dashboard möglich\n\n • Dashboard kann umgangen werden, falls menü-basierte App-Steuerung gewünscht ist\n\n • Zum Herunterladen von Kartendateien können nun Regionen direkt durch Tippen auf der Weltkarte ausgewählt werden\n\n • Die POI-Suche ermöglicht nun speziellere Abfragen\n\n • Verbesserungen beim Editieren von POI- und OSM-Objekten\n\n • Oberfläche und Struktur zum Herunterladen der Karten wurden überarbeitet\n\n und mehr ... " offline speichern geänderter OSM-POI OSM-POI löschen diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index 06a3f6d5f0..e65e49afce 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -15,14 +15,15 @@ Show on start Copied to clipboard - \u2022 New context-sensitive UI for tapping locations on the map and on other screens\n\n - \u2022 Map screen is now launched directly unless \'Show dashboard on app start\' is selected\n\n - \u2022 Configure which and how cards are displayed on the dashboard\n\n - \u2022 To download maps, regions can be directly selected by tapping on the world map\n\n - \u2022 POI Search now supports more specific queries\n\n + \u2022 New context-sensitive UI for tapping locations on the map and on other screens\n\n + \u2022 Map screen is now launched directly unless \'Show dashboard on app start\' is selected\n\n + \u2022 Configure which and how cards are displayed on the dashboard\n\n + \u2022 Bypass the dashboard if you like menu-based app control\n\n + \u2022 To download maps, regions can be directly selected by tapping on the world map\n\n + \u2022 POI Search now supports more specific queries\n\n \u2022 Improved POI and OSM editing functionality\n\n - \u2022 Map data download structure and interface reworked\n\n - and more... + \u2022 Map data download structure and interface reworked\n\n + and more... Save offline Modified OSM POI From 23e08812143f04cbef9121fbbfcd1a0d048cdd27 Mon Sep 17 00:00:00 2001 From: jan madsen Date: Thu, 19 Nov 2015 06:29:31 +0100 Subject: [PATCH 32/36] Translated using Weblate (Danish) Currently translated at 100.0% (1831 of 1831 strings) --- OsmAnd/res/values-da/strings.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/OsmAnd/res/values-da/strings.xml b/OsmAnd/res/values-da/strings.xml index ce74a313dc..6056bc3a45 100644 --- a/OsmAnd/res/values-da/strings.xml +++ b/OsmAnd/res/values-da/strings.xml @@ -2095,7 +2095,7 @@ Note lukket Ændret OSM IP Slettet OSM IP - " • Ny kontekstafhængig brugergrænseflade når der vælges lokationer på kortet og på andre skærme\n\n • Kortskærmen vises direkte, medmindre \'Vis oversigtpanel ved start\' er valgt\n\n • Konfigurer hvordan og hvilket indhold der vises på oversigtspanelet\n\n • Hent kort, regioner ved at trykke direkte på verdenskortet\n\n • IP søgning understøtter nu mere specifikke forespørgsler\n\n • Forbedret IP og OSM redigeringsfunktionalitet\n\n • Administration af kortfiler struktur og grænseflade er omarbejdet\n\n og mere... " + " • Ny kontekstafhængig brugergrænseflade når der vælges lokationer på kortet og på andre skærme\n\n • Kortskærmen vises direkte, medmindre \'Vis oversigtpanel ved start\' er valgt\n\n • Konfigurer hvordan og hvilket indhold der vises på oversigtspanelet\n\n • omgå oversigtspanel hvis du kan lide menu-baserede app kontrol\n\n • Hent kort, regioner ved at trykke direkte på verdenskortet\n\n • IP søgning understøtter nu mere specifikke forespørgsler\n\n • Forbedret IP og OSM redigeringsfunktionalitet\n\n • Administration af kortfiler struktur og grænseflade er omarbejdet\n\n og mere... " Gem offline GPX-farve GPX-bredde @@ -2103,10 +2103,10 @@ Kopieret til udklipsholder - Nyt valg for opstart - Vælg om programmet starter med at vise korter eller oversigtspanel først. Kan ændres i indstillinger for oversigtspanel. - Start med oversigtspanel - Start med kortet - Placerer en knap til oversigtspanelet på kortskærmen + Oversigtspanel eller menu kontrol + Der er en ny valg til primært kontrollere app via fleksibel oversigtspanel eller et statisk menu. Kan ændres i indstillinger for oversigtspanel. + Brug oversigtspanel + Brug menuen + Menuknappen viser oversigtspanel, ikke menu Adgang fra kort From 0f2d547a109ee2b89f6b4eabb08fcc90f71aa7b3 Mon Sep 17 00:00:00 2001 From: Alexey Kulish Date: Thu, 19 Nov 2015 10:04:40 +0300 Subject: [PATCH 33/36] Fix - Do not show context menu when map opens from Go to map dialog --- OsmAnd/src/net/osmand/data/PointDescription.java | 5 +++++ OsmAnd/src/net/osmand/plus/activities/MapActivity.java | 2 +- OsmAnd/src/net/osmand/plus/download/DownloadActivity.java | 8 +++++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/data/PointDescription.java b/OsmAnd/src/net/osmand/data/PointDescription.java index 5e318bf0cc..c44aa9a6b6 100644 --- a/OsmAnd/src/net/osmand/data/PointDescription.java +++ b/OsmAnd/src/net/osmand/data/PointDescription.java @@ -41,6 +41,7 @@ public class PointDescription { public static final String POINT_TYPE_OSM_BUG = "bug"; public static final String POINT_TYPE_WORLD_REGION = "world_region"; public static final String POINT_TYPE_GPX_ITEM = "gpx_item"; + public static final String POINT_TYPE_WORLD_REGION_SHOW_ON_MAP = "world_region_show_on_map"; public static final PointDescription LOCATION_POINT = new PointDescription(POINT_TYPE_LOCATION, ""); @@ -149,6 +150,10 @@ public class PointDescription { } } + public boolean contextMenuDisabled() { + return POINT_TYPE_WORLD_REGION_SHOW_ON_MAP.equals(type); + } + public boolean isLocation() { return POINT_TYPE_LOCATION.equals(type); } diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java index 171613109d..b50e0c22a1 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java @@ -550,7 +550,7 @@ public class MapActivity extends AccessibleActivity implements DownloadEvents { if (dashboardOnMap.isVisible()) { dashboardOnMap.hideDashboard(); } - if (mapLabelToShow != null) { + if (mapLabelToShow != null && !mapLabelToShow.contextMenuDisabled()) { mapContextMenu.setMapCenter(latLonToShow); mapContextMenu.setMapPosition(mapView.getMapPosition()); mapContextMenu.show(latLonToShow, mapLabelToShow, toShow); diff --git a/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java b/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java index 0ed424bd63..0c57c72f8d 100644 --- a/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java +++ b/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java @@ -31,6 +31,7 @@ import net.osmand.IProgress; import net.osmand.PlatformUtil; import net.osmand.access.AccessibleToast; import net.osmand.data.LatLon; +import net.osmand.data.PointDescription; import net.osmand.map.WorldRegion; import net.osmand.map.WorldRegion.RegionParams; import net.osmand.plus.OsmandApplication; @@ -793,7 +794,12 @@ public class DownloadActivity extends ActionBarProgressActivity implements Downl @Override public void onClick(View v) { OsmandApplication app = (OsmandApplication) getActivity().getApplication(); - app.getSettings().setMapLocationToShow(regionCenter.getLatitude(), regionCenter.getLongitude(), 5, null); + app.getSettings().setMapLocationToShow( + regionCenter.getLatitude(), + regionCenter.getLongitude(), + 5, + new PointDescription(PointDescription.POINT_TYPE_WORLD_REGION_SHOW_ON_MAP, "")); + dismiss(); MapActivity.launchMapActivityMoveToTop(getActivity()); } From c0938c731ca4303497ae16831550ddc4692409ae Mon Sep 17 00:00:00 2001 From: P Date: Thu, 19 Nov 2015 05:54:49 +0100 Subject: [PATCH 34/36] Translated using Weblate (Bulgarian) Currently translated at 85.4% (1564 of 1831 strings) --- OsmAnd/res/values-bg/strings.xml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/OsmAnd/res/values-bg/strings.xml b/OsmAnd/res/values-bg/strings.xml index 1416a4dbd0..ab5dd90015 100644 --- a/OsmAnd/res/values-bg/strings.xml +++ b/OsmAnd/res/values-bg/strings.xml @@ -1,4 +1,5 @@ - + + Моля, въведете потребителско име и парола за сайта на OSM Изчистване на междинните точки Запази междинните точки @@ -2020,4 +2021,11 @@ OsmAnd е с отворен код и активно да се развива. Навигация Работи във фонов режим Предпочитана информация - \ No newline at end of file + Да се показва при стартиране + Копирано + " • Нов контекстно-ориентиран интерфейс\n\n • При стартиране на приложението се извежда картата, освен ако не е избрано \'Показване на таблото при стартиране\'\n\n • Настройване на контролите върху таблото за управление\n\n • Пропускане на таблото, ако предпочитате приложение с меню\n\n • To download maps, regions can be directly selected by tapping on the world map\n\n • POI Search now supports more specific queries\n\n • Improved POI and OSM editing functionality\n\n • Map data download structure and interface reworked\n\n и още... " + Запази офлайн + Модифицирани OSM POI + Изтрити OSM POI + Отвори OSM бележка + From 2fe00a6dcfc32f287e3d0549617cb12cbca1e7a9 Mon Sep 17 00:00:00 2001 From: jan madsen Date: Thu, 19 Nov 2015 07:25:59 +0100 Subject: [PATCH 35/36] Translated using Weblate (Danish) Currently translated at 100.0% (1831 of 1831 strings) --- OsmAnd/res/values-da/strings.xml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/OsmAnd/res/values-da/strings.xml b/OsmAnd/res/values-da/strings.xml index 6056bc3a45..46b0526faa 100644 --- a/OsmAnd/res/values-da/strings.xml +++ b/OsmAnd/res/values-da/strings.xml @@ -237,7 +237,7 @@ Afhent bilen: AM Parkeringssted - Parkeringsplads udvidelsen kan huske hvor bilen er parkeret, og hvor meget parkeringstid der er tilbage (hvis der er en tidsfrist).\nBåde placering og tid er synlige på oversigtspanelet samt i modul på kortskærmen. En alarm kan tilføjes til Android kalenderen, som en påmindelse. + Parkeringsplads udvidelsen kan huske hvor bilen er parkeret, og hvor meget parkeringstid der er tilbage (hvis der er en tidsfrist).\nBåde placering og tid er synlige på betjeningspanel samt i modul på kortskærmen. En alarm kan tilføjes til Android kalenderen, som en påmindelse. Parkering Marker som parkeringsplads Slet en parkeringsmarkør @@ -1484,7 +1484,7 @@ Swahili Hebræisk Frem - Oversigtspanel + Betjeningspanel Send sporing til en bestemt webtjeneste, hvis GPX logning er aktiveret. Online sporing (GPX nødvendig) Start online sporing @@ -1925,7 +1925,7 @@ Vi er meget interesseret i din mening, og det er vigtigt for os at høre fra dig. Fed kontur Fare - Konfigurer oversigtspanel + Konfigurer betjeningspanel Kortet blev skjult FORTRYD Spring over @@ -2095,7 +2095,7 @@ Note lukket Ændret OSM IP Slettet OSM IP - " • Ny kontekstafhængig brugergrænseflade når der vælges lokationer på kortet og på andre skærme\n\n • Kortskærmen vises direkte, medmindre \'Vis oversigtpanel ved start\' er valgt\n\n • Konfigurer hvordan og hvilket indhold der vises på oversigtspanelet\n\n • omgå oversigtspanel hvis du kan lide menu-baserede app kontrol\n\n • Hent kort, regioner ved at trykke direkte på verdenskortet\n\n • IP søgning understøtter nu mere specifikke forespørgsler\n\n • Forbedret IP og OSM redigeringsfunktionalitet\n\n • Administration af kortfiler struktur og grænseflade er omarbejdet\n\n og mere... " + " • Ny kontekstafhængig brugergrænseflade når der vælges lokationer på kortet og på andre skærme\n\n • Kortskærmen vises direkte, medmindre \'Vis betjeningspanel ved start\' er valgt\n\n • Konfigurer hvordan og hvilket indhold der vises på betjeningspanelet\n\n • Forbigå betjeningspanel hvis der ønskes menuen-baserede app-kontrol\n\n • Hent kort, regioner ved at trykke direkte på verdenskortet\n\n • IP søgning understøtter nu mere specifikke forespørgsler\n\n • Forbedret IP og OSM redigeringsfunktionalitet\n\n • Administration af kortfiler struktur og grænseflade er omarbejdet\n\n og mere... " Gem offline GPX-farve GPX-bredde @@ -2103,10 +2103,10 @@ Kopieret til udklipsholder - Oversigtspanel eller menu kontrol - Der er en ny valg til primært kontrollere app via fleksibel oversigtspanel eller et statisk menu. Kan ændres i indstillinger for oversigtspanel. - Brug oversigtspanel + Betjeningspanel eller menu kontrol + Der er et nyt valg til at betjene app via det fleksibel betjeningspanel eller en statisk menu. Kan ændres i indstillinger for betjeningspanel . + Brug betjeningspanel Brug menuen - Menuknappen viser oversigtspanel, ikke menu + Menuknappen viser betjeningspanel, ikke menuen Adgang fra kort From 396ac24404ee4c0994f7c52d93e5e42cbe4924d6 Mon Sep 17 00:00:00 2001 From: ezjerry liao Date: Thu, 19 Nov 2015 08:15:39 +0100 Subject: [PATCH 36/36] Translated using Weblate (Chinese (Taiwan)) Currently translated at 100.0% (1831 of 1831 strings) --- OsmAnd/res/values-zh-rTW/strings.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/OsmAnd/res/values-zh-rTW/strings.xml b/OsmAnd/res/values-zh-rTW/strings.xml index 40194f5ace..14581be21c 100644 --- a/OsmAnd/res/values-zh-rTW/strings.xml +++ b/OsmAnd/res/values-zh-rTW/strings.xml @@ -2003,14 +2003,14 @@ 道路樣式 重新開啟 離線儲存 - " •在地圖上和其它螢幕上,為點擊位置做了新的敏捷內容選單使用者界面\n\n•地圖螢幕上現在除了直接啟動外,還有\'在應用程式時啟動顯示儀表板\'可選\n\n •組態哪些以及何種卡可以在儀表板上顯示\n\n •要下載地圖,可以直接在全球地圖上點選區域\n\n •更好的重新計算路線(現在引擎經過反復的嘗試,建議一條不同的路線)\n\n •興趣點搜尋現在支援更具體的查詢\n\n •改善過的興趣點和 OSM 編輯功能\n\n •地圖資料下載結構和界面重新設計\n\n 還有更多... " + " •在地圖上和其它螢幕上,為點擊位置做了新的敏捷內容選單使用者界面\n\n•地圖螢幕上現在除了直接啟動外,還有\'在應用程式時啟動顯示儀表板\'可選\n\n •組態哪些以及何種卡可以在儀表板上顯示\n\n•如果您喜歡基本選單的應用程式控制,繞過儀表板方式\n\n •要下載地圖,可以直接在全球地圖上點選區域\n\n •更好的重新計算路線(現在引擎經過反復的嘗試,建議一條不同的路線)\n\n •興趣點搜尋現在支援更具體的查詢\n\n •改善過的興趣點和 OSM 編輯功能\n\n •地圖資料下載結構和界面重新設計\n\n 還有更多... " 複製到剪貼簿 - 新的起始選擇 - 您現在可以選擇,如果應用程式直接啟動在地圖螢幕或是永遠先顯示儀表板。您稍後也可以在設定中更改。 - 將儀表板按鈕放置在地圖螢幕上 + 儀表板或選單控制 + 還有一種新的選擇,透過具彈性的儀表板或固定的選單優先控制應用程式。在儀表板中也可以更改您的選擇。 + 選單按鈕啟動儀表板,無選單 從地圖進入 - 開始儀表板 - 開始地圖 + 使用儀表板 + 使用地圖