This resolves #1893

This commit is contained in:
GaidamakUA 2015-11-10 11:09:04 +02:00
parent 843ba63cf3
commit 71f7f9b5d3
8 changed files with 75 additions and 75 deletions

View file

@ -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="ChooseCountry">Välj land</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="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="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="shared_string_logoff">Logga ut</string>
@ -1859,8 +1860,8 @@
<string name="contact_info">Kontaktinformation</string>
<string name="dahboard_options_dialog_title">Konfigurera panelen</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="please_specify_poi_type">Ange typ av POI.</string>
<string name="favourites">Favoriter</string>
@ -1951,9 +1952,8 @@
<string name="map_viewing_item">Kartvisning</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="instalation_troubleshooting_item">Installation och problemlösning</string>
<string name="techical_articles_item">Tekniska artiklar</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_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="shared_string_upload">Skicka</string>
<string name="shared_string_upload">Skicka</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="read_more">Läs mer</string>
<string name="whats_new">Nyheter</string>
<string name="rendering_attr_hideProposed_name">Dölj föreslagna objekt</string>
</resources>
</resources>

View file

@ -7,6 +7,7 @@ import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import net.osmand.IProgress;
import net.osmand.IndexConstants;
import net.osmand.PlatformUtil;

View file

@ -1,12 +1,30 @@
package net.osmand.plus;
import java.io.BufferedWriter;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileWriter;
import java.io.PrintStream;
import java.lang.Thread.UncaughtExceptionHandler;
import java.util.Locale;
import android.app.Activity;
import android.app.AlarmManager;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.app.Application;
import android.app.PendingIntent;
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.access.AccessibilityPlugin;
@ -34,31 +52,15 @@ import net.osmand.plus.routing.RoutingHelper;
import net.osmand.plus.voice.CommandPlayer;
import net.osmand.router.RoutingConfiguration;
import net.osmand.util.Algorithms;
import android.app.Activity;
import android.app.AlarmManager;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.app.Application;
import android.app.PendingIntent;
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 java.io.BufferedWriter;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileWriter;
import java.io.PrintStream;
import java.lang.Thread.UncaughtExceptionHandler;
import java.util.Locale;
import btools.routingapp.BRouterServiceConnection;
import btools.routingapp.IBRouterService;

View file

@ -29,7 +29,6 @@ import net.osmand.plus.mapcontextmenu.controllers.PointDescriptionMenuController
import net.osmand.plus.mapcontextmenu.controllers.TargetPointMenuController;
import net.osmand.plus.mapcontextmenu.controllers.WptPtMenuController;
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.OsmPoint;
import net.osmand.plus.osmo.OsMoGroupsStorage.OsMoDevice;

View file

@ -12,7 +12,6 @@ import net.osmand.plus.mapcontextmenu.MenuBuilder;
import net.osmand.plus.mapcontextmenu.MenuController;
import net.osmand.plus.osmedit.OsmBugsLayer.OpenStreetNote;
import net.osmand.plus.osmedit.OsmEditingPlugin;
import net.osmand.util.Algorithms;
public class OsmBugMenuController extends MenuController {

View file

@ -105,7 +105,7 @@ public class AdvancedEditPoiFragment extends Fragment
@Override
public void onTagsChanged(String 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())) {
nameTextView.setText(value);
}

View file

@ -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 = "key_amenity";
private static final String TAGS_LIST = "tags_list";
private static final String IS_ADDING_POI = "is_adding_poi";
private EditPoiData editPoiData;
private ViewPager viewPager;
@ -124,12 +125,15 @@ public class EditPoiDialogFragment extends DialogFragment {
boolean isLightTheme = settings.OSMAND_THEME.get() == OsmandSettings.OSMAND_LIGHT_THEME;
if (savedInstanceState != null) {
@SuppressWarnings("unchecked")
Map<String, String> mp = (Map<String, String>) savedInstanceState.getSerializable(TAGS_LIST);
editPoiData.updateTags(mp);
}
boolean isAddingPoi = getArguments().getBoolean(IS_ADDING_POI);
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.setNavigationOnClickListener(new View.OnClickListener() {
@Override
@ -364,27 +368,6 @@ public class EditPoiDialogFragment extends DialogFragment {
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() {
return editPoiData;
}
@ -510,6 +493,28 @@ public class EditPoiDialogFragment extends DialogFragment {
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,
final AppCompatActivity activity) {
final OsmandSettings settings = ((OsmandApplication) activity.getApplication())
@ -531,7 +536,7 @@ public class EditPoiDialogFragment extends DialogFragment {
protected void onPostExecute(Node n) {
if (n != null) {
EditPoiDialogFragment fragment =
EditPoiDialogFragment.createInstance(n, amenity);
EditPoiDialogFragment.createInstance(n, amenity, false);
fragment.show(activity.getSupportFragmentManager(), TAG);
} else {
AccessibleToast.makeText(activity,

View file

@ -12,7 +12,6 @@ import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Xml;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.EditText;
import android.widget.Toast;
@ -24,8 +23,6 @@ import net.osmand.data.PointDescription;
import net.osmand.data.QuadRect;
import net.osmand.data.RotatedTileBox;
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.OsmandSettings;
import net.osmand.plus.R;
@ -46,7 +43,6 @@ import java.io.InputStreamReader;
import java.io.Serializable;
import java.net.URLConnection;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
public class OsmBugsLayer extends OsmandMapLayer implements IContextMenuProvider, DialogProvider {