Added now string and possibility to edit POI change from My Places
This commit is contained in:
parent
42362d383e
commit
7334e63d77
4 changed files with 35 additions and 23 deletions
|
@ -2061,5 +2061,6 @@ Afghanistan, Albania, Algeria, Andorra, Angola, Anguilla, Antigua and Barbuda, A
|
||||||
<string name="contact_us">Contact us</string>
|
<string name="contact_us">Contact us</string>
|
||||||
<string name="map_legend">Map legend</string>
|
<string name="map_legend">Map legend</string>
|
||||||
<string name="save_poi_without_poi_type_message">Do you really want to save poi without POI type?</string>
|
<string name="save_poi_without_poi_type_message">Do you really want to save poi without POI type?</string>
|
||||||
|
<string name="poi_context_menu_modify_osm_change">Modify OSM change</string>
|
||||||
<!-- string name="map_legend_item_description">Legend for OsmAnd default map style, Internet connectivity needed to display</string -->
|
<!-- string name="map_legend_item_description">Legend for OsmAnd default map style, Internet connectivity needed to display</string -->
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -1,16 +1,5 @@
|
||||||
package net.osmand.plus.download.ui;
|
package net.osmand.plus.download.ui;
|
||||||
|
|
||||||
import java.util.Comparator;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import net.osmand.map.OsmandRegions;
|
|
||||||
import net.osmand.plus.OsmandApplication;
|
|
||||||
import net.osmand.plus.R;
|
|
||||||
import net.osmand.plus.activities.OsmAndListFragment;
|
|
||||||
import net.osmand.plus.download.DownloadActivity;
|
|
||||||
import net.osmand.plus.download.DownloadIndexesThread.DownloadEvents;
|
|
||||||
import net.osmand.plus.download.DownloadResources;
|
|
||||||
import net.osmand.plus.download.IndexItem;
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
@ -27,6 +16,18 @@ import android.widget.ArrayAdapter;
|
||||||
import android.widget.ListView;
|
import android.widget.ListView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import net.osmand.map.OsmandRegions;
|
||||||
|
import net.osmand.plus.OsmandApplication;
|
||||||
|
import net.osmand.plus.R;
|
||||||
|
import net.osmand.plus.activities.OsmAndListFragment;
|
||||||
|
import net.osmand.plus.download.DownloadActivity;
|
||||||
|
import net.osmand.plus.download.DownloadIndexesThread.DownloadEvents;
|
||||||
|
import net.osmand.plus.download.DownloadResources;
|
||||||
|
import net.osmand.plus.download.IndexItem;
|
||||||
|
|
||||||
|
import java.util.Comparator;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class UpdatesIndexFragment extends OsmAndListFragment implements DownloadEvents {
|
public class UpdatesIndexFragment extends OsmAndListFragment implements DownloadEvents {
|
||||||
private static final int RELOAD_ID = 5;
|
private static final int RELOAD_ID = 5;
|
||||||
private UpdateIndexAdapter listAdapter;
|
private UpdateIndexAdapter listAdapter;
|
||||||
|
@ -210,5 +211,4 @@ public class UpdatesIndexFragment extends OsmAndListFragment implements Download
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -162,15 +162,11 @@ public class OsmEditingPlugin extends OsmandPlugin {
|
||||||
new EditPoiDialogFragment.ShowDeleteDialogAsyncTask(mapActivity)
|
new EditPoiDialogFragment.ShowDeleteDialogAsyncTask(mapActivity)
|
||||||
.execute((Amenity) selectedObj);
|
.execute((Amenity) selectedObj);
|
||||||
} else if (resId == R.string.poi_context_menu_modify) {
|
} else if (resId == R.string.poi_context_menu_modify) {
|
||||||
if (selectedObj instanceof Amenity) {
|
EditPoiDialogFragment.showEditInstance((Amenity) selectedObj, mapActivity);
|
||||||
EditPoiDialogFragment.showEditInstance((Amenity) selectedObj, mapActivity);
|
} else if (resId == R.string.poi_context_menu_modify_osm_change) {
|
||||||
} else if (selectedObj instanceof OpenstreetmapPoint) {
|
final Node entity = ((OpenstreetmapPoint) selectedObj).getEntity();
|
||||||
final Node entity = ((OpenstreetmapPoint) selectedObj).getEntity();
|
EditPoiDialogFragment.createInstance(entity, false)
|
||||||
EditPoiDialogFragment.createInstance(entity, false)
|
.show(mapActivity.getSupportFragmentManager(), "edit_poi");
|
||||||
.show(mapActivity.getSupportFragmentManager(), "edit_poi");
|
|
||||||
} else {
|
|
||||||
throw new IllegalArgumentException("Selected object is not editable");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -180,12 +176,13 @@ public class OsmEditingPlugin extends OsmandPlugin {
|
||||||
Amenity amenity = (Amenity) selectedObj;
|
Amenity amenity = (Amenity) selectedObj;
|
||||||
final PoiType poiType = amenity.getType().getPoiTypeByKeyName(amenity.getSubType());
|
final PoiType poiType = amenity.getType().getPoiTypeByKeyName(amenity.getSubType());
|
||||||
isEditable = !amenity.getType().isWiki() && !poiType.isNotEditableOsm();
|
isEditable = !amenity.getType().isWiki() && !poiType.isNotEditableOsm();
|
||||||
} else if (selectedObj instanceof OpenstreetmapPoint) {
|
|
||||||
isEditable = true;
|
|
||||||
}
|
}
|
||||||
if (isEditable) {
|
if (isEditable) {
|
||||||
adapter.item(R.string.poi_context_menu_modify).iconColor(R.drawable.ic_action_edit_dark).listen(listener).position(1).reg();
|
adapter.item(R.string.poi_context_menu_modify).iconColor(R.drawable.ic_action_edit_dark).listen(listener).position(1).reg();
|
||||||
adapter.item(R.string.poi_context_menu_delete).iconColor(R.drawable.ic_action_delete_dark).listen(listener).position(2).reg();
|
adapter.item(R.string.poi_context_menu_delete).iconColor(R.drawable.ic_action_delete_dark).listen(listener).position(2).reg();
|
||||||
|
} else if (selectedObj instanceof OpenstreetmapPoint) {
|
||||||
|
adapter.item(R.string.poi_context_menu_modify_osm_change)
|
||||||
|
.iconColor(R.drawable.ic_action_edit_dark).listen(listener).position(1).reg();
|
||||||
} else {
|
} else {
|
||||||
adapter.item(R.string.context_menu_item_create_poi).iconColor(R.drawable.ic_action_plus_dark).listen(listener).position(-1).reg();
|
adapter.item(R.string.context_menu_item_create_poi).iconColor(R.drawable.ic_action_plus_dark).listen(listener).position(-1).reg();
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,6 +30,7 @@ import android.widget.Toast;
|
||||||
|
|
||||||
import net.osmand.access.AccessibleToast;
|
import net.osmand.access.AccessibleToast;
|
||||||
import net.osmand.data.PointDescription;
|
import net.osmand.data.PointDescription;
|
||||||
|
import net.osmand.osm.edit.Node;
|
||||||
import net.osmand.plus.OsmandApplication;
|
import net.osmand.plus.OsmandApplication;
|
||||||
import net.osmand.plus.OsmandPlugin;
|
import net.osmand.plus.OsmandPlugin;
|
||||||
import net.osmand.plus.OsmandSettings;
|
import net.osmand.plus.OsmandSettings;
|
||||||
|
@ -464,6 +465,19 @@ public class OsmEditsFragment extends OsmAndListFragment
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
if (info instanceof OpenstreetmapPoint) {
|
||||||
|
item = optionsMenu.getMenu().add(R.string.poi_context_menu_modify_osm_change)
|
||||||
|
.setIcon(app.getIconsCache().getContentIcon(R.drawable.ic_action_edit_dark));
|
||||||
|
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onMenuItemClick(MenuItem item) {
|
||||||
|
final Node entity = ((OpenstreetmapPoint) info).getEntity();
|
||||||
|
EditPoiDialogFragment.createInstance(entity, false)
|
||||||
|
.show(getActivity().getSupportFragmentManager(), "edit_poi");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
item = optionsMenu.getMenu().add(R.string.shared_string_delete).
|
item = optionsMenu.getMenu().add(R.string.shared_string_delete).
|
||||||
setIcon(app.getIconsCache().getContentIcon(R.drawable.ic_action_delete_dark));
|
setIcon(app.getIconsCache().getContentIcon(R.drawable.ic_action_delete_dark));
|
||||||
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
|
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
|
||||||
|
|
Loading…
Reference in a new issue