This resolves #1893
This commit is contained in:
parent
843ba63cf3
commit
71f7f9b5d3
8 changed files with 75 additions and 75 deletions
|
@ -1,4 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8" standalone="no"?><resources>
|
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||||
|
<resources>
|
||||||
<string name="screen_is_locked">För att låsa upp skärmen tryck på låsikonen</string>
|
<string name="screen_is_locked">För att låsa upp skärmen tryck på låsikonen</string>
|
||||||
<string name="ChooseCountry">Välj land</string>
|
<string name="ChooseCountry">Välj land</string>
|
||||||
<string name="choose_city">Välj stad</string>
|
<string name="choose_city">Välj stad</string>
|
||||||
|
@ -1751,7 +1752,7 @@
|
||||||
<string name="routing_attr_height_name">Höjdgräns</string>
|
<string name="routing_attr_height_name">Höjdgräns</string>
|
||||||
<string name="use_fast_recalculation">Smart omräkning av rutt</string>
|
<string name="use_fast_recalculation">Smart omräkning av rutt</string>
|
||||||
<string name="use_fast_recalculation_desc">Räkna om endast början av rutten för långa resor</string>
|
<string name="use_fast_recalculation_desc">Räkna om endast början av rutten för långa resor</string>
|
||||||
|
|
||||||
<string name="routing_attr_height_description">Ange tillåten fordonshöjd på rutter</string>
|
<string name="routing_attr_height_description">Ange tillåten fordonshöjd på rutter</string>
|
||||||
<string name="osmo_share_my_location">Dela ut min position</string>
|
<string name="osmo_share_my_location">Dela ut min position</string>
|
||||||
<string name="shared_string_logoff">Logga ut</string>
|
<string name="shared_string_logoff">Logga ut</string>
|
||||||
|
@ -1859,8 +1860,8 @@
|
||||||
<string name="contact_info">Kontaktinformation</string>
|
<string name="contact_info">Kontaktinformation</string>
|
||||||
<string name="dahboard_options_dialog_title">Konfigurera panelen</string>
|
<string name="dahboard_options_dialog_title">Konfigurera panelen</string>
|
||||||
<string name="commit_poi">Skicka in POI</string>
|
<string name="commit_poi">Skicka in POI</string>
|
||||||
|
|
||||||
|
|
||||||
<string name="number_of_rows_in_dash">Antal rader i panelen: %1$s</string>
|
<string name="number_of_rows_in_dash">Antal rader i panelen: %1$s</string>
|
||||||
<string name="please_specify_poi_type">Ange typ av POI.</string>
|
<string name="please_specify_poi_type">Ange typ av POI.</string>
|
||||||
<string name="favourites">Favoriter</string>
|
<string name="favourites">Favoriter</string>
|
||||||
|
@ -1951,9 +1952,8 @@
|
||||||
<string name="map_viewing_item">Kartvisning</string>
|
<string name="map_viewing_item">Kartvisning</string>
|
||||||
<string name="search_on_the_map_item">Söka på kartan</string>
|
<string name="search_on_the_map_item">Söka på kartan</string>
|
||||||
<string name="planning_trip_item">Att planera en resa</string>
|
<string name="planning_trip_item">Att planera en resa</string>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<string name="instalation_troubleshooting_item">Installation och problemlösning</string>
|
<string name="instalation_troubleshooting_item">Installation och problemlösning</string>
|
||||||
<string name="techical_articles_item">Tekniska artiklar</string>
|
<string name="techical_articles_item">Tekniska artiklar</string>
|
||||||
<string name="versions_item">Versioner</string>
|
<string name="versions_item">Versioner</string>
|
||||||
|
@ -1961,14 +1961,12 @@
|
||||||
<string name="osm_edit_created_poi">Skapat en OSM POI</string>
|
<string name="osm_edit_created_poi">Skapat en OSM POI</string>
|
||||||
<string name="osm_edit_created_bug">Skapat en OSM-bugg</string>
|
<string name="osm_edit_created_bug">Skapat en OSM-bugg</string>
|
||||||
<string name="world_map_download_descr">Baskarta över världen (täcker hela världen med låg zoomningsgrad) saknas eller är gammal. Hämta gärna denna karta till din enhet.</string>
|
<string name="world_map_download_descr">Baskarta över världen (täcker hela världen med låg zoomningsgrad) saknas eller är gammal. Hämta gärna denna karta till din enhet.</string>
|
||||||
<string name="shared_string_upload">Skicka</string>
|
<string name="shared_string_upload">Skicka</string>
|
||||||
<string name="map_legend">Teckenförklaring</string>
|
<string name="map_legend">Teckenförklaring</string>
|
||||||
<string name="shared_string_update">Uppdatera</string>
|
<string name="shared_string_update">Uppdatera</string>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<string name="feedback">Återkoppling</string>
|
<string name="feedback">Återkoppling</string>
|
||||||
<string name="read_more">Läs mer</string>
|
<string name="read_more">Läs mer</string>
|
||||||
<string name="whats_new">Nyheter</string>
|
<string name="whats_new">Nyheter</string>
|
||||||
<string name="rendering_attr_hideProposed_name">Dölj föreslagna objekt</string>
|
<string name="rendering_attr_hideProposed_name">Dölj föreslagna objekt</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -7,6 +7,7 @@ import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
|
|
||||||
import net.osmand.IProgress;
|
import net.osmand.IProgress;
|
||||||
import net.osmand.IndexConstants;
|
import net.osmand.IndexConstants;
|
||||||
import net.osmand.PlatformUtil;
|
import net.osmand.PlatformUtil;
|
||||||
|
|
|
@ -1,12 +1,30 @@
|
||||||
package net.osmand.plus;
|
package net.osmand.plus;
|
||||||
|
|
||||||
import java.io.BufferedWriter;
|
import android.app.Activity;
|
||||||
import java.io.ByteArrayOutputStream;
|
import android.app.AlarmManager;
|
||||||
import java.io.File;
|
import android.app.AlertDialog;
|
||||||
import java.io.FileWriter;
|
import android.app.AlertDialog.Builder;
|
||||||
import java.io.PrintStream;
|
import android.app.Application;
|
||||||
import java.lang.Thread.UncaughtExceptionHandler;
|
import android.app.PendingIntent;
|
||||||
import java.util.Locale;
|
import android.content.Context;
|
||||||
|
import android.content.DialogInterface;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.pm.PackageInfo;
|
||||||
|
import android.content.pm.PackageManager.NameNotFoundException;
|
||||||
|
import android.content.res.Configuration;
|
||||||
|
import android.os.AsyncTask;
|
||||||
|
import android.os.Build;
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.os.Message;
|
||||||
|
import android.text.format.DateFormat;
|
||||||
|
import android.util.TypedValue;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.accessibility.AccessibilityManager;
|
||||||
|
import android.widget.CheckBox;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
import android.widget.LinearLayout.LayoutParams;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
import net.osmand.PlatformUtil;
|
import net.osmand.PlatformUtil;
|
||||||
import net.osmand.access.AccessibilityPlugin;
|
import net.osmand.access.AccessibilityPlugin;
|
||||||
|
@ -34,31 +52,15 @@ import net.osmand.plus.routing.RoutingHelper;
|
||||||
import net.osmand.plus.voice.CommandPlayer;
|
import net.osmand.plus.voice.CommandPlayer;
|
||||||
import net.osmand.router.RoutingConfiguration;
|
import net.osmand.router.RoutingConfiguration;
|
||||||
import net.osmand.util.Algorithms;
|
import net.osmand.util.Algorithms;
|
||||||
import android.app.Activity;
|
|
||||||
import android.app.AlarmManager;
|
import java.io.BufferedWriter;
|
||||||
import android.app.AlertDialog;
|
import java.io.ByteArrayOutputStream;
|
||||||
import android.app.AlertDialog.Builder;
|
import java.io.File;
|
||||||
import android.app.Application;
|
import java.io.FileWriter;
|
||||||
import android.app.PendingIntent;
|
import java.io.PrintStream;
|
||||||
import android.content.Context;
|
import java.lang.Thread.UncaughtExceptionHandler;
|
||||||
import android.content.DialogInterface;
|
import java.util.Locale;
|
||||||
import android.content.Intent;
|
|
||||||
import android.content.pm.PackageInfo;
|
|
||||||
import android.content.pm.PackageManager.NameNotFoundException;
|
|
||||||
import android.content.res.Configuration;
|
|
||||||
import android.os.AsyncTask;
|
|
||||||
import android.os.Build;
|
|
||||||
import android.os.Handler;
|
|
||||||
import android.os.Message;
|
|
||||||
import android.text.format.DateFormat;
|
|
||||||
import android.util.TypedValue;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.accessibility.AccessibilityManager;
|
|
||||||
import android.widget.CheckBox;
|
|
||||||
import android.widget.LinearLayout;
|
|
||||||
import android.widget.LinearLayout.LayoutParams;
|
|
||||||
import android.widget.TextView;
|
|
||||||
import android.widget.Toast;
|
|
||||||
import btools.routingapp.BRouterServiceConnection;
|
import btools.routingapp.BRouterServiceConnection;
|
||||||
import btools.routingapp.IBRouterService;
|
import btools.routingapp.IBRouterService;
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,6 @@ import net.osmand.plus.mapcontextmenu.controllers.PointDescriptionMenuController
|
||||||
import net.osmand.plus.mapcontextmenu.controllers.TargetPointMenuController;
|
import net.osmand.plus.mapcontextmenu.controllers.TargetPointMenuController;
|
||||||
import net.osmand.plus.mapcontextmenu.controllers.WptPtMenuController;
|
import net.osmand.plus.mapcontextmenu.controllers.WptPtMenuController;
|
||||||
import net.osmand.plus.mapcontextmenu.other.ShareMenu;
|
import net.osmand.plus.mapcontextmenu.other.ShareMenu;
|
||||||
import net.osmand.plus.osmedit.OsmBugsLayer;
|
|
||||||
import net.osmand.plus.osmedit.OsmBugsLayer.OpenStreetNote;
|
import net.osmand.plus.osmedit.OsmBugsLayer.OpenStreetNote;
|
||||||
import net.osmand.plus.osmedit.OsmPoint;
|
import net.osmand.plus.osmedit.OsmPoint;
|
||||||
import net.osmand.plus.osmo.OsMoGroupsStorage.OsMoDevice;
|
import net.osmand.plus.osmo.OsMoGroupsStorage.OsMoDevice;
|
||||||
|
|
|
@ -12,7 +12,6 @@ import net.osmand.plus.mapcontextmenu.MenuBuilder;
|
||||||
import net.osmand.plus.mapcontextmenu.MenuController;
|
import net.osmand.plus.mapcontextmenu.MenuController;
|
||||||
import net.osmand.plus.osmedit.OsmBugsLayer.OpenStreetNote;
|
import net.osmand.plus.osmedit.OsmBugsLayer.OpenStreetNote;
|
||||||
import net.osmand.plus.osmedit.OsmEditingPlugin;
|
import net.osmand.plus.osmedit.OsmEditingPlugin;
|
||||||
import net.osmand.util.Algorithms;
|
|
||||||
|
|
||||||
public class OsmBugMenuController extends MenuController {
|
public class OsmBugMenuController extends MenuController {
|
||||||
|
|
||||||
|
|
|
@ -105,7 +105,7 @@ public class AdvancedEditPoiFragment extends Fragment
|
||||||
@Override
|
@Override
|
||||||
public void onTagsChanged(String anyTag) {
|
public void onTagsChanged(String anyTag) {
|
||||||
LOG.debug("onTagsChanged(" + "anyTag=" + anyTag + ")");
|
LOG.debug("onTagsChanged(" + "anyTag=" + anyTag + ")");
|
||||||
final String value = getData().getTagValues().get(anyTag);
|
String value = getData().getTagValues().get(anyTag);
|
||||||
if (Algorithms.objectEquals(anyTag, OSMSettings.OSMTagKey.NAME.getValue())) {
|
if (Algorithms.objectEquals(anyTag, OSMSettings.OSMTagKey.NAME.getValue())) {
|
||||||
nameTextView.setText(value);
|
nameTextView.setText(value);
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,6 +76,7 @@ public class EditPoiDialogFragment extends DialogFragment {
|
||||||
private static final String KEY_AMENITY_NODE = "key_amenity_node";
|
private static final String KEY_AMENITY_NODE = "key_amenity_node";
|
||||||
private static final String KEY_AMENITY = "key_amenity";
|
private static final String KEY_AMENITY = "key_amenity";
|
||||||
private static final String TAGS_LIST = "tags_list";
|
private static final String TAGS_LIST = "tags_list";
|
||||||
|
private static final String IS_ADDING_POI = "is_adding_poi";
|
||||||
|
|
||||||
private EditPoiData editPoiData;
|
private EditPoiData editPoiData;
|
||||||
private ViewPager viewPager;
|
private ViewPager viewPager;
|
||||||
|
@ -124,12 +125,15 @@ public class EditPoiDialogFragment extends DialogFragment {
|
||||||
boolean isLightTheme = settings.OSMAND_THEME.get() == OsmandSettings.OSMAND_LIGHT_THEME;
|
boolean isLightTheme = settings.OSMAND_THEME.get() == OsmandSettings.OSMAND_LIGHT_THEME;
|
||||||
|
|
||||||
if (savedInstanceState != null) {
|
if (savedInstanceState != null) {
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
Map<String, String> mp = (Map<String, String>) savedInstanceState.getSerializable(TAGS_LIST);
|
Map<String, String> mp = (Map<String, String>) savedInstanceState.getSerializable(TAGS_LIST);
|
||||||
editPoiData.updateTags(mp);
|
editPoiData.updateTags(mp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean isAddingPoi = getArguments().getBoolean(IS_ADDING_POI);
|
||||||
|
|
||||||
Toolbar toolbar = (Toolbar) view.findViewById(R.id.toolbar);
|
Toolbar toolbar = (Toolbar) view.findViewById(R.id.toolbar);
|
||||||
toolbar.setTitle(R.string.poi_create_title);
|
toolbar.setTitle(isAddingPoi ? R.string.poi_create_title : R.string.poi_edit_title);
|
||||||
toolbar.setNavigationIcon(R.drawable.abc_ic_ab_back_mtrl_am_alpha);
|
toolbar.setNavigationIcon(R.drawable.abc_ic_ab_back_mtrl_am_alpha);
|
||||||
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
|
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -364,27 +368,6 @@ public class EditPoiDialogFragment extends DialogFragment {
|
||||||
super.onSaveInstanceState(outState);
|
super.onSaveInstanceState(outState);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static EditPoiDialogFragment createAddPoiInstance(double latitude, double longitude,
|
|
||||||
OsmandApplication application) {
|
|
||||||
Node node = new Node(latitude, longitude, -1);
|
|
||||||
Amenity amenity;
|
|
||||||
amenity = new Amenity();
|
|
||||||
amenity.setType(application.getPoiTypes().getOtherPoiCategory());
|
|
||||||
amenity.setSubType("");
|
|
||||||
amenity.setAdditionalInfo(OSMSettings.OSMTagKey.OPENING_HOURS.getValue(), "");
|
|
||||||
return createInstance(node, amenity);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static EditPoiDialogFragment createInstance(Node node, Amenity amenity) {
|
|
||||||
EditPoiDialogFragment editPoiDialogFragment = new EditPoiDialogFragment();
|
|
||||||
Bundle args = new Bundle();
|
|
||||||
args.putSerializable(KEY_AMENITY_NODE, node);
|
|
||||||
args.putSerializable(KEY_AMENITY, amenity);
|
|
||||||
editPoiDialogFragment.setArguments(args);
|
|
||||||
return editPoiDialogFragment;
|
|
||||||
}
|
|
||||||
|
|
||||||
public EditPoiData getEditPoiData() {
|
public EditPoiData getEditPoiData() {
|
||||||
return editPoiData;
|
return editPoiData;
|
||||||
}
|
}
|
||||||
|
@ -510,6 +493,28 @@ public class EditPoiDialogFragment extends DialogFragment {
|
||||||
return (OsmandApplication) getActivity().getApplication();
|
return (OsmandApplication) getActivity().getApplication();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static EditPoiDialogFragment createAddPoiInstance(double latitude, double longitude,
|
||||||
|
OsmandApplication application) {
|
||||||
|
Node node = new Node(latitude, longitude, -1);
|
||||||
|
Amenity amenity;
|
||||||
|
amenity = new Amenity();
|
||||||
|
amenity.setType(application.getPoiTypes().getOtherPoiCategory());
|
||||||
|
amenity.setSubType("");
|
||||||
|
amenity.setAdditionalInfo(OSMSettings.OSMTagKey.OPENING_HOURS.getValue(), "");
|
||||||
|
return createInstance(node, amenity, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static EditPoiDialogFragment createInstance(Node node, Amenity amenity,
|
||||||
|
boolean isAddingPoi) {
|
||||||
|
EditPoiDialogFragment editPoiDialogFragment = new EditPoiDialogFragment();
|
||||||
|
Bundle args = new Bundle();
|
||||||
|
args.putSerializable(KEY_AMENITY_NODE, node);
|
||||||
|
args.putSerializable(KEY_AMENITY, amenity);
|
||||||
|
args.putBoolean(IS_ADDING_POI, isAddingPoi);
|
||||||
|
editPoiDialogFragment.setArguments(args);
|
||||||
|
return editPoiDialogFragment;
|
||||||
|
}
|
||||||
|
|
||||||
public static void showEditInstance(final Amenity amenity,
|
public static void showEditInstance(final Amenity amenity,
|
||||||
final AppCompatActivity activity) {
|
final AppCompatActivity activity) {
|
||||||
final OsmandSettings settings = ((OsmandApplication) activity.getApplication())
|
final OsmandSettings settings = ((OsmandApplication) activity.getApplication())
|
||||||
|
@ -531,7 +536,7 @@ public class EditPoiDialogFragment extends DialogFragment {
|
||||||
protected void onPostExecute(Node n) {
|
protected void onPostExecute(Node n) {
|
||||||
if (n != null) {
|
if (n != null) {
|
||||||
EditPoiDialogFragment fragment =
|
EditPoiDialogFragment fragment =
|
||||||
EditPoiDialogFragment.createInstance(n, amenity);
|
EditPoiDialogFragment.createInstance(n, amenity, false);
|
||||||
fragment.show(activity.getSupportFragmentManager(), TAG);
|
fragment.show(activity.getSupportFragmentManager(), TAG);
|
||||||
} else {
|
} else {
|
||||||
AccessibleToast.makeText(activity,
|
AccessibleToast.makeText(activity,
|
||||||
|
|
|
@ -12,7 +12,6 @@ import android.os.AsyncTask;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.util.Xml;
|
import android.util.Xml;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.ArrayAdapter;
|
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
@ -24,8 +23,6 @@ import net.osmand.data.PointDescription;
|
||||||
import net.osmand.data.QuadRect;
|
import net.osmand.data.QuadRect;
|
||||||
import net.osmand.data.RotatedTileBox;
|
import net.osmand.data.RotatedTileBox;
|
||||||
import net.osmand.osm.io.NetworkUtils;
|
import net.osmand.osm.io.NetworkUtils;
|
||||||
import net.osmand.plus.ContextMenuAdapter;
|
|
||||||
import net.osmand.plus.ContextMenuAdapter.OnContextMenuClick;
|
|
||||||
import net.osmand.plus.OsmandApplication;
|
import net.osmand.plus.OsmandApplication;
|
||||||
import net.osmand.plus.OsmandSettings;
|
import net.osmand.plus.OsmandSettings;
|
||||||
import net.osmand.plus.R;
|
import net.osmand.plus.R;
|
||||||
|
@ -46,7 +43,6 @@ import java.io.InputStreamReader;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.net.URLConnection;
|
import java.net.URLConnection;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.LinkedList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class OsmBugsLayer extends OsmandMapLayer implements IContextMenuProvider, DialogProvider {
|
public class OsmBugsLayer extends OsmandMapLayer implements IContextMenuProvider, DialogProvider {
|
||||||
|
|
Loading…
Reference in a new issue