diff --git a/documentation/docs/help/en/Adding way nodes.md b/documentation/docs/help/en/Adding way nodes.md index 0e3efe062d..84488d597e 100644 --- a/documentation/docs/help/en/Adding way nodes.md +++ b/documentation/docs/help/en/Adding way nodes.md @@ -16,10 +16,25 @@ The complete way can be moved without leaving this mode. Tapping the icon once will undo the last addition of a node. -### ![Preset](../images/tag_menu_preset.png) Add preset +### ![Snap](../images/snap_on.png) ![Snap](../images/snap_off.png) Snap + +When the snap function is active, newly created nodes near to other nodes and ways will snap on to these automatically creating connections. It the checkbox is not checked +nodes will be created without merging with other objects. You can toggle this while you are drawing a way. + +Note: when the checkbox is not checked you need to manually close closed ways, for example a building outline. + +#### ![Preset](../images/tag_menu_preset.png) Add preset Create the current new object, launch the [property editor](../en/Property%20editor.md) and immediately display the preset tab. In multi-pane mode this will simply start the property editor. +### ![Follow](../images/follow.png) Follow way + +If two consecutive nodes overlap with nodes of an existing way you can follow the existing way to one of its nodes after clicking the button. + +### ![Address](../images/address.png) Add address tags + +Adds address tags with prediction. If the way is closed this will add the predicted address tags and start the [property editor](../en/Property%20editor.md). If the way is not closed an address interpolation is created and a dedicated editor is started. + ### ![Help](../images/menu_help.png) Help Start the Vespucci Help browser. diff --git a/documentation/docs/help/en/Keyboard.md b/documentation/docs/help/en/Keyboard.md index e68e8fbece..b47ab4ee69 100644 --- a/documentation/docs/help/en/Keyboard.md +++ b/documentation/docs/help/en/Keyboard.md @@ -64,6 +64,16 @@ The alphabetic menu shortcuts should be usable with `` + letter. __m__ Merge (if possible) __s__ Square / straighten (if possible) + +### Path creation + + __u__ Undo + + __f__ Follow way (if possible) + + __e__ Finish way and start the property editor + + __a__ Finish way and if a closed way start the property editor with address prediction, if an open way start the address interpolation modal ### Property editor diff --git a/documentation/docs/help/en/Simple actions.md b/documentation/docs/help/en/Simple actions.md index 8a6eab1741..ab6d9c2a95 100644 --- a/documentation/docs/help/en/Simple actions.md +++ b/documentation/docs/help/en/Simple actions.md @@ -29,14 +29,18 @@ nodes will be created without merging with other objects. You can toggle this wh Note: when the checkbox is not checked you need to manually close closed ways, for example a building outline. -#### ![Address](../images/address.png) Add address tags - -Adds address tags with prediction. If the way is closed this will add the predicted address tags and start the [property editor](../en/Property%20editor.md). If the way is not closed an address interpolation is created and a dedicated editor is started. - #### ![Preset](../images/tag_menu_preset.png) Add preset Create the current new object, launch the [property editor](../en/Property%20editor.md) and immediately display the preset tab. In multi-pane mode this will simply start the property editor. +### ![Follow](../images/follow.png) Follow way + +If two consecutive nodes overlap with nodes of an existing way you can follow the existing way to one of its nodes after clicking the button. + +#### ![Address](../images/address.png) Add address tags + +Adds address tags with prediction. If the way is closed this will add the predicted address tags and start the [property editor](../en/Property%20editor.md). If the way is not closed an address interpolation is created and a dedicated editor is started. + ### Add map note Create a new OSM map note at the tapped position, starting the note editor. diff --git a/documentation/docs/help/images/follow.png b/documentation/docs/help/images/follow.png new file mode 100644 index 0000000000..be93e20484 Binary files /dev/null and b/documentation/docs/help/images/follow.png differ diff --git a/src/main/assets/help/en/Adding way nodes.html b/src/main/assets/help/en/Adding way nodes.html index 311f0b44be..7bd5510fd8 100644 --- a/src/main/assets/help/en/Adding way nodes.html +++ b/src/main/assets/help/en/Adding way nodes.html @@ -17,8 +17,15 @@

Adding way nodes

Further actions

Undo Undo

Tapping the icon once will undo the last addition of a node.

-

Preset Add preset

+

Snap Snap Snap

+

When the snap function is active, newly created nodes near to other nodes and ways will snap on to these automatically creating connections. It the checkbox is not checked nodes will be created without merging with other objects. You can toggle this while you are drawing a way.

+

Note: when the checkbox is not checked you need to manually close closed ways, for example a building outline.

+

Preset Add preset

Create the current new object, launch the property editor and immediately display the preset tab. In multi-pane mode this will simply start the property editor.

+

Follow Follow way

+

If two consecutive nodes overlap with nodes of an existing way you can follow the existing way to one of its nodes after clicking the button.

+

Address Add address tags

+

Adds address tags with prediction. If the way is closed this will add the predicted address tags and start the property editor. If the way is not closed an address interpolation is created and a dedicated editor is started.

Help Help

Start the Vespucci Help browser.

diff --git a/src/main/assets/help/en/Keyboard.html b/src/main/assets/help/en/Keyboard.html index 2cb4ba88e5..e9cfca44bf 100644 --- a/src/main/assets/help/en/Keyboard.html +++ b/src/main/assets/help/en/Keyboard.html @@ -38,6 +38,11 @@

