Fix OSM Note UI
This commit is contained in:
parent
f87138af63
commit
2d872af5f1
10 changed files with 25 additions and 19 deletions
|
@ -11,7 +11,6 @@ import net.osmand.data.LatLon;
|
|||
import net.osmand.plus.OsmandPlugin;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.activities.MapActivity;
|
||||
import net.osmand.plus.osmedit.OsmEditingPlugin;
|
||||
import net.osmand.plus.quickaction.QuickAction;
|
||||
import net.osmand.plus.quickaction.QuickActionType;
|
||||
|
||||
|
@ -23,7 +22,7 @@ public class AddOSMBugAction extends QuickAction {
|
|||
|
||||
public static final QuickActionType TYPE = new QuickActionType(12,
|
||||
"osmbug.add", AddOSMBugAction.class).
|
||||
nameRes(R.string.quick_action_add_osm_bug).iconRes(R.drawable.ic_action_bug_dark).
|
||||
nameRes(R.string.quick_action_add_osm_bug).iconRes(R.drawable.ic_action_osm_note_add).
|
||||
category(QuickActionType.CREATE_CATEGORY);
|
||||
|
||||
public AddOSMBugAction() {
|
||||
|
|
|
@ -182,7 +182,7 @@ public class EditPOIMenuController extends MenuController {
|
|||
}
|
||||
return iconResId;
|
||||
} else if (osmPoint.getGroup() == OsmPoint.Group.BUG) {
|
||||
return R.drawable.ic_action_bug_dark;
|
||||
return R.drawable.ic_action_osm_note_add;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ public class ExportOptionsBottomSheetDialogFragment extends MenuBottomSheetDialo
|
|||
|
||||
BaseBottomSheetItem osmNotesItem = new BottomSheetItemWithDescription.Builder()
|
||||
.setDescription(String.valueOf(osmNotesCount))
|
||||
.setIcon(getContentIcon(R.drawable.ic_action_bug_dark))
|
||||
.setIcon(getContentIcon(R.drawable.ic_action_osm_note))
|
||||
.setTitle(getString(R.string.osm_notes))
|
||||
.setLayoutId(R.layout.bottom_sheet_item_with_right_descr)
|
||||
.setDisabled(!(osmNotesCount > 0))
|
||||
|
|
|
@ -79,9 +79,9 @@ public class OsmBugMenuController extends MenuController {
|
|||
@Override
|
||||
public Drawable getRightIcon() {
|
||||
if (bug.isOpened()) {
|
||||
return getIcon(R.drawable.ic_action_info_dark, R.color.osm_bug_unresolved_icon_color);
|
||||
return getIcon(R.drawable.ic_action_osm_note_unresolved, R.color.osm_bug_unresolved_icon_color);
|
||||
} else {
|
||||
return getIcon(R.drawable.ic_action_info_dark, R.color.osm_bug_resolved_icon_color);
|
||||
return getIcon(R.drawable.ic_action_osm_note_resolved, R.color.osm_bug_resolved_icon_color);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -295,7 +295,7 @@ public class OsmEditingPlugin extends OsmandPlugin {
|
|||
} else {
|
||||
adapter.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.context_menu_item_open_note, mapActivity)
|
||||
.setId(MAP_CONTEXT_MENU_OPEN_OSM_NOTE)
|
||||
.setIcon(R.drawable.ic_action_bug_dark)
|
||||
.setIcon(R.drawable.ic_action_osm_note_add)
|
||||
.setOrder(OPEN_OSM_NOTE_ITEM_ORDER)
|
||||
.setListener(listener)
|
||||
.createItem());
|
||||
|
@ -337,7 +337,7 @@ public class OsmEditingPlugin extends OsmandPlugin {
|
|||
.setId(OSM_NOTES)
|
||||
.setTitleId(R.string.layer_osm_bugs, mapActivity)
|
||||
.setSelected(settings.SHOW_OSM_BUGS.get())
|
||||
.setIcon(R.drawable.ic_action_bug_dark)
|
||||
.setIcon(R.drawable.ic_action_osm_note)
|
||||
.setColor(settings.SHOW_OSM_BUGS.get() ? R.color.osmand_orange : ContextMenuItem.INVALID_ID)
|
||||
.setSecondaryIcon(R.drawable.ic_action_additional_option)
|
||||
.setListener(new ContextMenuAdapter.OnRowItemClick() {
|
||||
|
|
|
@ -287,7 +287,7 @@ public class OsmEditsAdapter extends ArrayAdapter<Object> {
|
|||
}
|
||||
return app.getUIUtilities().getIcon(iconResId, colorResId);
|
||||
} else if (point.getGroup() == OsmPoint.Group.BUG) {
|
||||
return app.getUIUtilities().getIcon(R.drawable.ic_action_bug_dark, R.color.color_distance);
|
||||
return app.getUIUtilities().getIcon(R.drawable.ic_action_osm_note, R.color.color_distance);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -123,7 +123,7 @@ public class OsmEditsFragment extends OsmAndListFragment implements SendPoiDialo
|
|||
if (child.getGroup() == Group.POI) {
|
||||
icon.setImageDrawable(app.getUIUtilities().getIcon(R.drawable.ic_action_info_dark, R.color.color_distance));
|
||||
} else if (child.getGroup() == Group.BUG) {
|
||||
icon.setImageDrawable(app.getUIUtilities().getIcon(R.drawable.ic_action_bug_dark, R.color.color_distance));
|
||||
icon.setImageDrawable(app.getUIUtilities().getIcon(R.drawable.ic_action_osm_note, R.color.color_distance));
|
||||
}
|
||||
|
||||
TextView descr = (TextView) v.findViewById(R.id.description);
|
||||
|
|
|
@ -9,6 +9,7 @@ import androidx.annotation.NonNull;
|
|||
import androidx.annotation.Nullable;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import net.osmand.data.FavouritePoint.BackgroundType;
|
||||
import net.osmand.data.LatLon;
|
||||
import net.osmand.data.PointDescription;
|
||||
import net.osmand.data.RotatedTileBox;
|
||||
|
@ -26,6 +27,8 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static net.osmand.data.FavouritePoint.DEFAULT_BACKGROUND_TYPE;
|
||||
|
||||
public class OsmEditsLayer extends OsmandMapLayer implements ContextMenuLayer.IContextMenuProvider,
|
||||
ContextMenuLayer.IMoveObjectProvider {
|
||||
private static final int startZoom = 10;
|
||||
|
@ -79,16 +82,20 @@ public class OsmEditsLayer extends OsmandMapLayer implements ContextMenuLayer.IC
|
|||
}
|
||||
}
|
||||
|
||||
private void drawPoint(Canvas canvas, OsmPoint o, float x, float y) {
|
||||
private void drawPoint(Canvas canvas, OsmPoint osmPoint, float x, float y) {
|
||||
float textScale = activity.getMyApplication().getSettings().TEXT_SCALE.get();
|
||||
int iconId = getIconId(o);
|
||||
PointImageDrawable pointImageDrawable = PointImageDrawable.getOrCreate(activity,
|
||||
ContextCompat.getColor(activity, R.color.created_poi_icon_color), true,
|
||||
iconId);
|
||||
pointImageDrawable.setAlpha(0.8f);
|
||||
pointImageDrawable.drawPoint(canvas, x, y, textScale, false);
|
||||
int iconId = getIconId(osmPoint);
|
||||
BackgroundType backgroundType = DEFAULT_BACKGROUND_TYPE;
|
||||
if (osmPoint.getGroup() == OsmPoint.Group.BUG) {
|
||||
backgroundType = BackgroundType.COMMENT;
|
||||
}
|
||||
PointImageDrawable pointImageDrawable = PointImageDrawable.getOrCreate(activity,
|
||||
ContextCompat.getColor(activity, R.color.created_poi_icon_color), true, false,
|
||||
iconId, backgroundType);
|
||||
pointImageDrawable.setAlpha(0.8f);
|
||||
int offsetY = backgroundType.getOffsetY(activity, textScale);
|
||||
pointImageDrawable.drawPoint(canvas, x, y - offsetY, textScale, false);
|
||||
}
|
||||
|
||||
|
||||
public int getIconId(OsmPoint osmPoint) {
|
||||
if (osmPoint.getGroup() == OsmPoint.Group.POI) {
|
||||
|
@ -115,7 +122,7 @@ public class OsmEditsLayer extends OsmandMapLayer implements ContextMenuLayer.IC
|
|||
}
|
||||
return iconResId;
|
||||
} else if (osmPoint.getGroup() == OsmPoint.Group.BUG) {
|
||||
return R.drawable.ic_action_bug_dark;
|
||||
return R.drawable.mm_special_symbol_plus;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -109,7 +109,7 @@ public class OsmNotesMenu {
|
|||
adapter.addItem(new ContextMenuItem.ItemBuilder()
|
||||
.setTitleId(osmNotesStringId, mapActivity)
|
||||
.setDescription(mapActivity.getString(R.string.switch_osm_notes_visibility_desc))
|
||||
.setIcon(R.drawable.ic_action_bug_dark)
|
||||
.setIcon(R.drawable.ic_action_osm_note)
|
||||
.setColor(toggleIconColorId)
|
||||
.setListener(l)
|
||||
.setSelected(showOsmBugs)
|
||||
|
|
|
@ -16,7 +16,7 @@ public class ShowHideOSMBugAction extends QuickAction {
|
|||
|
||||
public static final QuickActionType TYPE = new QuickActionType(24,
|
||||
"osmbug.showhide", ShowHideOSMBugAction.class).
|
||||
nameRes(R.string.quick_action_showhide_osmbugs_title).iconRes(R.drawable.ic_action_bug_dark).nonEditable().
|
||||
nameRes(R.string.quick_action_showhide_osmbugs_title).iconRes(R.drawable.ic_action_osm_note).nonEditable().
|
||||
category(QuickActionType.CONFIGURE_MAP);
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue