From e2b8e77c1cab6aff071dd1bdba4bb4a38749b582 Mon Sep 17 00:00:00 2001 From: sergdevosm Date: Mon, 24 Aug 2020 00:44:46 +0300 Subject: [PATCH 01/12] Fix #9533 --- OsmAnd/src/net/osmand/plus/OsmandPlugin.java | 6 +++--- .../src/net/osmand/plus/activities/MapActivityActions.java | 2 +- .../net/osmand/plus/audionotes/AudioVideoNotesPlugin.java | 2 +- OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java | 2 +- .../net/osmand/plus/parkingpoint/ParkingPositionPlugin.java | 2 +- .../net/osmand/plus/rastermaps/OsmandRasterMapsPlugin.java | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/OsmandPlugin.java b/OsmAnd/src/net/osmand/plus/OsmandPlugin.java index bf9eccf4b4..0d887bc47f 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandPlugin.java +++ b/OsmAnd/src/net/osmand/plus/OsmandPlugin.java @@ -525,7 +525,7 @@ public abstract class OsmandPlugin { protected void registerLayerContextMenuActions(OsmandMapTileView mapView, ContextMenuAdapter adapter, MapActivity mapActivity) { } - protected void registerMapContextMenuActions(MapActivity mapActivity, double latitude, double longitude, ContextMenuAdapter adapter, Object selectedObj) { + protected void registerMapContextMenuActions(MapActivity mapActivity, double latitude, double longitude, ContextMenuAdapter adapter, Object selectedObj, boolean configureMenu) { } protected void registerOptionsMenuItems(MapActivity mapActivity, ContextMenuAdapter helper) { @@ -791,9 +791,9 @@ public abstract class OsmandPlugin { } } - public static void registerMapContextMenu(MapActivity map, double latitude, double longitude, ContextMenuAdapter adapter, Object selectedObj) { + public static void registerMapContextMenu(MapActivity map, double latitude, double longitude, ContextMenuAdapter adapter, Object selectedObj, boolean configureMenu) { for (OsmandPlugin plugin : getEnabledPlugins()) { - plugin.registerMapContextMenuActions(map, latitude, longitude, adapter, selectedObj); + plugin.registerMapContextMenuActions(map, latitude, longitude, adapter, selectedObj, configureMenu); } } diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java index f7464c310e..69ae842c8b 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java @@ -384,7 +384,7 @@ public class MapActivityActions implements DialogProvider { .setOrder(SEARCH_NEAR_ITEM_ORDER) .createItem()); - OsmandPlugin.registerMapContextMenu(mapActivity, latitude, longitude, adapter, selectedObj); + OsmandPlugin.registerMapContextMenu(mapActivity, latitude, longitude, adapter, selectedObj, configureMenu); ItemClickListener listener = new ItemClickListener() { @Override diff --git a/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java b/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java index e57d86139a..781843f2d6 100644 --- a/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java +++ b/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java @@ -659,7 +659,7 @@ public class AudioVideoNotesPlugin extends OsmandPlugin { @Override public void registerMapContextMenuActions(final MapActivity mapActivity, final double latitude, final double longitude, - ContextMenuAdapter adapter, Object selectedObj) { + ContextMenuAdapter adapter, Object selectedObj, boolean configureMenu) { if (isRecording()) { return; } diff --git a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java index 121536418e..427831de54 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java @@ -219,7 +219,7 @@ public class OsmEditingPlugin extends OsmandPlugin { final double latitude, final double longitude, ContextMenuAdapter adapter, - final Object selectedObj) { + final Object selectedObj, boolean configureMenu) { ContextMenuAdapter.ItemClickListener listener = new ContextMenuAdapter.ItemClickListener() { @Override public boolean onContextMenuClick(ArrayAdapter adapter, int resId, int pos, boolean isChecked, int[] viewCoordinates) { diff --git a/OsmAnd/src/net/osmand/plus/parkingpoint/ParkingPositionPlugin.java b/OsmAnd/src/net/osmand/plus/parkingpoint/ParkingPositionPlugin.java index 8583190f30..038f9c9830 100644 --- a/OsmAnd/src/net/osmand/plus/parkingpoint/ParkingPositionPlugin.java +++ b/OsmAnd/src/net/osmand/plus/parkingpoint/ParkingPositionPlugin.java @@ -230,7 +230,7 @@ public class ParkingPositionPlugin extends OsmandPlugin { @Override public void registerMapContextMenuActions(final MapActivity mapActivity, final double latitude, final double longitude, - ContextMenuAdapter adapter, Object selectedObj) { + ContextMenuAdapter adapter, Object selectedObj, boolean configureMenu) { ItemClickListener addListener = new ItemClickListener() { @Override diff --git a/OsmAnd/src/net/osmand/plus/rastermaps/OsmandRasterMapsPlugin.java b/OsmAnd/src/net/osmand/plus/rastermaps/OsmandRasterMapsPlugin.java index 62b475baac..ab0031a7df 100644 --- a/OsmAnd/src/net/osmand/plus/rastermaps/OsmandRasterMapsPlugin.java +++ b/OsmAnd/src/net/osmand/plus/rastermaps/OsmandRasterMapsPlugin.java @@ -400,7 +400,7 @@ public class OsmandRasterMapsPlugin extends OsmandPlugin { @Override public void registerMapContextMenuActions(MapActivity mapActivity, final double latitude, final double longitude, - ContextMenuAdapter adapter, Object selectedObj) { + ContextMenuAdapter adapter, Object selectedObj, boolean configureMenu) { final WeakReference mapActivityRef = new WeakReference<>(mapActivity); if (mapActivity.getMapView().getMainLayer() instanceof MapTileLayer) { ItemClickListener listener = new ContextMenuAdapter.ItemClickListener() { From 26071cf468ffad21406885d73bf7f89d80a752e7 Mon Sep 17 00:00:00 2001 From: Dima-1 Date: Mon, 31 Aug 2020 18:31:08 +0300 Subject: [PATCH 02/12] Fix ruler, plan route AppBar and bottom buttons --- .../layout-land/fragment_measurement_tool.xml | 267 ++++++++---------- OsmAnd/res/layout-land/map_hud_top.xml | 18 +- .../res/layout/fragment_measurement_tool.xml | 102 +++---- OsmAnd/res/layout/map_hud_bottom.xml | 13 +- OsmAnd/res/layout/map_hud_top.xml | 48 ++-- OsmAnd/res/values-large/sizes.xml | 1 - OsmAnd/res/values/sizes.xml | 6 +- OsmAnd/res/values/strings.xml | 1 + .../MeasurementToolFragment.java | 21 +- .../OptionsBottomSheetDialogFragment.java | 2 +- 10 files changed, 213 insertions(+), 266 deletions(-) diff --git a/OsmAnd/res/layout-land/fragment_measurement_tool.xml b/OsmAnd/res/layout-land/fragment_measurement_tool.xml index 710a81682c..91bc741fab 100644 --- a/OsmAnd/res/layout-land/fragment_measurement_tool.xml +++ b/OsmAnd/res/layout-land/fragment_measurement_tool.xml @@ -1,20 +1,21 @@ - + android:clickable="true" + android:focusable="true"> + tools:visibility="visible" /> @@ -69,43 +70,39 @@ android:id="@+id/measurement_distance_text_view" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_centerVertical="true" - android:layout_marginEnd="@dimen/measurement_tool_text_margin" - android:layout_marginLeft="@dimen/measurement_tool_text_margin" - android:layout_marginRight="@dimen/measurement_tool_text_margin" - android:layout_marginStart="@dimen/measurement_tool_text_margin" + android:layout_marginStart="@dimen/measurement_tool_text_button_padding" + android:layout_marginLeft="@dimen/measurement_tool_text_button_padding" + android:layout_marginTop="@dimen/measurement_tool_button_padding" + android:layout_marginEnd="@dimen/text_margin_small" + android:layout_marginRight="@dimen/text_margin_small" android:layout_toEndOf="@id/main_icon" android:layout_toRightOf="@id/main_icon" android:textAppearance="@style/TextAppearance.ListItemTitle" - tools:text="724 m,"/> + tools:text="724 m," /> + android:layout_alignRight="@id/up_down_button" + android:layout_marginTop="@dimen/measurement_tool_button_padding" + android:textAppearance="@style/TextAppearance.ListItemCategoryTitle" + tools:text="points: 3" /> + android:layout_below="@id/measurement_points_text_view" + android:layout_alignStart="@+id/measurement_distance_text_view" + android:layout_alignLeft="@+id/measurement_distance_text_view" + android:maxLines="1" + android:textColor="?android:textColorSecondary" + android:textSize="@dimen/default_desc_text_size" + tools:text=" – 700 m" /> - + android:layout_height="@dimen/measurement_tool_controls_height_land" + android:layout_weight="0.55" + android:padding="@dimen/content_padding_half"> - - - - - - + android:maxLines="1" + android:padding="@dimen/measurement_tool_text_button_padding_small" + android:text="@string/shared_string_options" + android:textColor="?attr/color_dialog_buttons" + osmand:typeface="@string/font_roboto_medium" /> - - - + android:layout_centerInParent="true"> -