Merge pull request #9831 from osmandapp/edit_address_oncreate
Address doesn't saved if it enters manualy while adding favorite
This commit is contained in:
commit
02c20183f8
2 changed files with 8 additions and 14 deletions
|
@ -307,7 +307,7 @@ public class FavoritePointEditorFragmentNew extends PointEditorFragmentNew {
|
|||
FavoritePointEditor editor = getFavoritePointEditor();
|
||||
if (editor != null && helper != null) {
|
||||
if (editor.isNew()) {
|
||||
doAddFavorite(name, category, description, color, backgroundType, iconId);
|
||||
doAddFavorite(name, category, description, address, color, backgroundType, iconId);
|
||||
} else {
|
||||
doEditFavorite(favorite, name, category, description, address, color, backgroundType, iconId, helper);
|
||||
}
|
||||
|
@ -341,7 +341,7 @@ public class FavoritePointEditorFragmentNew extends PointEditorFragmentNew {
|
|||
}
|
||||
}
|
||||
|
||||
private void doAddFavorite(String name, String category, String description, @ColorInt int color,
|
||||
private void doAddFavorite(String name, String category, String description, String address, @ColorInt int color,
|
||||
BackgroundType backgroundType, @DrawableRes int iconId) {
|
||||
OsmandApplication app = getMyApplication();
|
||||
FavouritesDbHelper helper = getHelper();
|
||||
|
@ -350,6 +350,7 @@ public class FavoritePointEditorFragmentNew extends PointEditorFragmentNew {
|
|||
favorite.setName(name);
|
||||
favorite.setCategory(category);
|
||||
favorite.setDescription(description);
|
||||
favorite.setAddress(address);
|
||||
favorite.setColor(color);
|
||||
favorite.setBackgroundType(backgroundType);
|
||||
favorite.setIconId(iconId);
|
||||
|
|
|
@ -817,11 +817,15 @@ public abstract class PointEditorFragmentNew extends BaseOsmAndFragment {
|
|||
hideKeyboard();
|
||||
MapActivity mapActivity = getMapActivity();
|
||||
if (mapActivity != null) {
|
||||
MapContextMenu mapContextMenu = mapActivity.getContextMenu();
|
||||
if (includingMenu) {
|
||||
mapActivity.getSupportFragmentManager().popBackStack();
|
||||
mapActivity.getContextMenu().close();
|
||||
mapContextMenu.close();
|
||||
} else {
|
||||
mapActivity.getSupportFragmentManager().popBackStack();
|
||||
if (!mapContextMenu.isVisible() && mapContextMenu.isActive()) {
|
||||
mapContextMenu.show();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -932,17 +936,6 @@ public abstract class PointEditorFragmentNew extends BaseOsmAndFragment {
|
|||
private void exitEditing() {
|
||||
cancelled = true;
|
||||
dismiss();
|
||||
showContextMenu();
|
||||
}
|
||||
|
||||
private void showContextMenu() {
|
||||
MapActivity mapActivity = getMapActivity();
|
||||
if (mapActivity != null) {
|
||||
MapContextMenu mapContextMenu = mapActivity.getContextMenu();
|
||||
if (!mapContextMenu.isVisible() && mapContextMenu.isActive()) {
|
||||
mapContextMenu.show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private AlertDialog.Builder createWarningDialog(Activity activity, int title, int message, int negButton) {
|
||||
|
|
Loading…
Reference in a new issue