From 3c0bd48945a545d7a510290b2d0a20c3f7a1908a Mon Sep 17 00:00:00 2001 From: veliymolfar Date: Fri, 24 Apr 2020 14:33:06 +0300 Subject: [PATCH] ui fixes --- OsmAnd/res/layout/profile_edit_list_item.xml | 16 +++---- OsmAnd/res/values/strings.xml | 1 + .../plus/activities/MapActivityActions.java | 5 ++- .../MapContextMenuFragment.java | 3 +- .../settings/RearrangeMenuItemsAdapter.java | 45 +++++++++++++++++-- 5 files changed, 53 insertions(+), 17 deletions(-) diff --git a/OsmAnd/res/layout/profile_edit_list_item.xml b/OsmAnd/res/layout/profile_edit_list_item.xml index 8f7b962ef5..cb0cc1aa89 100644 --- a/OsmAnd/res/layout/profile_edit_list_item.xml +++ b/OsmAnd/res/layout/profile_edit_list_item.xml @@ -27,17 +27,15 @@ + android:layout_marginEnd="@dimen/content_padding_half" + android:layout_marginRight="@dimen/content_padding_half" /> + Create/Edit POI Unsupported action %1$s Extra maps Custom color diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java index ef9f6f9f6c..20b6ece7d0 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java @@ -31,6 +31,7 @@ import net.osmand.GPXUtilities.WptPt; import net.osmand.IndexConstants; import net.osmand.Location; import net.osmand.PlatformUtil; +import net.osmand.data.FavouritePoint; import net.osmand.data.LatLon; import net.osmand.data.PointDescription; import net.osmand.data.QuadRect; @@ -346,7 +347,7 @@ public class MapActivityActions implements DialogProvider { ItemBuilder itemBuilder = new ItemBuilder(); adapter.addItem(itemBuilder - .setTitleId(R.string.shared_string_add, mapActivity) + .setTitleId(selectedObj instanceof FavouritePoint ? R.string.favourites_context_menu_edit : R.string.shared_string_add, mapActivity) .setId(MAP_CONTEXT_MENU_ADD_ID) .setIcon(R.drawable.map_action_fav_dark) .setOrder(0) @@ -477,7 +478,7 @@ public class MapActivityActions implements DialogProvider { MeasurementToolFragment.showInstance(mapActivity.getSupportFragmentManager(), new LatLon(latitude, longitude)); } else if (standardId == R.string.avoid_road) { getMyApplication().getAvoidSpecificRoads().addImpassableRoad(mapActivity, new LatLon(latitude, longitude), true, false, null); - } else if (standardId == R.string.shared_string_add) { + } else if (standardId == R.string.shared_string_add || standardId == R.string.favourites_context_menu_edit) { mapActivity.getContextMenu().buttonFavoritePressed(); } else if (standardId == R.string.shared_string_marker) { mapActivity.getContextMenu().buttonWaypointPressed(); diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java index ab8f716b4f..519d209714 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java @@ -668,7 +668,8 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo TextView title = view.findViewById(R.id.text); icon.setImageDrawable(uiUtilities.getIcon(contextMenuItem.getIcon(), nightMode)); title.setText(contextMenuItem.getTitle()); - if (contextMenuItem.getId().equals(MAP_CONTEXT_MENU_MORE_ID)) { + String id = contextMenuItem.getId(); + if (Algorithms.stringsEqual(id, MAP_CONTEXT_MENU_MORE_ID)) { item.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { diff --git a/OsmAnd/src/net/osmand/plus/settings/RearrangeMenuItemsAdapter.java b/OsmAnd/src/net/osmand/plus/settings/RearrangeMenuItemsAdapter.java index 960e5d7d82..9733d51d74 100644 --- a/OsmAnd/src/net/osmand/plus/settings/RearrangeMenuItemsAdapter.java +++ b/OsmAnd/src/net/osmand/plus/settings/RearrangeMenuItemsAdapter.java @@ -31,13 +31,27 @@ import net.osmand.plus.settings.ConfigureMenuRootFragment.ScreenType; import java.util.Collections; import java.util.List; +import static net.osmand.aidlapi.OsmAndCustomizationConstants.CONTOUR_LINES; import static net.osmand.aidlapi.OsmAndCustomizationConstants.DRAWER_BUILDS_ID; import static net.osmand.aidlapi.OsmAndCustomizationConstants.DRAWER_DIVIDER_ID; +import static net.osmand.aidlapi.OsmAndCustomizationConstants.GPX_FILES_ID; +import static net.osmand.aidlapi.OsmAndCustomizationConstants.MAP_CONTEXT_MENU_ADD_GPX_WAYPOINT; +import static net.osmand.aidlapi.OsmAndCustomizationConstants.MAP_CONTEXT_MENU_CREATE_POI; +import static net.osmand.aidlapi.OsmAndCustomizationConstants.MAP_CONTEXT_MENU_EDIT_GPX_WP; +import static net.osmand.aidlapi.OsmAndCustomizationConstants.MAP_CONTEXT_MENU_MODIFY_OSM_NOTE; import static net.osmand.aidlapi.OsmAndCustomizationConstants.MAP_CONTEXT_MENU_MORE_ID; +import static net.osmand.aidlapi.OsmAndCustomizationConstants.MAP_CONTEXT_MENU_OPEN_OSM_NOTE; import static net.osmand.aidlapi.OsmAndCustomizationConstants.MAP_RENDERING_CATEGORY_ID; +import static net.osmand.aidlapi.OsmAndCustomizationConstants.MAP_SOURCE_ID; +import static net.osmand.aidlapi.OsmAndCustomizationConstants.OSM_EDITS; +import static net.osmand.aidlapi.OsmAndCustomizationConstants.OSM_NOTES; +import static net.osmand.aidlapi.OsmAndCustomizationConstants.OVERLAY_MAP; +import static net.osmand.aidlapi.OsmAndCustomizationConstants.RECORDING_LAYER; import static net.osmand.aidlapi.OsmAndCustomizationConstants.RENDERING_ITEMS_ID_SCHEME; import static net.osmand.aidlapi.OsmAndCustomizationConstants.SHOW_CATEGORY_ID; import static net.osmand.aidlapi.OsmAndCustomizationConstants.SHOW_ITEMS_ID_SCHEME; +import static net.osmand.aidlapi.OsmAndCustomizationConstants.TERRAIN; +import static net.osmand.aidlapi.OsmAndCustomizationConstants.UNDERLAY_MAP; import static net.osmand.plus.settings.ConfigureMenuItemsFragment.MAIN_BUTTONS_QUANTITY; public class RearrangeMenuItemsAdapter extends RecyclerView.Adapter @@ -192,6 +206,9 @@ public class RearrangeMenuItemsAdapter extends RecyclerView.Adapter