From e01319cd82a8119a1b99fea447d4a0174225d566 Mon Sep 17 00:00:00 2001 From: PavelRatushny Date: Wed, 27 Dec 2017 17:07:38 +0200 Subject: [PATCH] Rename left icon to right icon --- .../AudioVideoNoteMenuController.java | 2 +- .../MapContextMenuFragment.java | 4 ++-- .../plus/mapcontextmenu/MenuController.java | 4 ++-- .../mapcontextmenu/MenuTitleController.java | 20 +++++++++---------- .../controllers/AMapPointMenuController.java | 2 +- .../controllers/AmenityMenuController.java | 9 ++++----- .../FavouritePointMenuController.java | 2 +- .../controllers/GpxItemMenuController.java | 2 +- .../controllers/HistoryMenuController.java | 2 +- .../ImpassibleRoadsMenuController.java | 2 +- .../controllers/MapDataMenuController.java | 2 +- .../controllers/MapMarkerMenuController.java | 2 +- .../controllers/MyLocationMenuController.java | 2 +- .../PointDescriptionMenuController.java | 2 +- .../RenderedObjectMenuController.java | 2 +- .../TargetPointMenuController.java | 2 +- .../controllers/TransportRouteController.java | 2 +- .../controllers/TransportStopController.java | 2 +- .../controllers/WptPtMenuController.java | 2 +- .../other/MultiSelectionArrayAdapter.java | 4 ++-- .../mapillary/MapillaryMenuController.java | 2 +- .../plus/osmedit/EditPOIMenuController.java | 2 +- .../plus/osmedit/OsmBugMenuController.java | 2 +- .../osmand/plus/osmo/OsMoMenuController.java | 2 +- .../ParkingPositionMenuController.java | 2 +- .../osmand/plus/views/ContextMenuLayer.java | 2 +- 26 files changed, 41 insertions(+), 42 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNoteMenuController.java b/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNoteMenuController.java index fef72984e8..e46e4ab81f 100644 --- a/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNoteMenuController.java +++ b/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNoteMenuController.java @@ -86,7 +86,7 @@ public class AudioVideoNoteMenuController extends MenuController { } @Override - public Drawable getLeftIcon() { + public Drawable getRightIcon() { if (mRecording.isPhoto()) { return getIcon(R.drawable.ic_action_photo_dark, R.color.audio_video_icon_color); } else if (mRecording.isAudio()) { diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java index dfec7917a6..93225b8ded 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java @@ -851,8 +851,8 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo OsmandApplication app = getMyApplication(); if (app != null && view != null) { final ImageView iconView = (ImageView) view.findViewById(R.id.context_menu_icon_view); - Drawable icon = menu.getLeftIcon(); - int iconId = menu.getLeftIconId(); + Drawable icon = menu.getRightIcon(); + int iconId = menu.getRightIconId(); if (icon != null) { iconView.setImageDrawable(icon); iconView.setVisibility(View.VISIBLE); diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java index 91fdbd450b..14d8bf65f5 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java @@ -386,11 +386,11 @@ public abstract class MenuController extends BaseMenuController { return false; } - public int getLeftIconId() { + public int getRightIconId() { return 0; } - public Drawable getLeftIcon() { + public Drawable getRightIcon() { return null; } diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuTitleController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuTitleController.java index 108aeb78b9..4df7f95571 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuTitleController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuTitleController.java @@ -11,8 +11,8 @@ import net.osmand.util.Algorithms; public abstract class MenuTitleController { - protected int leftIconId; - protected Drawable leftIcon; + protected int rightIconId; + protected Drawable rightIcon; protected String nameStr = ""; protected String typeStr = ""; protected String commonTypeStr = ""; @@ -65,12 +65,12 @@ public abstract class MenuTitleController { return !addressNotFoundStr.equals(title) && !searchAddressStr.equals(title); } - public int getLeftIconId() { - return leftIconId; + public int getRightIconId() { + return rightIconId; } - public Drawable getLeftIcon() { - return leftIcon; + public Drawable getRightIcon() { + return rightIcon; } public Drawable getTypeIcon() { @@ -125,13 +125,13 @@ public abstract class MenuTitleController { protected void acquireIcons() { MenuController menuController = getMenuController(); - leftIconId = 0; - leftIcon = null; + rightIconId = 0; + rightIcon = null; secondLineTypeIcon = null; if (menuController != null) { - leftIconId = menuController.getLeftIconId(); - leftIcon = menuController.getLeftIcon(); + rightIconId = menuController.getRightIconId(); + rightIcon = menuController.getRightIcon(); secondLineTypeIcon = menuController.getSecondLineTypeIcon(); } } diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/AMapPointMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/AMapPointMenuController.java index 4821d345d9..a5158139e8 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/AMapPointMenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/AMapPointMenuController.java @@ -49,7 +49,7 @@ public class AMapPointMenuController extends MenuController { } @Override - public Drawable getLeftIcon() { + public Drawable getRightIcon() { return getIcon(R.drawable.ic_action_get_my_location); } diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/AmenityMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/AmenityMenuController.java index 4a448ca60e..c29722c162 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/AmenityMenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/AmenityMenuController.java @@ -21,7 +21,6 @@ import net.osmand.plus.transport.TransportStopRoute; import net.osmand.plus.render.RenderingIcons; import net.osmand.plus.resources.TransportIndexRepository; import net.osmand.plus.transport.TransportStopType; -import net.osmand.plus.views.POIMapLayer; import net.osmand.util.Algorithms; import net.osmand.util.MapUtils; import net.osmand.util.OpeningHoursParser; @@ -109,11 +108,11 @@ public class AmenityMenuController extends MenuController { } @Override - public int getLeftIconId() { - return getLeftIconId(amenity); + public int getRightIconId() { + return getRightIconId(amenity); } - private static int getLeftIconId(Amenity amenity) { + private static int getRightIconId(Amenity amenity) { String id = null; PoiType st = amenity.getType().getPoiTypeByKeyName(amenity.getSubType()); if (st != null) { @@ -221,7 +220,7 @@ public class AmenityMenuController extends MenuController { public static void addPlainMenuItems(Amenity amenity, String typeStr, MenuBuilder builder) { if (!Algorithms.isEmpty(typeStr)) { - int resId = getLeftIconId(amenity); + int resId = getRightIconId(amenity); if (resId == 0) { PoiCategory pc = amenity.getType(); resId = RenderingIcons.getBigIconResourceId(pc.getIconKeyName()); diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/FavouritePointMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/FavouritePointMenuController.java index 4d2d5b7f98..c1ceba5a53 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/FavouritePointMenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/FavouritePointMenuController.java @@ -102,7 +102,7 @@ public class FavouritePointMenuController extends MenuController { } @Override - public Drawable getLeftIcon() { + public Drawable getRightIcon() { return FavoriteImageDrawable.getOrCreate(getMapActivity().getMyApplication(), fav.getColor(), false); } diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/GpxItemMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/GpxItemMenuController.java index cb8fc3407a..ccd28b02fd 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/GpxItemMenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/GpxItemMenuController.java @@ -45,7 +45,7 @@ public class GpxItemMenuController extends MenuController { } @Override - public Drawable getLeftIcon() { + public Drawable getRightIcon() { return getIcon(R.drawable.ic_action_polygom_dark, R.color.osmand_orange); } } diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/HistoryMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/HistoryMenuController.java index 4bdd240adb..b0a4f758e1 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/HistoryMenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/HistoryMenuController.java @@ -52,7 +52,7 @@ public class HistoryMenuController extends MenuController { } @Override - public Drawable getLeftIcon() { + public Drawable getRightIcon() { return getIcon(SearchHistoryFragment.getItemIcon(entry.getName())); } diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/ImpassibleRoadsMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/ImpassibleRoadsMenuController.java index 1d2e6e342a..0877112847 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/ImpassibleRoadsMenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/ImpassibleRoadsMenuController.java @@ -53,7 +53,7 @@ public class ImpassibleRoadsMenuController extends MenuController { } @Override - public Drawable getLeftIcon() { + public Drawable getRightIcon() { return ContextCompat.getDrawable(getMapActivity(), R.drawable.map_pin_avoid_road); } } diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/MapDataMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/MapDataMenuController.java index 62e5f9ff0f..da0c1b09a6 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/MapDataMenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/MapDataMenuController.java @@ -231,7 +231,7 @@ public class MapDataMenuController extends MenuController { } @Override - public Drawable getLeftIcon() { + public Drawable getRightIcon() { int iconResId; if (getDownloadActivityType() != null) { iconResId = getDownloadActivityType().getIconResource(); diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/MapMarkerMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/MapMarkerMenuController.java index ce7d2b33ea..c8247d34e5 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/MapMarkerMenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/MapMarkerMenuController.java @@ -89,7 +89,7 @@ public class MapMarkerMenuController extends MenuController { } @Override - public Drawable getLeftIcon() { + public Drawable getRightIcon() { return MapMarkerDialogHelper.getMapMarkerIcon(getMapActivity().getMyApplication(), mapMarker.colorIndex); } diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/MyLocationMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/MyLocationMenuController.java index d1f2fc6624..4cb05ddca3 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/MyLocationMenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/MyLocationMenuController.java @@ -42,7 +42,7 @@ public class MyLocationMenuController extends MenuController { } @Override - public Drawable getLeftIcon() { + public Drawable getRightIcon() { ApplicationMode appMode = getMapActivity().getMyApplication().getSettings().getApplicationMode(); return getMapActivity().getResources().getDrawable(appMode.getResourceLocationDay()); } diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/PointDescriptionMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/PointDescriptionMenuController.java index 8d875706c2..86f2836b8f 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/PointDescriptionMenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/PointDescriptionMenuController.java @@ -46,7 +46,7 @@ public class PointDescriptionMenuController extends MenuController { } @Override - public Drawable getLeftIcon() { + public Drawable getRightIcon() { return getIcon(SearchHistoryFragment.getItemIcon(getPointDescription())); } diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/RenderedObjectMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/RenderedObjectMenuController.java index 3e834bfa46..d9b1ea205b 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/RenderedObjectMenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/RenderedObjectMenuController.java @@ -49,7 +49,7 @@ public class RenderedObjectMenuController extends MenuController { } @Override - public int getLeftIconId() { + public int getRightIconId() { if (renderedObject.getIconRes() != null && RenderingIcons.containsBigIcon(renderedObject.getIconRes())) { return RenderingIcons.getBigIconResourceId(renderedObject.getIconRes()); } else { diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/TargetPointMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/TargetPointMenuController.java index 5baf0985cb..da14f135d1 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/TargetPointMenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/TargetPointMenuController.java @@ -79,7 +79,7 @@ public class TargetPointMenuController extends MenuController { } @Override - public Drawable getLeftIcon() { + public Drawable getRightIcon() { if (targetPoint.start) { return getIconOrig(R.drawable.list_startpoint); } else if (!targetPoint.intermediate) { diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/TransportRouteController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/TransportRouteController.java index e0eca34040..9284d30567 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/TransportRouteController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/TransportRouteController.java @@ -61,7 +61,7 @@ public class TransportRouteController extends MenuController { } @Override - public int getLeftIconId() { + public int getRightIconId() { return this.transportRoute.type == null ? R.drawable.mx_public_transport : this.transportRoute.type.getTopResourceId(); diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/TransportStopController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/TransportStopController.java index 60502b588b..811c1344fe 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/TransportStopController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/TransportStopController.java @@ -58,7 +58,7 @@ public class TransportStopController extends MenuController { } @Override - public int getLeftIconId() { + public int getRightIconId() { if (topType == null) { return R.drawable.mx_public_transport; } else { diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/WptPtMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/WptPtMenuController.java index 1701259c47..9fdd42328d 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/WptPtMenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/WptPtMenuController.java @@ -76,7 +76,7 @@ public class WptPtMenuController extends MenuController { } @Override - public Drawable getLeftIcon() { + public Drawable getRightIcon() { return FavoriteImageDrawable.getOrCreate(getMapActivity().getMyApplication(), wpt.getColor(ContextCompat.getColor(getMapActivity(), R.color.gpx_color_point)), false); } diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/MultiSelectionArrayAdapter.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/MultiSelectionArrayAdapter.java index 960d74ad35..abce00e1de 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/MultiSelectionArrayAdapter.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/MultiSelectionArrayAdapter.java @@ -49,8 +49,8 @@ public class MultiSelectionArrayAdapter extends ArrayAdapter