Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
f44213ad3f
2 changed files with 19 additions and 2 deletions
|
@ -186,7 +186,13 @@ public class MapActivityActions implements DialogProvider {
|
||||||
|
|
||||||
|
|
||||||
public void addWaypoint(final double latitude, final double longitude) {
|
public void addWaypoint(final double latitude, final double longitude) {
|
||||||
String name = mapActivity.getContextMenu().getPointDescription().getFullPlainName(mapActivity);
|
String name;
|
||||||
|
PointDescription pointDescription = mapActivity.getContextMenu().getPointDescription();
|
||||||
|
if (!pointDescription.isWpt() && !mapActivity.getContextMenu().isAddressUnknown()) {
|
||||||
|
name = mapActivity.getContextMenu().getTitleStr();
|
||||||
|
} else {
|
||||||
|
name = "";
|
||||||
|
}
|
||||||
enhance(dialogBundle,latitude,longitude, name);
|
enhance(dialogBundle,latitude,longitude, name);
|
||||||
mapActivity.showDialog(DIALOG_ADD_WAYPOINT);
|
mapActivity.showDialog(DIALOG_ADD_WAYPOINT);
|
||||||
}
|
}
|
||||||
|
@ -587,6 +593,7 @@ public class MapActivityActions implements DialogProvider {
|
||||||
v.setPadding(5, 0, 5, 0);
|
v.setPadding(5, 0, 5, 0);
|
||||||
if(args.getString(KEY_NAME) != null) {
|
if(args.getString(KEY_NAME) != null) {
|
||||||
v.setText(args.getString(KEY_NAME));
|
v.setText(args.getString(KEY_NAME));
|
||||||
|
v.selectAll();
|
||||||
} else {
|
} else {
|
||||||
v.setText("");
|
v.setText("");
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,6 @@ package net.osmand.plus.mapcontextmenu;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.v4.app.Fragment;
|
import android.support.v4.app.Fragment;
|
||||||
import android.util.Log;
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
||||||
import net.osmand.Location;
|
import net.osmand.Location;
|
||||||
|
@ -44,6 +43,7 @@ public class MapContextMenu {
|
||||||
private String typeStr;
|
private String typeStr;
|
||||||
private Drawable secondLineIcon;
|
private Drawable secondLineIcon;
|
||||||
private String streetStr;
|
private String streetStr;
|
||||||
|
private boolean addressUnknown;
|
||||||
|
|
||||||
private int favActionIconId;
|
private int favActionIconId;
|
||||||
|
|
||||||
|
@ -54,6 +54,7 @@ public class MapContextMenu {
|
||||||
private static final String KEY_CTX_MENU_NAME_STR = "key_ctx_menu_name_str";
|
private static final String KEY_CTX_MENU_NAME_STR = "key_ctx_menu_name_str";
|
||||||
private static final String KEY_CTX_MENU_TYPE_STR = "key_ctx_menu_type_str";
|
private static final String KEY_CTX_MENU_TYPE_STR = "key_ctx_menu_type_str";
|
||||||
private static final String KEY_CTX_MENU_STREET_STR = "key_ctx_menu_street_str";
|
private static final String KEY_CTX_MENU_STREET_STR = "key_ctx_menu_street_str";
|
||||||
|
private static final String KEY_CTX_MENU_ADDR_UNKNOWN = "key_ctx_menu_addr_unknown";
|
||||||
|
|
||||||
public boolean isActive() {
|
public boolean isActive() {
|
||||||
return active;
|
return active;
|
||||||
|
@ -114,6 +115,7 @@ public class MapContextMenu {
|
||||||
nameStr = "";
|
nameStr = "";
|
||||||
typeStr = "";
|
typeStr = "";
|
||||||
streetStr = "";
|
streetStr = "";
|
||||||
|
addressUnknown = false;
|
||||||
|
|
||||||
active = true;
|
active = true;
|
||||||
|
|
||||||
|
@ -240,6 +242,10 @@ public class MapContextMenu {
|
||||||
return nameStr;
|
return nameStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isAddressUnknown() {
|
||||||
|
return addressUnknown;
|
||||||
|
}
|
||||||
|
|
||||||
public String getLocationStr() {
|
public String getLocationStr() {
|
||||||
if (menuController != null && menuController.needTypeStr()) {
|
if (menuController != null && menuController.needTypeStr()) {
|
||||||
return typeStr;
|
return typeStr;
|
||||||
|
@ -288,6 +294,7 @@ public class MapContextMenu {
|
||||||
typeStr = "";
|
typeStr = "";
|
||||||
} else {
|
} else {
|
||||||
nameStr = app.getResources().getString(R.string.address_unknown);
|
nameStr = app.getResources().getString(R.string.address_unknown);
|
||||||
|
addressUnknown = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -307,6 +314,7 @@ public class MapContextMenu {
|
||||||
if (!Algorithms.isEmpty(streetStr)) {
|
if (!Algorithms.isEmpty(streetStr)) {
|
||||||
if (getObject() == null) {
|
if (getObject() == null) {
|
||||||
nameStr = streetStr;
|
nameStr = streetStr;
|
||||||
|
addressUnknown = false;
|
||||||
streetStr = "";
|
streetStr = "";
|
||||||
}
|
}
|
||||||
mapActivity.runOnUiThread(new Runnable() {
|
mapActivity.runOnUiThread(new Runnable() {
|
||||||
|
@ -379,6 +387,7 @@ public class MapContextMenu {
|
||||||
bundle.putString(KEY_CTX_MENU_NAME_STR, nameStr);
|
bundle.putString(KEY_CTX_MENU_NAME_STR, nameStr);
|
||||||
bundle.putString(KEY_CTX_MENU_TYPE_STR, typeStr);
|
bundle.putString(KEY_CTX_MENU_TYPE_STR, typeStr);
|
||||||
bundle.putString(KEY_CTX_MENU_STREET_STR, streetStr);
|
bundle.putString(KEY_CTX_MENU_STREET_STR, streetStr);
|
||||||
|
bundle.putString(KEY_CTX_MENU_ADDR_UNKNOWN, Boolean.toString(addressUnknown));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void restoreMenuState(Bundle bundle) {
|
public void restoreMenuState(Bundle bundle) {
|
||||||
|
@ -400,6 +409,7 @@ public class MapContextMenu {
|
||||||
nameStr = bundle.getString(KEY_CTX_MENU_NAME_STR);
|
nameStr = bundle.getString(KEY_CTX_MENU_NAME_STR);
|
||||||
typeStr = bundle.getString(KEY_CTX_MENU_TYPE_STR);
|
typeStr = bundle.getString(KEY_CTX_MENU_TYPE_STR);
|
||||||
streetStr = bundle.getString(KEY_CTX_MENU_STREET_STR);
|
streetStr = bundle.getString(KEY_CTX_MENU_STREET_STR);
|
||||||
|
addressUnknown = Boolean.parseBoolean(bundle.getString(KEY_CTX_MENU_ADDR_UNKNOWN));
|
||||||
|
|
||||||
acquireIcons();
|
acquireIcons();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue