add new icons for poi modify/delete. Do not show create poi when poi is
selected
This commit is contained in:
parent
1622f20d4a
commit
c01cdbd06f
7 changed files with 11 additions and 19 deletions
BIN
OsmAnd/res/drawable-hdpi/list_activities_poi_modify.png
Normal file
BIN
OsmAnd/res/drawable-hdpi/list_activities_poi_modify.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.6 KiB |
BIN
OsmAnd/res/drawable-hdpi/list_activities_poi_remove.png
Normal file
BIN
OsmAnd/res/drawable-hdpi/list_activities_poi_remove.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7 KiB |
BIN
OsmAnd/res/drawable-large/list_activities_poi_modify.png
Normal file
BIN
OsmAnd/res/drawable-large/list_activities_poi_modify.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.6 KiB |
BIN
OsmAnd/res/drawable-large/list_activities_poi_remove.png
Normal file
BIN
OsmAnd/res/drawable-large/list_activities_poi_remove.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7 KiB |
BIN
OsmAnd/res/drawable-mdpi/list_activities_poi_modify.png
Normal file
BIN
OsmAnd/res/drawable-mdpi/list_activities_poi_modify.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5 KiB |
BIN
OsmAnd/res/drawable-mdpi/list_activities_poi_remove.png
Normal file
BIN
OsmAnd/res/drawable-mdpi/list_activities_poi_remove.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.2 KiB |
|
@ -103,35 +103,27 @@ public class OsmEditingPlugin extends OsmandPlugin {
|
|||
|
||||
@Override
|
||||
public void registerMapContextMenuActions(MapActivity mapActivity, final double latitude, final double longitude, ContextMenuAdapter adapter,
|
||||
Object selectedObj) {
|
||||
if(selectedObj instanceof Amenity) {
|
||||
final Amenity a = (Amenity) selectedObj;
|
||||
OnContextMenuClick alist = new OnContextMenuClick() {
|
||||
|
||||
@Override
|
||||
public void onContextMenuClick(int resId, int pos, boolean isChecked, DialogInterface dialog) {
|
||||
if (resId == R.string.poi_context_menu_delete) {
|
||||
getPoiActions().showDeleteDialog(a);
|
||||
} else if (resId == R.string.poi_context_menu_modify) {
|
||||
getPoiActions().showEditDialog(a);
|
||||
}
|
||||
}
|
||||
};
|
||||
adapter.registerItem(R.string.poi_context_menu_modify, 0, alist, 1);
|
||||
adapter.registerItem(R.string.poi_context_menu_delete, 0, alist, 2);
|
||||
}
|
||||
final Object selectedObj) {
|
||||
OnContextMenuClick listener = new OnContextMenuClick() {
|
||||
|
||||
@Override
|
||||
public void onContextMenuClick(int resId, int pos, boolean isChecked, DialogInterface dialog) {
|
||||
if (resId == R.string.context_menu_item_create_poi) {
|
||||
poiActions.showCreateDialog(latitude, longitude);
|
||||
} else if (resId == R.string.context_menu_item_open_bug) {
|
||||
osmBugsLayer.openBug(latitude, longitude);
|
||||
} else if (resId == R.string.poi_context_menu_delete) {
|
||||
getPoiActions().showDeleteDialog((Amenity) selectedObj);
|
||||
} else if (resId == R.string.poi_context_menu_modify) {
|
||||
getPoiActions().showEditDialog((Amenity) selectedObj);
|
||||
}
|
||||
}
|
||||
};
|
||||
adapter.registerItem(R.string.context_menu_item_create_poi, R.drawable.list_view_create_poi, listener, -1);
|
||||
if(selectedObj instanceof Amenity) {
|
||||
adapter.registerItem(R.string.poi_context_menu_modify, R.drawable.list_activities_poi_modify, listener, 1);
|
||||
adapter.registerItem(R.string.poi_context_menu_delete, R.drawable.list_activities_poi_remove, listener, 2);
|
||||
} else {
|
||||
adapter.registerItem(R.string.context_menu_item_create_poi, R.drawable.list_view_create_poi, listener, -1);
|
||||
}
|
||||
adapter.registerItem(R.string.context_menu_item_open_bug, R.drawable.list_activities_osm_bugs, listener, -1);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue