From 52d137681563fb9b907cc974018527c17f07566f Mon Sep 17 00:00:00 2001 From: Alexey Kulish Date: Mon, 9 Nov 2015 11:52:43 +0300 Subject: [PATCH] Context menu small refactor, make left icon look nicer --- OsmAnd/res/layout/map_context_menu_fragment.xml | 7 +++---- OsmAnd/res/layout/menu_obj_list_item.xml | 7 +++---- .../osmand/plus/mapcontextmenu/MapContextMenuFragment.java | 2 +- .../mapcontextmenu/controllers/AmenityMenuController.java | 5 ----- .../controllers/AudioVideoNoteMenuController.java | 5 ----- .../mapcontextmenu/controllers/EditPOIMenuController.java | 5 ----- .../controllers/FavouritePointMenuController.java | 7 +------ .../mapcontextmenu/controllers/HistoryMenuController.java | 5 ----- .../mapcontextmenu/controllers/MapDataMenuController.java | 7 ------- .../controllers/MyLocationMenuController.java | 5 ----- .../mapcontextmenu/controllers/OsMoMenuController.java | 5 ----- .../controllers/ParkingPositionMenuController.java | 5 ----- .../controllers/PointDescriptionMenuController.java | 5 ----- .../controllers/TargetPointMenuController.java | 5 ----- .../mapcontextmenu/controllers/WptPtMenuController.java | 5 ----- .../editors/FavoritePointEditorFragment.java | 2 +- .../other/MapMultiSelectionMenuFragment.java | 2 +- 17 files changed, 10 insertions(+), 74 deletions(-) diff --git a/OsmAnd/res/layout/map_context_menu_fragment.xml b/OsmAnd/res/layout/map_context_menu_fragment.xml index 6ada5a299d..1bd9fef5f7 100644 --- a/OsmAnd/res/layout/map_context_menu_fragment.xml +++ b/OsmAnd/res/layout/map_context_menu_fragment.xml @@ -43,12 +43,11 @@ diff --git a/OsmAnd/res/layout/menu_obj_list_item.xml b/OsmAnd/res/layout/menu_obj_list_item.xml index 916bc8971e..b1f3f265b5 100644 --- a/OsmAnd/res/layout/menu_obj_list_item.xml +++ b/OsmAnd/res/layout/menu_obj_list_item.xml @@ -15,12 +15,11 @@ diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java index 7a61106de7..d0753c096e 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java @@ -531,7 +531,7 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents { iconLayout.setVisibility(View.VISIBLE); } else if (iconId != 0) { iconView.setImageDrawable(iconsCache.getIcon(iconId, - light ? R.color.osmand_orange : R.color.osmand_orange_dark, 0.75f)); + light ? R.color.osmand_orange : R.color.osmand_orange_dark)); iconLayout.setVisibility(View.VISIBLE); } else { iconLayout.setVisibility(View.GONE); diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/AmenityMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/AmenityMenuController.java index c0c42d651c..f103418ea6 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/AmenityMenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/AmenityMenuController.java @@ -75,9 +75,4 @@ public class AmenityMenuController extends MenuController { } addMyLocationToPlainItems(pointDescription, amenity.getLocation()); } - - @Override - public String getNameStr() { - return getPointDescription().getName(); - } } diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/AudioVideoNoteMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/AudioVideoNoteMenuController.java index 1671cd1e15..0d6a5666d4 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/AudioVideoNoteMenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/AudioVideoNoteMenuController.java @@ -85,11 +85,6 @@ public class AudioVideoNoteMenuController extends MenuController { } } - @Override - public String getNameStr() { - return getPointDescription().getName(); - } - @Override public String getTypeStr() { return recording.getType(getMapActivity()); diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/EditPOIMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/EditPOIMenuController.java index 819992824f..d37e55eb66 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/EditPOIMenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/EditPOIMenuController.java @@ -134,11 +134,6 @@ public class EditPOIMenuController extends MenuController { return getIcon(R.drawable.ic_action_gabout_dark, R.color.osmand_orange_dark, R.color.osmand_orange); } - @Override - public String getNameStr() { - return getPointDescription().getName(); - } - @Override public String getTypeStr() { return pointTypeStr; diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/FavouritePointMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/FavouritePointMenuController.java index 09aaf607be..c722ec1916 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/FavouritePointMenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/FavouritePointMenuController.java @@ -55,7 +55,7 @@ public class FavouritePointMenuController extends MenuController { @Override public Drawable getLeftIcon() { - return FavoriteImageDrawable.getOrCreate(getMapActivity().getMyApplication(), fav.getColor(), true); + return FavoriteImageDrawable.getOrCreate(getMapActivity().getMyApplication(), fav.getColor(), false); } @Override @@ -73,9 +73,4 @@ public class FavouritePointMenuController extends MenuController { return fav.getCategory().length() == 0 ? getMapActivity().getString(R.string.shared_string_favorites) : fav.getCategory(); } - - @Override - public String getNameStr() { - return getPointDescription().getName(); - } } diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/HistoryMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/HistoryMenuController.java index 2d9adbc951..c9a6c62393 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/HistoryMenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/HistoryMenuController.java @@ -50,11 +50,6 @@ public class HistoryMenuController extends MenuController { } } - @Override - public String getNameStr() { - return getPointDescription().getName(); - } - @Override public String getTypeStr() { if (needTypeStr()) { diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/MapDataMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/MapDataMenuController.java index 1fc744e354..d03b6c1b5e 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/MapDataMenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/MapDataMenuController.java @@ -35,7 +35,6 @@ public class MapDataMenuController extends MenuController { private WorldRegion region; private IndexItem indexItem; private List otherIndexItems; - private String name; private DownloadValidationManager downloadValidationManager; private DownloadIndexesThread downloadThread; @@ -45,7 +44,6 @@ public class MapDataMenuController extends MenuController { OsmandRegions osmandRegions = app.getRegions(); String fullName = osmandRegions.getFullName(dataObject); this.region = osmandRegions.getRegionData(fullName); - name = getPointDescription().getName(); downloadValidationManager = new DownloadValidationManager(app); downloadThread = app.getDownloadThread(); @@ -120,11 +118,6 @@ public class MapDataMenuController extends MenuController { return getIcon(R.drawable.ic_map, R.color.osmand_orange_dark, R.color.osmand_orange); } - @Override - public String getNameStr() { - return name; - } - @Override public String getTypeStr() { String res; diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/MyLocationMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/MyLocationMenuController.java index d904897594..49deb8c840 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/MyLocationMenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/MyLocationMenuController.java @@ -25,9 +25,4 @@ public class MyLocationMenuController extends MenuController { ApplicationMode appMode = getMapActivity().getMyApplication().getSettings().getApplicationMode(); return getMapActivity().getResources().getDrawable(appMode.getResourceLocation()); } - - @Override - public String getNameStr() { - return getPointDescription().getName(); - } } diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/OsMoMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/OsMoMenuController.java index fee2e7232b..84fd3cc5c6 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/OsMoMenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/OsMoMenuController.java @@ -40,11 +40,6 @@ public class OsMoMenuController extends MenuController { } } - @Override - public String getNameStr() { - return getPointDescription().getName(); - } - @Override public String getTypeStr() { OsmandApplication app = getMapActivity().getMyApplication(); diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/ParkingPositionMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/ParkingPositionMenuController.java index e973ad4b8b..7871629610 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/ParkingPositionMenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/ParkingPositionMenuController.java @@ -61,11 +61,6 @@ public class ParkingPositionMenuController extends MenuController { return getIcon(R.drawable.ic_action_parking_dark, R.color.map_widget_blue, R.color.osmand_orange); } - @Override - public String getNameStr() { - return getPointDescription().getName(); - } - @Override public String getTypeStr() { return parkingDescription; diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/PointDescriptionMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/PointDescriptionMenuController.java index b28b806bd9..a4757a1eda 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/PointDescriptionMenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/PointDescriptionMenuController.java @@ -52,11 +52,6 @@ public class PointDescriptionMenuController extends MenuController { } } - @Override - public String getNameStr() { - return getPointDescription().getName(); - } - @Override public String getTypeStr() { if (needTypeStr()) { diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/TargetPointMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/TargetPointMenuController.java index 563d2dc37d..17953f0267 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/TargetPointMenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/TargetPointMenuController.java @@ -68,11 +68,6 @@ public class TargetPointMenuController extends MenuController { } } - @Override - public String getNameStr() { - return getPointDescription().getName(); - } - @Override public String getTypeStr() { return targetPoint.getPointDescription(getMapActivity()).getTypeName(); diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/WptPtMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/WptPtMenuController.java index 73d0f49948..090bc64a4b 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/WptPtMenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/WptPtMenuController.java @@ -70,9 +70,4 @@ public class WptPtMenuController extends MenuController { public String getTypeStr() { return wpt.category != null ? wpt.category : getMapActivity().getString(R.string.shared_string_none); } - - @Override - public String getNameStr() { - return getPointDescription().getName(); - } } diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/FavoritePointEditorFragment.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/FavoritePointEditorFragment.java index 840b20aa73..9f425f2fe6 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/FavoritePointEditorFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/FavoritePointEditorFragment.java @@ -210,7 +210,7 @@ public class FavoritePointEditorFragment extends PointEditorFragment { if (group != null) { color = group.color; } - return FavoriteImageDrawable.getOrCreate(getMapActivity(), color, true); + return FavoriteImageDrawable.getOrCreate(getMapActivity(), color, false); } @Override diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/MapMultiSelectionMenuFragment.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/MapMultiSelectionMenuFragment.java index 8773a5f619..bfc29e2c3d 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/MapMultiSelectionMenuFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/MapMultiSelectionMenuFragment.java @@ -142,7 +142,7 @@ public class MapMultiSelectionMenuFragment extends Fragment implements AdapterVi iconLayout.setVisibility(View.VISIBLE); } else if (iconId != 0) { iconView.setImageDrawable(iconsCache.getIcon(iconId, - menu.isLight() ? R.color.osmand_orange : R.color.osmand_orange_dark, 0.75f)); + menu.isLight() ? R.color.osmand_orange : R.color.osmand_orange_dark)); iconLayout.setVisibility(View.VISIBLE); } else { iconLayout.setVisibility(View.GONE);