diff --git a/OsmAnd-java/src/main/java/net/osmand/router/RouteExporter.java b/OsmAnd-java/src/main/java/net/osmand/router/RouteExporter.java
index 1ae0568bcb..7ae47d4098 100644
--- a/OsmAnd-java/src/main/java/net/osmand/router/RouteExporter.java
+++ b/OsmAnd-java/src/main/java/net/osmand/router/RouteExporter.java
@@ -1,7 +1,5 @@
package net.osmand.router;
-import net.osmand.GPXUtilities;
-import net.osmand.GPXUtilities.GPXExtensionsWriter;
import net.osmand.GPXUtilities.GPXFile;
import net.osmand.GPXUtilities.RouteSegment;
import net.osmand.GPXUtilities.RouteType;
@@ -12,12 +10,8 @@ import net.osmand.Location;
import net.osmand.binary.BinaryMapRouteReaderAdapter.RouteTypeRule;
import net.osmand.binary.RouteDataBundle;
import net.osmand.binary.StringBundle;
-import net.osmand.binary.StringBundleWriter;
-import net.osmand.binary.StringBundleXmlWriter;
import net.osmand.util.Algorithms;
-import org.xmlpull.v1.XmlSerializer;
-
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
diff --git a/OsmAnd/res/drawable-hdpi/image_text_osmand.png b/OsmAnd/res/drawable-hdpi/image_text_osmand.png
deleted file mode 100644
index a26b0faa2e..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/image_text_osmand.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/image_text_osmand_inapp.png b/OsmAnd/res/drawable-hdpi/image_text_osmand_inapp.png
deleted file mode 100644
index 43866889c8..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/image_text_osmand_inapp.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/image_text_osmand_osmlive.png b/OsmAnd/res/drawable-hdpi/image_text_osmand_osmlive.png
deleted file mode 100644
index f48103258b..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/image_text_osmand_osmlive.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/image_text_osmand_plus.png b/OsmAnd/res/drawable-hdpi/image_text_osmand_plus.png
deleted file mode 100644
index 4d8e665d1b..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/image_text_osmand_plus.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/image_text_osmand_plus_osmlive.png b/OsmAnd/res/drawable-hdpi/image_text_osmand_plus_osmlive.png
deleted file mode 100644
index 6adccd5a60..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/image_text_osmand_plus_osmlive.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/image_text_osmand.png b/OsmAnd/res/drawable-mdpi/image_text_osmand.png
deleted file mode 100644
index a841937deb..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/image_text_osmand.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/image_text_osmand_inapp.png b/OsmAnd/res/drawable-mdpi/image_text_osmand_inapp.png
deleted file mode 100644
index 470f1cb49f..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/image_text_osmand_inapp.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/image_text_osmand_osmlive.png b/OsmAnd/res/drawable-mdpi/image_text_osmand_osmlive.png
deleted file mode 100644
index fcd0191440..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/image_text_osmand_osmlive.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/image_text_osmand_plus.png b/OsmAnd/res/drawable-mdpi/image_text_osmand_plus.png
deleted file mode 100644
index 16b7a91f45..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/image_text_osmand_plus.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/image_text_osmand_plus_osmlive.png b/OsmAnd/res/drawable-mdpi/image_text_osmand_plus_osmlive.png
deleted file mode 100644
index c4a80b7a2b..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/image_text_osmand_plus_osmlive.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-v21/purchase_dialog_outline_btn_bg_dark.xml b/OsmAnd/res/drawable-v21/purchase_dialog_outline_btn_bg_dark.xml
new file mode 100644
index 0000000000..e0e60ea3ad
--- /dev/null
+++ b/OsmAnd/res/drawable-v21/purchase_dialog_outline_btn_bg_dark.xml
@@ -0,0 +1,21 @@
+
+
+ -
+
+
+
+
+
+
+ -
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/drawable-v21/purchase_dialog_outline_btn_bg_light.xml b/OsmAnd/res/drawable-v21/purchase_dialog_outline_btn_bg_light.xml
new file mode 100644
index 0000000000..a607fc4dce
--- /dev/null
+++ b/OsmAnd/res/drawable-v21/purchase_dialog_outline_btn_bg_light.xml
@@ -0,0 +1,21 @@
+
+
+ -
+
+
+
+
+
+
+ -
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/drawable-xhdpi/image_text_osmand.png b/OsmAnd/res/drawable-xhdpi/image_text_osmand.png
deleted file mode 100644
index c03b0e1574..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/image_text_osmand.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/image_text_osmand_inapp.png b/OsmAnd/res/drawable-xhdpi/image_text_osmand_inapp.png
deleted file mode 100644
index 1ffb1674d8..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/image_text_osmand_inapp.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/image_text_osmand_osmlive.png b/OsmAnd/res/drawable-xhdpi/image_text_osmand_osmlive.png
deleted file mode 100644
index 350ca9c70f..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/image_text_osmand_osmlive.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/image_text_osmand_plus.png b/OsmAnd/res/drawable-xhdpi/image_text_osmand_plus.png
deleted file mode 100644
index 41fb71a2d1..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/image_text_osmand_plus.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/image_text_osmand_plus_osmlive.png b/OsmAnd/res/drawable-xhdpi/image_text_osmand_plus_osmlive.png
deleted file mode 100644
index f1ed21bb04..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/image_text_osmand_plus_osmlive.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/image_text_osmand.png b/OsmAnd/res/drawable-xxhdpi/image_text_osmand.png
deleted file mode 100644
index 69a0ce8383..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/image_text_osmand.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/image_text_osmand_inapp.png b/OsmAnd/res/drawable-xxhdpi/image_text_osmand_inapp.png
deleted file mode 100644
index 0439d756c0..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/image_text_osmand_inapp.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/image_text_osmand_osmlive.png b/OsmAnd/res/drawable-xxhdpi/image_text_osmand_osmlive.png
deleted file mode 100644
index 0d5b99b738..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/image_text_osmand_osmlive.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/image_text_osmand_plus.png b/OsmAnd/res/drawable-xxhdpi/image_text_osmand_plus.png
deleted file mode 100644
index 724321f1ed..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/image_text_osmand_plus.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/image_text_osmand_plus_osmlive.png b/OsmAnd/res/drawable-xxhdpi/image_text_osmand_plus_osmlive.png
deleted file mode 100644
index 85e2130f7f..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/image_text_osmand_plus_osmlive.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxxhdpi/image_text_osmand.png b/OsmAnd/res/drawable-xxxhdpi/image_text_osmand.png
deleted file mode 100644
index 828bcf45e8..0000000000
Binary files a/OsmAnd/res/drawable-xxxhdpi/image_text_osmand.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxxhdpi/image_text_osmand_inapp.png b/OsmAnd/res/drawable-xxxhdpi/image_text_osmand_inapp.png
deleted file mode 100644
index 326fde6a1d..0000000000
Binary files a/OsmAnd/res/drawable-xxxhdpi/image_text_osmand_inapp.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxxhdpi/image_text_osmand_osmlive.png b/OsmAnd/res/drawable-xxxhdpi/image_text_osmand_osmlive.png
deleted file mode 100644
index c9f2bc7c75..0000000000
Binary files a/OsmAnd/res/drawable-xxxhdpi/image_text_osmand_osmlive.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxxhdpi/image_text_osmand_plus.png b/OsmAnd/res/drawable-xxxhdpi/image_text_osmand_plus.png
deleted file mode 100644
index 1201d0ece8..0000000000
Binary files a/OsmAnd/res/drawable-xxxhdpi/image_text_osmand_plus.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxxhdpi/image_text_osmand_plus_osmlive.png b/OsmAnd/res/drawable-xxxhdpi/image_text_osmand_plus_osmlive.png
deleted file mode 100644
index f0300264bd..0000000000
Binary files a/OsmAnd/res/drawable-xxxhdpi/image_text_osmand_plus_osmlive.png and /dev/null differ
diff --git a/OsmAnd/res/drawable/image_text_osmand.xml b/OsmAnd/res/drawable/image_text_osmand.xml
new file mode 100644
index 0000000000..d284864074
--- /dev/null
+++ b/OsmAnd/res/drawable/image_text_osmand.xml
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/OsmAnd/res/drawable/image_text_osmand_inapp.xml b/OsmAnd/res/drawable/image_text_osmand_inapp.xml
new file mode 100644
index 0000000000..b00ae968a7
--- /dev/null
+++ b/OsmAnd/res/drawable/image_text_osmand_inapp.xml
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/OsmAnd/res/drawable/image_text_osmand_osmlive.xml b/OsmAnd/res/drawable/image_text_osmand_osmlive.xml
new file mode 100644
index 0000000000..348469f01f
--- /dev/null
+++ b/OsmAnd/res/drawable/image_text_osmand_osmlive.xml
@@ -0,0 +1,53 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/OsmAnd/res/drawable/image_text_osmand_plus.xml b/OsmAnd/res/drawable/image_text_osmand_plus.xml
new file mode 100644
index 0000000000..a318016dab
--- /dev/null
+++ b/OsmAnd/res/drawable/image_text_osmand_plus.xml
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/OsmAnd/res/drawable/image_text_osmand_plus_osmlive.xml b/OsmAnd/res/drawable/image_text_osmand_plus_osmlive.xml
new file mode 100644
index 0000000000..2eb3f7e9e3
--- /dev/null
+++ b/OsmAnd/res/drawable/image_text_osmand_plus_osmlive.xml
@@ -0,0 +1,54 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/OsmAnd/res/drawable/purchase_dialog_outline_btn_bg_dark.xml b/OsmAnd/res/drawable/purchase_dialog_outline_btn_bg_dark.xml
index 3a35b91f36..90df5478f3 100644
--- a/OsmAnd/res/drawable/purchase_dialog_outline_btn_bg_dark.xml
+++ b/OsmAnd/res/drawable/purchase_dialog_outline_btn_bg_dark.xml
@@ -1,8 +1,16 @@
-
-
-
-
-
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/drawable/purchase_dialog_outline_btn_bg_light.xml b/OsmAnd/res/drawable/purchase_dialog_outline_btn_bg_light.xml
index 8116459637..ee1573b3f1 100644
--- a/OsmAnd/res/drawable/purchase_dialog_outline_btn_bg_light.xml
+++ b/OsmAnd/res/drawable/purchase_dialog_outline_btn_bg_light.xml
@@ -1,8 +1,16 @@
-
-
-
-
-
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
diff --git a/OsmAnd/res/layout-land/fragment_measurement_tool.xml b/OsmAnd/res/layout-land/fragment_measurement_tool.xml
index 710a81682c..3331d72dee 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" />
+ tools:text="724 m," />
+ android:layout_alignRight="@id/up_down_button"
+ android:layout_marginTop="@dimen/bottom_sheet_title_padding_bottom"
+ 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_weight="0.55"
+ android:padding="@dimen/content_padding_half">
-
-
-
-
-
-
+ android:maxLines="1"
+ android:paddingLeft="@dimen/measurement_tool_text_button_padding_small"
+ android:paddingRight="@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">
-
-
+ android:layout_centerVertical="true"
+ android:background="?attr/selectableItemBackground"
+ android:contentDescription="@string/shared_string_undo"
+ android:padding="@dimen/measurement_tool_undo_redo_padding_small"
+ tools:src="@drawable/ic_action_undo_dark" />
-
+
+
+
+
+
-
+ layout="@layout/bottom_sheet_dialog_button" />
+
+ osmand:typeface="@string/font_roboto_medium" />
-
@@ -276,59 +251,48 @@
+ osmand:typeface="@string/font_roboto_medium" />
+ android:layout_height="match_parent" />
-
+ android:layout_toStartOf="@id/add_point_before_after_button"
+ android:layout_toLeftOf="@id/add_point_before_after_button"
+ android:layout_centerVertical="true"
+ layout="@layout/bottom_sheet_dialog_button" />
-
-
+ android:layout_alignParentEnd="true"
+ android:layout_alignParentRight="true"
+ layout="@layout/bottom_sheet_dialog_button" />
+
+
diff --git a/OsmAnd/res/layout-land/map_hud_top.xml b/OsmAnd/res/layout-land/map_hud_top.xml
index d9d17ad27d..7fa9318c92 100644
--- a/OsmAnd/res/layout-land/map_hud_top.xml
+++ b/OsmAnd/res/layout-land/map_hud_top.xml
@@ -536,11 +536,11 @@
+ osmand:srcCompat="@drawable/ic_arrow_back" />
+ android:paddingBottom="@dimen/toolbar_title_padding_bottom"
+ android:paddingTop="@dimen/toolbar_title_padding_top">
@@ -616,7 +616,7 @@
-
+ android:clickable="true"
+ android:focusable="true">
+ android:focusable="true">
+ tools:visibility="visible" />
+ tools:text="points: 3" />
@@ -189,6 +192,7 @@
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:padding="@dimen/measurement_tool_undo_redo_padding_small"
+ android:contentDescription="@string/shared_string_undo"
tools:src="@drawable/ic_action_undo_dark"/>
-
+ layout="@layout/bottom_sheet_dialog_button" />
@@ -232,26 +227,16 @@
android:layout_height="@dimen/measurement_tool_controls_height"
android:visibility="gone">
-
+ layout="@layout/bottom_sheet_dialog_button" />
@@ -291,41 +276,24 @@
android:layout_height="match_parent"
android:layout_weight="1"/>
-
+ layout="@layout/bottom_sheet_dialog_button" />
-
+ layout="@layout/bottom_sheet_dialog_button" />
+
diff --git a/OsmAnd/res/layout/fragment_route_between_points_bottom_sheet_dialog.xml b/OsmAnd/res/layout/fragment_route_between_points_bottom_sheet_dialog.xml
index cc796a9b20..99b4cf41ff 100644
--- a/OsmAnd/res/layout/fragment_route_between_points_bottom_sheet_dialog.xml
+++ b/OsmAnd/res/layout/fragment_route_between_points_bottom_sheet_dialog.xml
@@ -65,23 +65,6 @@
android:textSize="@dimen/default_desc_text_size" />
-
-
-
-
-
\ No newline at end of file
diff --git a/OsmAnd/res/layout/map_hud_bottom.xml b/OsmAnd/res/layout/map_hud_bottom.xml
index 9cfcab6e16..81dc6fbd28 100644
--- a/OsmAnd/res/layout/map_hud_bottom.xml
+++ b/OsmAnd/res/layout/map_hud_bottom.xml
@@ -116,12 +116,13 @@
tools:src="@drawable/ic_action_remove_dark"
android:contentDescription="@string/snap_to_road" />
-
+
diff --git a/OsmAnd/res/layout/map_hud_top.xml b/OsmAnd/res/layout/map_hud_top.xml
index bef39b9539..23eb48df18 100644
--- a/OsmAnd/res/layout/map_hud_top.xml
+++ b/OsmAnd/res/layout/map_hud_top.xml
@@ -210,8 +210,8 @@
android:layout_marginLeft="@dimen/map_button_margin"
android:layout_marginRight="@dimen/map_button_margin"
tools:src="@drawable/ic_action_remove_dark"
- android:layout_marginStart="@dimen/map_button_margin"
- android:layout_marginEnd="@dimen/map_button_margin" />
+ android:layout_marginStart="@dimen/map_button_margin"
+ android:layout_marginEnd="@dimen/map_button_margin" />
@@ -335,8 +335,8 @@
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:orientation="vertical"
- android:paddingBottom="10dp"
- android:paddingTop="10dp">
+ android:paddingBottom="@dimen/toolbar_title_padding_bottom"
+ android:paddingTop="@dimen/toolbar_title_padding_top">
@@ -402,13 +402,13 @@
@@ -435,8 +435,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
- android:animateLayoutChanges="true"
- android:visibility="gone"/>
+ android:animateLayoutChanges="true"
+ android:visibility="gone"/>
+ android:layout_toEndOf="@+id/map_marker_dist_2nd" />
@@ -781,8 +781,8 @@
android:layout_marginLeft="@dimen/widget_turn_lane_border"
android:layout_marginRight="@dimen/widget_turn_lane_border"
android:layout_marginTop="@dimen/widget_turn_lane_border"
- android:layout_marginStart="@dimen/widget_turn_lane_border"
- android:layout_marginEnd="@dimen/widget_turn_lane_border" />
+ android:layout_marginStart="@dimen/widget_turn_lane_border"
+ android:layout_marginEnd="@dimen/widget_turn_lane_border" />
+ android:layout_marginEnd="@dimen/widget_turn_lane_border"
+ android:layout_marginStart="@dimen/widget_turn_lane_border" />
+ android:layout_marginEnd="@dimen/widget_turn_lane_border"
+ android:layout_marginStart="@dimen/widget_turn_lane_border" />
diff --git a/OsmAnd/res/values-large/sizes.xml b/OsmAnd/res/values-large/sizes.xml
index 02abe48c01..7bb27b3f90 100644
--- a/OsmAnd/res/values-large/sizes.xml
+++ b/OsmAnd/res/values-large/sizes.xml
@@ -80,7 +80,6 @@
12dp
330dp
48dp
- 84dp
18dp
24dp
18dp
diff --git a/OsmAnd/res/values/sizes.xml b/OsmAnd/res/values/sizes.xml
index 8d403a7133..f4eb13a389 100644
--- a/OsmAnd/res/values/sizes.xml
+++ b/OsmAnd/res/values/sizes.xml
@@ -256,7 +256,7 @@
8dp
220dp
60dp
- 56dp
+ 52dp
8dp
16dp
6dp
@@ -268,6 +268,7 @@
8dp
10dp
36dp
+ 98dp
72dp
52dp
44dp
@@ -352,6 +353,8 @@
96dp
72dp
54dp
+ 7dp
+ 6dp
36dp
80dp
diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml
index 61c159f342..0ef0445fe2 100644
--- a/OsmAnd/res/values/strings.xml
+++ b/OsmAnd/res/values/strings.xml
@@ -16,6 +16,7 @@
Click button to start server
Click second button to deactivate server
Web server
+ Redo
Please add at least two points.
is saved
Open saved track
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 9506fac030..d1096c74c4 100644
--- a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java
+++ b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java
@@ -383,7 +383,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/activities/SettingsNavigationActivity.java b/OsmAnd/src/net/osmand/plus/activities/SettingsNavigationActivity.java
index 3f0ba10d29..260fd63719 100644
--- a/OsmAnd/src/net/osmand/plus/activities/SettingsNavigationActivity.java
+++ b/OsmAnd/src/net/osmand/plus/activities/SettingsNavigationActivity.java
@@ -165,33 +165,34 @@ public class SettingsNavigationActivity extends SettingsBaseActivity {
registerListPreference(settings.ARRIVAL_DISTANCE_FACTOR, screen, arrivalNames, arrivalValues);
+ //array size must be equal!
+ Float[] speedLimitsKmh = new Float[]{-10f, -7f, -5f, 0f, 5f, 7f, 10f, 15f, 20f};
+ Float[] speedLimitsMph = new Float[]{-7f, -5f, -3f, 0f, 3f, 5f, 7f, 10f, 15f};
+ //array size must be equal!
+ Float[] speedLimitsKmhPos = new Float[]{0f, 5f, 7f, 10f, 15f, 20f};
+ Float[] speedLimitsMphPos = new Float[]{0f, 3f, 5f, 7f, 10f, 15f};
if (settings.METRIC_SYSTEM.get() == OsmandSettings.MetricsConstants.KILOMETERS_AND_METERS) {
- Float[] speedLimitsKm = new Float[]{-10f, -7f, -5f, 0f, 5f, 7f, 10f, 15f, 20f};
- Float[] speedLimitsKmPos = new Float[]{0f, 5f, 7f, 10f, 15f, 20f};
- String[] speedNames = new String[speedLimitsKm.length];
- String[] speedNamesPos = new String[speedLimitsKmPos.length];
- for (int i = 0; i < speedLimitsKm.length; i++) {
- speedNames[i] = speedLimitsKm[i].intValue() + " " + getString(R.string.km_h);
+ String[] speedNames = new String[speedLimitsKmh.length];
+ String[] speedNamesPos = new String[speedLimitsKmhPos.length];
+ for (int i = 0; i < speedLimitsKmh.length; i++) {
+ speedNames[i] = speedLimitsKmh[i].intValue() + " " + getString(R.string.km_h);
}
- for (int i = 0; i < speedLimitsKmPos.length; i++) {
- speedNamesPos[i] = speedLimitsKmPos[i].intValue() + " " + getString(R.string.km_h);
+ for (int i = 0; i < speedLimitsKmhPos.length; i++) {
+ speedNamesPos[i] = speedLimitsKmhPos[i].intValue() + " " + getString(R.string.km_h);
}
- registerListPreference(settings.SPEED_LIMIT_EXCEED, screen, speedNames, speedLimitsKm);
- registerListPreference(settings.SWITCH_MAP_DIRECTION_TO_COMPASS, screen, speedNamesPos, speedLimitsKmPos);
+ registerListPreference(settings.SPEED_LIMIT_EXCEED_KMH, screen, speedNames, speedLimitsKmh);
+ registerListPreference(settings.SWITCH_MAP_DIRECTION_TO_COMPASS_KMH, screen, speedNamesPos, speedLimitsKmhPos);
} else {
- Float[] speedLimitsMiles = new Float[]{-7f, -5f, -3f, 0f, 3f, 5f, 7f, 10f, 15f};
- Float[] speedLimitsMilesPos = new Float[]{0f, 3f, 5f, 7f, 10f, 15f};
-
- String[] speedNames = new String[speedLimitsMiles.length];
+ String[] speedNames = new String[speedLimitsMph.length];
+ String[] speedNamesPos = new String[speedLimitsMphPos.length];
for (int i = 0; i < speedNames.length; i++) {
- speedNames[i] = speedLimitsMiles[i].intValue() + " " + getString(R.string.mile_per_hour);
+ speedNames[i] = speedLimitsMph[i].intValue() + " " + getString(R.string.mile_per_hour);
}
- String[] speedNamesPos = new String[speedLimitsMilesPos.length];
for (int i = 0; i < speedNamesPos.length; i++) {
- speedNamesPos[i] = speedLimitsMiles[i].intValue() + " " + getString(R.string.mile_per_hour);
+ speedNamesPos[i] = speedLimitsMphPos[i].intValue() + " " + getString(R.string.mile_per_hour);
}
- registerListPreference(settings.SPEED_LIMIT_EXCEED, screen, speedNames, speedLimitsMiles);
- registerListPreference(settings.SWITCH_MAP_DIRECTION_TO_COMPASS, screen, speedNamesPos, speedLimitsMilesPos);
+ registerListPreference(settings.SPEED_LIMIT_EXCEED_KMH, screen, speedNames, speedLimitsKmh);
+ registerListPreference(settings.SWITCH_MAP_DIRECTION_TO_COMPASS_KMH, screen, speedNamesPos, speedLimitsKmhPos);
}
PreferenceCategory category = (PreferenceCategory) screen.findPreference("guidance_preferences");
diff --git a/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java b/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java
index e57d86139a..4f2c3fa11f 100644
--- a/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java
+++ b/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java
@@ -659,8 +659,8 @@ public class AudioVideoNotesPlugin extends OsmandPlugin {
@Override
public void registerMapContextMenuActions(final MapActivity mapActivity, final double latitude, final double longitude,
- ContextMenuAdapter adapter, Object selectedObj) {
- if (isRecording()) {
+ ContextMenuAdapter adapter, Object selectedObj, boolean configureMenu) {
+ if (!configureMenu && isRecording()) {
return;
}
adapter.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.recording_context_menu_arecord, app)
diff --git a/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java b/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java
index e04bb51559..601fb62909 100644
--- a/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java
+++ b/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java
@@ -128,7 +128,7 @@ public class MapViewTrackingUtilities implements OsmAndLocationListener, IMapLoc
headingChanged = Math.abs(MapUtils.degreesDiff(prevHeading, heading)) > 1.0;
}
if (mapView != null) {
- float speedForDirectionOfMovement = settings.SWITCH_MAP_DIRECTION_TO_COMPASS.get()/3.6f;
+ float speedForDirectionOfMovement = settings.SWITCH_MAP_DIRECTION_TO_COMPASS_KMH.get()/3.6f;
boolean smallSpeedForDirectionOfMovement = speedForDirectionOfMovement != 0 &&
myLocation != null && isSmallSpeedForDirectionOfMovement(myLocation, speedForDirectionOfMovement);
if ((settings.ROTATE_MAP.get() == OsmandSettings.ROTATE_MAP_COMPASS || (settings.ROTATE_MAP.get() == OsmandSettings.ROTATE_MAP_BEARING && smallSpeedForDirectionOfMovement)) && !routePlanningMode) {
@@ -187,7 +187,7 @@ public class MapViewTrackingUtilities implements OsmAndLocationListener, IMapLoc
zoom = autozoom(tb, location);
}
int currentMapRotation = settings.ROTATE_MAP.get();
- float speedForDirectionOfMovement = settings.SWITCH_MAP_DIRECTION_TO_COMPASS.get()/3.6f;
+ float speedForDirectionOfMovement = settings.SWITCH_MAP_DIRECTION_TO_COMPASS_KMH.get()/3.6f;
boolean smallSpeedForDirectionOfMovement = speedForDirectionOfMovement != 0
&& isSmallSpeedForDirectionOfMovement(location, speedForDirectionOfMovement);
boolean smallSpeedForCompass = isSmallSpeedForCompass(location);
diff --git a/OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java b/OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java
index 726475cdc7..647eebeb4c 100644
--- a/OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java
+++ b/OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java
@@ -603,7 +603,7 @@ public class ConfigureMapMenu {
}
}
- public static String[] mapNamesIds = new String[]{"", "en", "af", "als", "ar", "az", "be", "ber", "bg", "bn", "bpy", "br", "bs", "ca", "ceb", "cs", "cy", "da", "de", "el", "eo", "es", "et", "eu", "fa", "fi", "fr", "fy", "ga", "gl", "he", "hi", "hsb", "hr", "ht", "hu", "hy", "id", "is", "it", "ja", "ka", "kab", "ko", "ku", "la", "lb", "lo", "lt", "lv", "mk", "ml", "mr", "ms", "nds", "new", "nl", "nn", "no", "nv", "oc", "os", "pl", "pms", "pt", "ro", "ru", "sc", "sh", "sk", "sl", "sq", "sr", "sv", "sw", "ta", "te", "th", "tl", "tr", "uk", "vi", "vo", "zh"};
+ public static String[] mapNamesIds = new String[]{"", "en", "af", "als", "ar", "az", "be", "ber", "bg", "bn", "bpy", "br", "bs", "ca", "ceb", "cs", "cy", "da", "de", "el", "eo", "es", "et", "eu", "fa", "fi", "fr", "fy", "ga", "gl", "he", "hi", "hsb", "hr", "ht", "hu", "hy", "id", "is", "it", "ja", "ka", "kab", "kn", "ko", "ku", "la", "lb", "lo", "lt", "lv", "mk", "ml", "mr", "ms", "nds", "new", "nl", "nn", "no", "nv", "oc", "os", "pl", "pms", "pt", "ro", "ru", "sc", "sh", "sk", "sl", "sq", "sr", "sv", "sw", "ta", "te", "th", "tl", "tr", "uk", "vi", "vo", "zh"};
public static String[] getSortedMapNamesIds(Context ctx, String[] ids, String[] values) {
final Map mp = new HashMap<>();
@@ -1140,4 +1140,4 @@ public class ConfigureMapMenu {
label.setTextColor(ContextCompat.getColorStateList(getContext(), colorId));
}
}
-}
\ No newline at end of file
+}
diff --git a/OsmAnd/src/net/osmand/plus/helpers/WaypointHelper.java b/OsmAnd/src/net/osmand/plus/helpers/WaypointHelper.java
index 8dbfb93a78..b143653754 100644
--- a/OsmAnd/src/net/osmand/plus/helpers/WaypointHelper.java
+++ b/OsmAnd/src/net/osmand/plus/helpers/WaypointHelper.java
@@ -196,7 +196,7 @@ public class WaypointHelper {
public AlarmInfo getMostImportantAlarm(OsmandSettings.SpeedConstants sc, boolean showCameras) {
Location lastProjection = app.getRoutingHelper().getLastProjection();
float mxspeed = route.getCurrentMaxSpeed();
- float delta = app.getSettings().SPEED_LIMIT_EXCEED.get() / 3.6f;
+ float delta = app.getSettings().SPEED_LIMIT_EXCEED_KMH.get() / 3.6f;
AlarmInfo speedAlarm = createSpeedAlarm(sc, mxspeed, lastProjection, delta);
if (speedAlarm != null) {
getVoiceRouter().announceSpeedAlarm(speedAlarm.getIntValue(), lastProjection.getSpeed());
@@ -293,7 +293,7 @@ public class WaypointHelper {
public AlarmInfo calculateMostImportantAlarm(RouteDataObject ro, Location loc, MetricsConstants mc,
OsmandSettings.SpeedConstants sc, boolean showCameras) {
float mxspeed = ro.getMaximumSpeed(ro.bearingVsRouteDirection(loc));
- float delta = app.getSettings().SPEED_LIMIT_EXCEED.get() / 3.6f;
+ float delta = app.getSettings().SPEED_LIMIT_EXCEED_KMH.get() / 3.6f;
AlarmInfo speedAlarm = createSpeedAlarm(sc, mxspeed, loc, delta);
if (speedAlarm != null) {
getVoiceRouter().announceSpeedAlarm(speedAlarm.getIntValue(), loc.getSpeed());
diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java
index cec7234a7e..a554d06a4d 100644
--- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java
+++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java
@@ -1070,8 +1070,7 @@ public class MapContextMenu extends MenuTitleController implements StateChangedL
for (OsmandMapLayer layer : mapActivity.getMapView().getLayers()) {
layer.populateObjectContextMenu(latLon, getObject(), menuAdapter, mapActivity);
}
- mapActivity.getMapActions().addActionsToAdapter(configure ? 0 : latLon.getLatitude(), configure ? 0 : latLon.getLongitude(), menuAdapter, getObject(), configure);
- }
+ mapActivity.getMapActions().addActionsToAdapter(configure ? 0 : latLon.getLatitude(), configure ? 0 : latLon.getLongitude(), menuAdapter, configure ? null : getObject(), configure); }
return menuAdapter;
}
diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/PointEditorFragmentNew.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/PointEditorFragmentNew.java
index 4cf98456be..813aa9a0de 100644
--- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/PointEditorFragmentNew.java
+++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/PointEditorFragmentNew.java
@@ -46,6 +46,7 @@ import net.osmand.plus.R;
import net.osmand.plus.UiUtilities;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.base.BaseOsmAndFragment;
+import net.osmand.plus.helpers.AndroidUiHelper;
import net.osmand.plus.helpers.ColorDialogs;
import net.osmand.plus.mapcontextmenu.other.HorizontalSelectionAdapter;
import net.osmand.plus.widgets.FlowLayout;
@@ -726,6 +727,7 @@ public abstract class PointEditorFragmentNew extends BaseOsmAndFragment {
public void setCategory(String name, int color) {
setSelectedItemWithScroll(name);
updateColorSelector(color, groupRecyclerView.getRootView());
+ AndroidUiHelper.updateVisibility(addToHiddenGroupInfo, !isCategoryVisible(name));
}
private void setSelectedItemWithScroll(String name) {
@@ -952,7 +954,7 @@ public abstract class PointEditorFragmentNew extends BaseOsmAndFragment {
int previousSelectedPosition = getItemPosition(selectedItemName);
selectedItemName = items.get(holder.getAdapterPosition());
updateColorSelector(getCategoryColor(selectedItemName), groupRecyclerView.getRootView());
- addToHiddenGroupInfo.setVisibility(isCategoryVisible(selectedItemName) ? View.GONE : View.VISIBLE);
+ AndroidUiHelper.updateVisibility(addToHiddenGroupInfo, !isCategoryVisible(selectedItemName));
notifyItemChanged(holder.getAdapterPosition());
notifyItemChanged(previousSelectedPosition);
}
diff --git a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementEditingContext.java b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementEditingContext.java
index 39a5bca3ce..88ec9f7975 100644
--- a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementEditingContext.java
+++ b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementEditingContext.java
@@ -731,8 +731,15 @@ public class MeasurementEditingContext {
Pair pair = new Pair<>(before.points.get(i), before.points.get(i + 1));
RoadSegmentData data = this.roadSegmentData.get(pair);
if (data != null) {
- LocationsHolder locationsHolder = new LocationsHolder(data.points);
- locations.addAll(locationsHolder.getLocationsList());
+ for (WptPt pt : data.points) {
+ Location l = new Location("");
+ l.setLatitude(pt.getLatitude());
+ l.setLongitude(pt.getLongitude());
+ if (!Double.isNaN(pt.ele)) {
+ l.setAltitude(pt.ele);
+ }
+ locations.add(l);
+ }
pair.second.setTrkPtIndex(locations.size() - 1);
if (i < size - 2) {
locations.remove(locations.size() - 1);
diff --git a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java
index a41408098e..3bbc3214d1 100644
--- a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java
+++ b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java
@@ -275,21 +275,31 @@ public class MeasurementToolFragment extends BaseOsmAndFragment implements Route
}
});
- mainView.findViewById(R.id.apply_move_point_button).setOnClickListener(new OnClickListener() {
+ View applyMovePointButton = mainView.findViewById(R.id.apply_move_point_button);
+ UiUtilities.setupDialogButton(nightMode, applyMovePointButton, UiUtilities.DialogButtonType.PRIMARY,
+ R.string.shared_string_apply);
+ applyMovePointButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
applyMovePointMode();
}
});
- mainView.findViewById(R.id.apply_point_before_after_point_button).setOnClickListener(new OnClickListener() {
+
+ View applyPointBeforeAfterButton = mainView.findViewById(R.id.apply_point_before_after_point_button);
+ UiUtilities.setupDialogButton(nightMode, applyPointBeforeAfterButton, UiUtilities.DialogButtonType.PRIMARY,
+ R.string.shared_string_apply);
+ applyPointBeforeAfterButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
applyAddPointBeforeAfterMode();
}
});
- mainView.findViewById(R.id.add_point_before_after_button).setOnClickListener(new OnClickListener() {
+ View addPointBeforeAfterButton = mainView.findViewById(R.id.add_point_before_after_button);
+ UiUtilities.setupDialogButton(nightMode, addPointBeforeAfterButton, UiUtilities.DialogButtonType.PRIMARY,
+ R.string.shared_string_add);
+ addPointBeforeAfterButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
addPointBeforeAfter();
@@ -334,7 +344,10 @@ public class MeasurementToolFragment extends BaseOsmAndFragment implements Route
}
});
- mainView.findViewById(R.id.add_point_button).setOnClickListener(new OnClickListener() {
+ View addPointButton = mainView.findViewById(R.id.add_point_button);
+ UiUtilities.setupDialogButton(nightMode, addPointButton, UiUtilities.DialogButtonType.PRIMARY,
+ R.string.shared_string_add);
+ addPointButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
addCenterPoint();
@@ -2039,8 +2052,8 @@ public class MeasurementToolFragment extends BaseOsmAndFragment implements Route
int paddingH = ctx.getResources().getDimensionPixelSize(R.dimen.context_menu_padding_margin_large);
int paddingV = ctx.getResources().getDimensionPixelSize(R.dimen.context_menu_padding_margin_small);
done.setPadding(paddingH, paddingV, paddingH, paddingV);
- AndroidUtils.setBackground(ctx, done, nightMode, R.drawable.dlg_btn_stroked_light,
- R.drawable.dlg_btn_stroked_dark);
+ AndroidUtils.setBackground(ctx, done, nightMode, R.drawable.purchase_dialog_outline_btn_bg_light,
+ R.drawable.purchase_dialog_outline_btn_bg_dark);
}
@Override
diff --git a/OsmAnd/src/net/osmand/plus/measurementtool/OptionsBottomSheetDialogFragment.java b/OsmAnd/src/net/osmand/plus/measurementtool/OptionsBottomSheetDialogFragment.java
index 93fecb7c33..6cfbcf8f3f 100644
--- a/OsmAnd/src/net/osmand/plus/measurementtool/OptionsBottomSheetDialogFragment.java
+++ b/OsmAnd/src/net/osmand/plus/measurementtool/OptionsBottomSheetDialogFragment.java
@@ -121,7 +121,7 @@ public class OptionsBottomSheetDialogFragment extends MenuBottomSheetDialogFragm
BaseBottomSheetItem directions = new SimpleBottomSheetItem.Builder()
.setIcon(getContentIcon(R.drawable.ic_action_gdirections_dark))
.setTitle(getString(R.string.get_directions))
- .setLayoutId(R.layout.bottom_sheet_item_simple)
+ .setLayoutId(R.layout.bottom_sheet_item_simple_pad_32dp)
.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
@@ -138,7 +138,7 @@ public class OptionsBottomSheetDialogFragment extends MenuBottomSheetDialogFragm
BaseBottomSheetItem reverse = new SimpleBottomSheetItem.Builder()
.setIcon(getContentIcon(R.drawable.ic_action_change_navigation_points))
.setTitle(getString(R.string.reverse_route))
- .setLayoutId(R.layout.bottom_sheet_item_simple)
+ .setLayoutId(R.layout.bottom_sheet_item_simple_pad_32dp)
.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
diff --git a/OsmAnd/src/net/osmand/plus/measurementtool/RouteBetweenPointsBottomSheetDialogFragment.java b/OsmAnd/src/net/osmand/plus/measurementtool/RouteBetweenPointsBottomSheetDialogFragment.java
index 1cad5b12aa..f57cbd4e04 100644
--- a/OsmAnd/src/net/osmand/plus/measurementtool/RouteBetweenPointsBottomSheetDialogFragment.java
+++ b/OsmAnd/src/net/osmand/plus/measurementtool/RouteBetweenPointsBottomSheetDialogFragment.java
@@ -1,31 +1,24 @@
package net.osmand.plus.measurementtool;
-import android.app.Dialog;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
-import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
-import android.view.Window;
-import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RadioButton;
import android.widget.TextView;
import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
-import androidx.fragment.app.FragmentActivity;
import androidx.fragment.app.FragmentManager;
-import net.osmand.AndroidUtils;
import net.osmand.PlatformUtil;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
import net.osmand.plus.UiUtilities;
-import net.osmand.plus.base.BottomSheetDialogFragment;
-import net.osmand.plus.helpers.AndroidUiHelper;
+import net.osmand.plus.base.MenuBottomSheetDialogFragment;
+import net.osmand.plus.base.bottomsheetmenu.BaseBottomSheetItem;
import net.osmand.plus.settings.backend.ApplicationMode;
import org.apache.commons.logging.Log;
@@ -37,7 +30,7 @@ import static net.osmand.plus.UiUtilities.CustomRadioButtonType.LEFT;
import static net.osmand.plus.UiUtilities.CustomRadioButtonType.RIGHT;
import static net.osmand.plus.measurementtool.MeasurementEditingContext.DEFAULT_APP_MODE;
-public class RouteBetweenPointsBottomSheetDialogFragment extends BottomSheetDialogFragment {
+public class RouteBetweenPointsBottomSheetDialogFragment extends MenuBottomSheetDialogFragment {
private static final Log LOG = PlatformUtil.getLog(RouteBetweenPointsBottomSheetDialogFragment.class);
public static final String TAG = RouteBetweenPointsBottomSheetDialogFragment.class.getSimpleName();
@@ -47,7 +40,6 @@ public class RouteBetweenPointsBottomSheetDialogFragment extends BottomSheetDial
public static final String ROUTE_APP_MODE_KEY = "route_app_mode";
private boolean nightMode;
- private boolean portrait;
private TextView btnDescription;
private RouteBetweenPointsDialogType dialogType = RouteBetweenPointsDialogType.WHOLE_ROUTE_CALCULATION;
private RouteBetweenPointsDialogMode defaultDialogMode = RouteBetweenPointsDialogMode.SINGLE;
@@ -66,95 +58,6 @@ public class RouteBetweenPointsBottomSheetDialogFragment extends BottomSheetDial
ALL,
}
- @Nullable
- @Override
- public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
- Bundle args = getArguments();
- if (args != null) {
- appMode = ApplicationMode.valueOfStringKey(args.getString(ROUTE_APP_MODE_KEY), null);
- dialogType = (RouteBetweenPointsDialogType) args.get(DIALOG_TYPE_KEY);
- defaultDialogMode = (RouteBetweenPointsDialogMode) args.get(DEFAULT_DIALOG_MODE_KEY);
- }
- if (savedInstanceState != null) {
- dialogType = (RouteBetweenPointsDialogType) savedInstanceState.get(DIALOG_TYPE_KEY);
- defaultDialogMode = (RouteBetweenPointsDialogMode) savedInstanceState.get(DEFAULT_DIALOG_MODE_KEY);
- }
- OsmandApplication app = requiredMyApplication();
- nightMode = app.getDaynightHelper().isNightModeForMapControls();
- FragmentActivity activity = requireActivity();
- portrait = AndroidUiHelper.isOrientationPortrait(activity);
- final View mainView = UiUtilities.getInflater(getContext(), nightMode)
- .inflate(R.layout.fragment_route_between_points_bottom_sheet_dialog,
- container, false);
- AndroidUtils.setBackground(activity, mainView, nightMode,
- portrait ? R.drawable.bg_bottom_menu_light : R.drawable.bg_bottom_sheet_topsides_landscape_light,
- portrait ? R.drawable.bg_bottom_menu_dark : R.drawable.bg_bottom_sheet_topsides_landscape_dark);
-
- View cancelButton = mainView.findViewById(R.id.dismiss_button);
- UiUtilities.setupDialogButton(nightMode, cancelButton, UiUtilities.DialogButtonType.SECONDARY,
- R.string.shared_string_close);
- mainView.findViewById(R.id.dismiss_button).setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- dismiss();
- }
- });
-
- customRadioButton = mainView.findViewById(R.id.custom_radio_buttons);
- TextView singleModeButton = mainView.findViewById(R.id.left_button);
- singleModeButton.setText(getButtonText(RouteBetweenPointsDialogMode.SINGLE));
- TextView allModeButton = mainView.findViewById(R.id.right_button);
- allModeButton.setText(getButtonText(RouteBetweenPointsDialogMode.ALL));
- btnDescription = mainView.findViewById(R.id.button_description);
-
- LinearLayout navigationType = mainView.findViewById(R.id.navigation_types_container);
- final List modes = new ArrayList<>(ApplicationMode.values(app));
- modes.remove(ApplicationMode.DEFAULT);
-
- View.OnClickListener onClickListener = new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- ApplicationMode mode = DEFAULT_APP_MODE;
- if ((int) view.getTag() != STRAIGHT_LINE_TAG) {
- mode = modes.get((int) view.getTag());
- }
- Fragment fragment = getTargetFragment();
- if (fragment instanceof RouteBetweenPointsFragmentListener) {
- ((RouteBetweenPointsFragmentListener) fragment).onChangeApplicationMode(mode, dialogType, defaultDialogMode);
- }
- dismiss();
- }
- };
-
- Drawable icon = app.getUIUtilities().getIcon(R.drawable.ic_action_split_interval, nightMode);
- addProfileView(navigationType, onClickListener, STRAIGHT_LINE_TAG, icon,
- app.getText(R.string.routing_profile_straightline), appMode == DEFAULT_APP_MODE);
- addDelimiterView(navigationType);
-
- for (int i = 0; i < modes.size(); i++) {
- ApplicationMode mode = modes.get(i);
- if (!"public_transport".equals(mode.getRoutingProfile())) {
- icon = app.getUIUtilities().getIcon(mode.getIconRes(), mode.getIconColorInfo().getColor(nightMode));
- addProfileView(navigationType, onClickListener, i, icon, mode.toHumanString(), mode.equals(appMode));
- }
- }
-
- singleModeButton.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- setDefaultDialogMode(RouteBetweenPointsDialogMode.SINGLE);
- }
- });
- allModeButton.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- setDefaultDialogMode(RouteBetweenPointsDialogMode.ALL);
- }
- });
- updateModeButtons();
- return mainView;
- }
-
private String getButtonText(RouteBetweenPointsDialogMode dialogMode) {
switch (dialogType) {
case WHOLE_ROUTE_CALCULATION:
@@ -251,17 +154,80 @@ public class RouteBetweenPointsBottomSheetDialogFragment extends BottomSheetDial
}
@Override
- public void onStart() {
- super.onStart();
- if (!portrait) {
- Dialog dialog = getDialog();
- if (dialog != null && dialog.getWindow() != null) {
- Window window = dialog.getWindow();
- WindowManager.LayoutParams params = window.getAttributes();
- params.width = dialog.getContext().getResources().getDimensionPixelSize(R.dimen.landscape_bottom_sheet_dialog_fragment_width);
- window.setAttributes(params);
+ public void createMenuItems(Bundle savedInstanceState) {
+ Bundle args = getArguments();
+ if (args != null) {
+ appMode = ApplicationMode.valueOfStringKey(args.getString(ROUTE_APP_MODE_KEY), null);
+ dialogType = (RouteBetweenPointsDialogType) args.get(DIALOG_TYPE_KEY);
+ defaultDialogMode = (RouteBetweenPointsDialogMode) args.get(DEFAULT_DIALOG_MODE_KEY);
+ }
+ if (savedInstanceState != null) {
+ dialogType = (RouteBetweenPointsDialogType) savedInstanceState.get(DIALOG_TYPE_KEY);
+ defaultDialogMode = (RouteBetweenPointsDialogMode) savedInstanceState.get(DEFAULT_DIALOG_MODE_KEY);
+ }
+ OsmandApplication app = requiredMyApplication();
+ nightMode = app.getDaynightHelper().isNightModeForMapControls();
+ final View mainView = UiUtilities.getInflater(getContext(), nightMode)
+ .inflate(R.layout.fragment_route_between_points_bottom_sheet_dialog,
+ null, false);
+ customRadioButton = mainView.findViewById(R.id.custom_radio_buttons);
+ TextView singleModeButton = mainView.findViewById(R.id.left_button);
+ singleModeButton.setText(getButtonText(RouteBetweenPointsDialogMode.SINGLE));
+ TextView allModeButton = mainView.findViewById(R.id.right_button);
+ allModeButton.setText(getButtonText(RouteBetweenPointsDialogMode.ALL));
+ btnDescription = mainView.findViewById(R.id.button_description);
+
+ LinearLayout navigationType = mainView.findViewById(R.id.navigation_types_container);
+ final List modes = new ArrayList<>(ApplicationMode.values(app));
+ modes.remove(ApplicationMode.DEFAULT);
+
+ View.OnClickListener onClickListener = new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ ApplicationMode mode = DEFAULT_APP_MODE;
+ if ((int) view.getTag() != STRAIGHT_LINE_TAG) {
+ mode = modes.get((int) view.getTag());
+ }
+ Fragment fragment = getTargetFragment();
+ if (fragment instanceof RouteBetweenPointsFragmentListener) {
+ ((RouteBetweenPointsFragmentListener) fragment).onChangeApplicationMode(mode, dialogType, defaultDialogMode);
+ }
+ dismiss();
+ }
+ };
+
+ Drawable icon = app.getUIUtilities().getIcon(R.drawable.ic_action_split_interval, nightMode);
+ addProfileView(navigationType, onClickListener, STRAIGHT_LINE_TAG, icon,
+ app.getText(R.string.routing_profile_straightline), appMode == DEFAULT_APP_MODE);
+ addDelimiterView(navigationType);
+
+ for (int i = 0; i < modes.size(); i++) {
+ ApplicationMode mode = modes.get(i);
+ if (!"public_transport".equals(mode.getRoutingProfile())) {
+ icon = app.getUIUtilities().getIcon(mode.getIconRes(), mode.getIconColorInfo().getColor(nightMode));
+ addProfileView(navigationType, onClickListener, i, icon, mode.toHumanString(), mode.equals(appMode));
}
}
+
+ singleModeButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ setDefaultDialogMode(RouteBetweenPointsDialogMode.SINGLE);
+ }
+ });
+ allModeButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ setDefaultDialogMode(RouteBetweenPointsDialogMode.ALL);
+ }
+ });
+ updateModeButtons();
+ items.add(new BaseBottomSheetItem.Builder().setCustomView(mainView).create());
+ }
+
+ @Override
+ protected int getDismissButtonTextId() {
+ return R.string.shared_string_close;
}
@Override
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..e40a911027 100644
--- a/OsmAnd/src/net/osmand/plus/rastermaps/OsmandRasterMapsPlugin.java
+++ b/OsmAnd/src/net/osmand/plus/rastermaps/OsmandRasterMapsPlugin.java
@@ -400,37 +400,45 @@ public class OsmandRasterMapsPlugin extends OsmandPlugin {
@Override
public void registerMapContextMenuActions(MapActivity mapActivity,
final double latitude, final double longitude,
- ContextMenuAdapter adapter, Object selectedObj) {
- final WeakReference mapActivityRef = new WeakReference<>(mapActivity);
- if (mapActivity.getMapView().getMainLayer() instanceof MapTileLayer) {
- ItemClickListener listener = new ContextMenuAdapter.ItemClickListener() {
- @Override
- public boolean onContextMenuClick(ArrayAdapter adapter, int resId, int pos, boolean isChecked, int[] viewCoordinates) {
- MapActivity mapActivity = mapActivityRef.get();
- if (mapActivity != null && !mapActivity.isFinishing()) {
- OsmandMapTileView mapView = mapActivity.getMapView();
- if (resId == R.string.context_menu_item_update_map) {
- mapActivity.getMapActions().reloadTile(mapView.getZoom(), latitude, longitude);
- } else if (resId == R.string.shared_string_download_map) {
- DownloadTilesDialog dlg = new DownloadTilesDialog(mapActivity, (OsmandApplication) mapActivity.getApplication(), mapView);
- dlg.openDialog();
- }
- }
- return true;
- }
- };
- adapter.addItem(new ContextMenuItem.ItemBuilder()
+ ContextMenuAdapter adapter, Object selectedObj, boolean configureMenu) {
+ boolean mapTileLayer = mapActivity.getMapView().getMainLayer() instanceof MapTileLayer;
+ if (configureMenu || mapTileLayer) {
+ ContextMenuItem.ItemBuilder updateMapItemBuilder = new ContextMenuItem.ItemBuilder()
.setTitleId(R.string.context_menu_item_update_map, mapActivity)
.setId(MAP_CONTEXT_MENU_UPDATE_MAP)
.setIcon(R.drawable.ic_action_refresh_dark)
- .setOrder(UPDATE_MAP_ITEM_ORDER)
- .setListener(listener).createItem());
- adapter.addItem(new ContextMenuItem.ItemBuilder()
+ .setOrder(UPDATE_MAP_ITEM_ORDER);
+
+ ContextMenuItem.ItemBuilder downloadMapItemBuilder = new ContextMenuItem.ItemBuilder()
.setTitleId(R.string.shared_string_download_map, mapActivity)
.setId(MAP_CONTEXT_MENU_DOWNLOAD_MAP)
.setIcon(R.drawable.ic_action_import)
- .setOrder(DOWNLOAD_MAP_ITEM_ORDER)
- .setListener(listener).createItem());
+ .setOrder(DOWNLOAD_MAP_ITEM_ORDER);
+
+ if (mapTileLayer) {
+ final WeakReference mapActivityRef = new WeakReference<>(mapActivity);
+ ItemClickListener listener = new ContextMenuAdapter.ItemClickListener() {
+ @Override
+ public boolean onContextMenuClick(ArrayAdapter adapter, int resId, int pos, boolean isChecked, int[] viewCoordinates) {
+ MapActivity mapActivity = mapActivityRef.get();
+ if (mapActivity != null && !mapActivity.isFinishing()) {
+ OsmandMapTileView mapView = mapActivity.getMapView();
+ if (resId == R.string.context_menu_item_update_map) {
+ mapActivity.getMapActions().reloadTile(mapView.getZoom(), latitude, longitude);
+ } else if (resId == R.string.shared_string_download_map) {
+ DownloadTilesDialog dlg = new DownloadTilesDialog(mapActivity, (OsmandApplication) mapActivity.getApplication(), mapView);
+ dlg.openDialog();
+ }
+ }
+ return true;
+ }
+ };
+ updateMapItemBuilder.setListener(listener);
+ downloadMapItemBuilder.setListener(listener);
+ }
+
+ adapter.addItem(updateMapItemBuilder.createItem());
+ adapter.addItem(downloadMapItemBuilder.createItem());
}
}
diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/OsmandSettings.java b/OsmAnd/src/net/osmand/plus/settings/backend/OsmandSettings.java
index 4afce65383..bfb593be38 100644
--- a/OsmAnd/src/net/osmand/plus/settings/backend/OsmandSettings.java
+++ b/OsmAnd/src/net/osmand/plus/settings/backend/OsmandSettings.java
@@ -1790,7 +1790,7 @@ public class OsmandSettings {
public final OsmandPreference ARRIVAL_DISTANCE_FACTOR =
new FloatPreference("arrival_distance_factor", 1f).makeProfile();
- public final OsmandPreference SPEED_LIMIT_EXCEED =
+ public final OsmandPreference SPEED_LIMIT_EXCEED_KMH =
new FloatPreference("speed_limit_exceed", 5f).makeProfile();
public final CommonPreference DEFAULT_SPEED = new FloatPreference("default_speed", 10f).makeProfile().cache();
@@ -1873,7 +1873,7 @@ public class OsmandSettings {
public final CommonPreference APP_MODE_ORDER = new IntPreference("app_mode_order", 0).makeProfile().cache();
- public final OsmandPreference SWITCH_MAP_DIRECTION_TO_COMPASS =
+ public final OsmandPreference SWITCH_MAP_DIRECTION_TO_COMPASS_KMH =
new FloatPreference("speed_for_map_to_direction_of_movement", 0f).makeProfile();
// this value string is synchronized with settings_pref.xml preference name
diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/MapDuringNavigationFragment.java b/OsmAnd/src/net/osmand/plus/settings/fragments/MapDuringNavigationFragment.java
index e44f338ee1..06aa0c4c08 100644
--- a/OsmAnd/src/net/osmand/plus/settings/fragments/MapDuringNavigationFragment.java
+++ b/OsmAnd/src/net/osmand/plus/settings/fragments/MapDuringNavigationFragment.java
@@ -74,28 +74,24 @@ public class MapDuringNavigationFragment extends BaseSettingsFragment {
}
private void setupMapDirectionToCompassPref() {
- String[] entries;
- Float[] entryValues;
+ //array size must be equal!
+ Float[] valuesKmh = new Float[]{0f, 5f, 7f, 10f, 15f, 20f};
+ Float[] valuesMph = new Float[]{0f, 3f, 5f, 7f, 10f, 15f};
+ String[] names;
if (settings.METRIC_SYSTEM.getModeValue(getSelectedAppMode()) == OsmandSettings.MetricsConstants.KILOMETERS_AND_METERS) {
- entryValues = new Float[] {0f, 5f, 7f, 10f, 15f, 20f};
- entries = new String[entryValues.length];
-
- for (int i = 0; i < entryValues.length; i++) {
- entries[i] = entryValues[i].intValue() + " " + getString(R.string.km_h);
+ names = new String[valuesKmh.length];
+ for (int i = 0; i < names.length; i++) {
+ names[i] = valuesKmh[i].intValue() + " " + getString(R.string.km_h);
}
} else {
- Float[] speedLimitsMiles = new Float[] {-7f, -5f, -3f, 0f, 3f, 5f, 7f, 10f, 15f};
- entryValues = new Float[] {0f, 3f, 5f, 7f, 10f, 15f};
- entries = new String[entryValues.length];
-
- for (int i = 0; i < entries.length; i++) {
- entries[i] = speedLimitsMiles[i].intValue() + " " + getString(R.string.mile_per_hour);
+ names = new String[valuesMph.length];
+ for (int i = 0; i < names.length; i++) {
+ names[i] = valuesMph[i].intValue() + " " + getString(R.string.mile_per_hour);
}
}
-
- ListPreferenceEx switchMapDirectionToCompass = (ListPreferenceEx) findPreference(settings.SWITCH_MAP_DIRECTION_TO_COMPASS.getId());
- switchMapDirectionToCompass.setEntries(entries);
- switchMapDirectionToCompass.setEntryValues(entryValues);
+ ListPreferenceEx switchMapDirectionToCompass = (ListPreferenceEx) findPreference(settings.SWITCH_MAP_DIRECTION_TO_COMPASS_KMH.getId());
+ switchMapDirectionToCompass.setEntries(names);
+ switchMapDirectionToCompass.setEntryValues(valuesKmh);
}
@Override
diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/VoiceAnnouncesFragment.java b/OsmAnd/src/net/osmand/plus/settings/fragments/VoiceAnnouncesFragment.java
index 24a1b817d4..4ff8f3262d 100644
--- a/OsmAnd/src/net/osmand/plus/settings/fragments/VoiceAnnouncesFragment.java
+++ b/OsmAnd/src/net/osmand/plus/settings/fragments/VoiceAnnouncesFragment.java
@@ -103,28 +103,24 @@ public class VoiceAnnouncesFragment extends BaseSettingsFragment implements OnPr
}
private void setupSpeedLimitExceedPref() {
- Float[] speedLimitValues;
- String[] speedLimitNames;
-
+ //array size must be equal!
+ Float[] valuesKmh = new Float[]{-10f, -7f, -5f, 0f, 5f, 7f, 10f, 15f, 20f};
+ Float[] valuesMph = new Float[]{-7f, -5f, -3f, 0f, 3f, 5f, 7f, 10f, 15f};
+ String[] names;
if (settings.METRIC_SYSTEM.getModeValue(getSelectedAppMode()) == OsmandSettings.MetricsConstants.KILOMETERS_AND_METERS) {
- speedLimitValues = new Float[] {-10f, -7f, -5f, 0f, 5f, 7f, 10f, 15f, 20f};
- speedLimitNames = new String[speedLimitValues.length];
-
- for (int i = 0; i < speedLimitValues.length; i++) {
- speedLimitNames[i] = speedLimitValues[i].intValue() + " " + getString(R.string.km_h);
+ names = new String[valuesKmh.length];
+ for (int i = 0; i < names.length; i++) {
+ names[i] = valuesKmh[i].intValue() + " " + getString(R.string.km_h);
}
} else {
- speedLimitValues = new Float[] {-7f, -5f, -3f, 0f, 3f, 5f, 7f, 10f, 15f};
- speedLimitNames = new String[speedLimitValues.length];
-
- for (int i = 0; i < speedLimitNames.length; i++) {
- speedLimitNames[i] = speedLimitValues[i].intValue() + " " + getString(R.string.mile_per_hour);
+ names = new String[valuesMph.length];
+ for (int i = 0; i < names.length; i++) {
+ names[i] = valuesMph[i].intValue() + " " + getString(R.string.mile_per_hour);
}
}
-
- ListPreferenceEx voiceProvider = (ListPreferenceEx) findPreference(settings.SPEED_LIMIT_EXCEED.getId());
- voiceProvider.setEntries(speedLimitNames);
- voiceProvider.setEntryValues(speedLimitValues);
+ ListPreferenceEx voiceProvider = (ListPreferenceEx) findPreference(settings.SPEED_LIMIT_EXCEED_KMH.getId());
+ voiceProvider.setEntries(names);
+ voiceProvider.setEntryValues(valuesKmh);
}
private void setupKeepInformingPref() {