Way selected

Multi-select

m Merge (if possible)

s Square / straighten (if possible)

+

Path creation

+

u Undo

+

f Follow way (if possible)

+

e Finish way and start the property editor

+

a Finish way and if a closed way start the property editor with address prediction, if an open way start the address interpolation modal

Property editor

c Copy

x Cut

diff --git a/src/main/assets/help/en/Simple actions.html b/src/main/assets/help/en/Simple actions.html index 80ff0c3570..15751bfe18 100644 --- a/src/main/assets/help/en/Simple actions.html +++ b/src/main/assets/help/en/Simple actions.html @@ -20,10 +20,12 @@

Add way

Snap Snap Snap

When the snap function is active, newly created nodes near to other nodes and ways will snap on to these automatically creating connections. It the checkbox is not checked nodes will be created without merging with other objects. You can toggle this while you are drawing a way.

Note: when the checkbox is not checked you need to manually close closed ways, for example a building outline.

-

Address Add address tags

-

Adds address tags with prediction. If the way is closed this will add the predicted address tags and start the property editor. If the way is not closed an address interpolation is created and a dedicated editor is started.

Preset Add preset

Create the current new object, launch the property editor and immediately display the preset tab. In multi-pane mode this will simply start the property editor.

+

Follow Follow way

+

If two consecutive nodes overlap with nodes of an existing way you can follow the existing way to one of its nodes after clicking the button.

+

Address Add address tags

+

Adds address tags with prediction. If the way is closed this will add the predicted address tags and start the property editor. If the way is not closed an address interpolation is created and a dedicated editor is started.

Add map note

Create a new OSM map note at the tapped position, starting the note editor.

Add node

diff --git a/src/main/assets/help/images/follow.png b/src/main/assets/help/images/follow.png new file mode 100644 index 0000000000..be93e20484 Binary files /dev/null and b/src/main/assets/help/images/follow.png differ diff --git a/src/main/java/de/blau/android/easyedit/PathCreationActionModeCallback.java b/src/main/java/de/blau/android/easyedit/PathCreationActionModeCallback.java index ba0bf43d50..16a40f13a5 100644 --- a/src/main/java/de/blau/android/easyedit/PathCreationActionModeCallback.java +++ b/src/main/java/de/blau/android/easyedit/PathCreationActionModeCallback.java @@ -447,17 +447,7 @@ public boolean onActionItemClicked(ActionMode mode, MenuItem item) { return true; case MENUITEM_NEWWAY_PRESET: case MENUITEM_ADDRESS: - Way lastSelectedWay = logic.getSelectedWay(); - if (lastSelectedWay != null) { - dontTag = true; - main.startSupportActionMode(new WaySelectionActionModeCallback(manager, lastSelectedWay)); - if (itemId == MENUITEM_ADDRESS && !lastSelectedWay.isClosed()) { - AddressInterpolationDialog.showDialog(main, lastSelectedWay); - } else { - // show preset screen - main.performTagEdit(lastSelectedWay, null, itemId == MENUITEM_ADDRESS, itemId == MENUITEM_NEWWAY_PRESET); - } - } + handleTagEdit(itemId); return true; default: Log.e(DEBUG_TAG, "Unknown menu item"); @@ -466,6 +456,25 @@ public boolean onActionItemClicked(ActionMode mode, MenuItem item) { return false; } + /** + * Finish creating the way and start either the property editor or the address interpolation dialog + * + * @param itemId either MENUITEM_ADDRESS or MENUITEM_NEWWAY_PRESET to determine the behaviour + */ + private void handleTagEdit(final int itemId) { + Way lastSelectedWay = logic.getSelectedWay(); + if (lastSelectedWay != null) { + dontTag = true; + main.startSupportActionMode(new WaySelectionActionModeCallback(manager, lastSelectedWay)); + if (itemId == MENUITEM_ADDRESS && !lastSelectedWay.isClosed()) { + AddressInterpolationDialog.showDialog(main, lastSelectedWay); + } else { + // show preset screen + main.performTagEdit(lastSelectedWay, null, itemId == MENUITEM_ADDRESS, itemId == MENUITEM_NEWWAY_PRESET); + } + } + } + /** * Setup follow way selection */ @@ -620,6 +629,18 @@ public boolean processShortcut(Character c) { handleFollow(); return true; } + if (c == Util.getShortCut(main, R.string.shortcut_tagedit)) { + handleTagEdit(MENUITEM_NEWWAY_PRESET); + return true; + } + if (c == Util.getShortCut(main, R.string.shortcut_tagedit)) { + handleTagEdit(MENUITEM_NEWWAY_PRESET); + return true; + } + if (c == Util.getShortCut(main, R.string.shortcut_address)) { + handleTagEdit(MENUITEM_ADDRESS); + return true; + } return super.processShortcut(c); } diff --git a/src/main/res/values/shortcuts.xml b/src/main/res/values/shortcuts.xml index 5b85b0a570..42b49dde0b 100644 --- a/src/main/res/values/shortcuts.xml +++ b/src/main/res/values/shortcuts.xml @@ -18,4 +18,5 @@ s r f + a \ No newline at end of file