diff --git a/OsmAnd/res/layout/editing_poi.xml b/OsmAnd/res/layout/editing_poi.xml
index e116e980dd..81679ceea3 100644
--- a/OsmAnd/res/layout/editing_poi.xml
+++ b/OsmAnd/res/layout/editing_poi.xml
@@ -83,6 +83,28 @@
+
+
+
+
+
+
diff --git a/OsmAnd/src/net/osmand/plus/osmedit/EditingPOIActivity.java b/OsmAnd/src/net/osmand/plus/osmedit/EditingPOIActivity.java
index ece8355740..65c6b7c18e 100644
--- a/OsmAnd/src/net/osmand/plus/osmedit/EditingPOIActivity.java
+++ b/OsmAnd/src/net/osmand/plus/osmedit/EditingPOIActivity.java
@@ -2,6 +2,7 @@ package net.osmand.plus.osmedit;
import java.text.MessageFormat;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
@@ -38,11 +39,14 @@ import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.text.method.LinkMovementMethod;
+import android.view.Gravity;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.AutoCompleteTextView;
import android.widget.Button;
import android.widget.EditText;
+import android.widget.TableLayout;
+import android.widget.TableRow;
import android.widget.TextView;
import android.widget.Toast;
@@ -166,7 +170,7 @@ public class EditingPOIActivity implements DialogProvider {
}
private Dialog createPOIDialog(final int dialogID, final Bundle args) {
- Dialog dlg = new Dialog(ctx);
+ final Dialog dlg = new Dialog(ctx);
dlg.setContentView(R.layout.editing_poi);
nameText = ((EditText)dlg.findViewById(R.id.Name));
openingHours = ((EditText)dlg.findViewById(R.id.OpeningHours));
@@ -243,6 +247,116 @@ public class EditingPOIActivity implements DialogProvider {
}
});
+ final Button advancedModeButton = ((Button)dlg.findViewById(R.id.advancedMode));
+ final Map additionalTags = new HashMap();
+ advancedModeButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ final TableLayout layout = ((TableLayout)dlg.findViewById(R.id.advancedModeTable));
+ TableLayout.LayoutParams tlParams = new TableLayout.LayoutParams(TableLayout.LayoutParams.FILL_PARENT, TableLayout.LayoutParams.WRAP_CONTENT);
+ layout.setLayoutParams(tlParams);
+ layout.setColumnStretchable(1, true);
+ layout.setVisibility((layout.getVisibility() == View.VISIBLE) ? View.GONE : View.VISIBLE);
+
+ if (layout.getVisibility() == View.VISIBLE) {
+ Button addTag = (Button) dlg.findViewById(R.id.addTag);
+ addTag.setVisibility((layout.getVisibility() == View.VISIBLE) ? View.GONE : View.VISIBLE);
+ addTag.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ final TableRow newTagRow = new TableRow(ctx);
+ TableRow.LayoutParams tlp = new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT, TableRow.LayoutParams.WRAP_CONTENT);
+ tlp.leftMargin = 5;
+ newTagRow.setLayoutParams(tlp);
+
+ final Button tag = new Button(ctx);
+ final EditText value = new EditText(ctx);
+ final Button delete = new Button(ctx);
+
+ tag.setLayoutParams(tlp);
+ tag.setText("");
+ tag.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+// Comment: To exclude basic tags OSMTagKey.NAME, OSMTagKey.OPENING_HOURS, OSMTagKey.PHONE, OSMTagKey.WEBSITE;
+ final OSMTagKey[] allValues = OSMTagKey.values();
+ final OSMTagKey[] values = new OSMTagKey[allValues.length-4];
+ int j = 0;
+ for (int i = 0; i < allValues.length; i++) {
+ if ( (allValues[i] != OSMTagKey.NAME) &&
+ (allValues[i] != OSMTagKey.OPENING_HOURS) &&
+ (allValues[i] != OSMTagKey.PHONE) &&
+ (allValues[i] != OSMTagKey.WEBSITE) ) {
+ values[j] = allValues[i];
+ j++;
+ }
+ }
+ final String[] vals = new String[values.length];
+ for (int i=0; i 0 ){
n.putTag(OSMTagKey.PHONE.getValue(),phone);
}
+ if ((additionalTags != null) && (!additionalTags.isEmpty())) {
+ for (String tk : additionalTags.keySet()) {
+ n.putTag(tk, additionalTags.get(tk));
+ }
+ }
commitNode(action, n, openstreetmapUtil.getEntityInfo(), commentText.getText().toString(), new Runnable() {
@Override
public void run() {