diff --git a/OsmAnd/res/layout-land/fragment_measurement_tool.xml b/OsmAnd/res/layout-land/fragment_measurement_tool.xml index 4ed0e425e3..505e680262 100644 --- a/OsmAnd/res/layout-land/fragment_measurement_tool.xml +++ b/OsmAnd/res/layout-land/fragment_measurement_tool.xml @@ -160,7 +160,9 @@ 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" /> + osmand:typeface="@string/font_roboto_medium" + android:paddingEnd="@dimen/measurement_tool_text_button_padding_small" + android:paddingStart="@dimen/measurement_tool_text_button_padding_small" /> + osmand:srcCompat="@drawable/ic_action_user_account" + android:layout_marginStart="@dimen/content_padding" + android:layout_marginEnd="@dimen/content_padding" /> + android:orientation="vertical" + android:layout_marginStart="@dimen/content_padding" + android:layout_marginEnd="@dimen/content_padding"> + osmand:typeface="@string/font_roboto_medium" + android:paddingEnd="@dimen/content_padding" + android:paddingStart="@dimen/content_padding" /> + osmand:typeface="@string/font_roboto_medium" + android:paddingStart="@dimen/content_padding" + android:paddingEnd="@dimen/content_padding" /> + android:paddingBottom="@dimen/content_padding" + android:layout_marginStart="@dimen/content_padding_small" + android:layout_marginEnd="@dimen/content_padding_small" /> \ No newline at end of file diff --git a/OsmAnd/res/layout/bottom_sheet_item_description_with_padding.xml b/OsmAnd/res/layout/bottom_sheet_item_description_with_padding.xml index b6516e85ff..9a5aec71e8 100644 --- a/OsmAnd/res/layout/bottom_sheet_item_description_with_padding.xml +++ b/OsmAnd/res/layout/bottom_sheet_item_description_with_padding.xml @@ -8,7 +8,9 @@ android:paddingBottom="@dimen/content_padding_small" android:minHeight="@dimen/card_row_min_height" android:layout_width="match_parent" - android:layout_height="wrap_content"> + android:layout_height="wrap_content" + android:paddingEnd="@dimen/content_padding" + android:paddingStart="@dimen/content_padding"> + android:layout_marginRight="@dimen/content_padding" + android:layout_marginStart="@dimen/content_padding" + android:layout_marginEnd="@dimen/content_padding"> + android:paddingBottom="@dimen/content_padding_small" + android:paddingEnd="@dimen/content_padding" + android:paddingStart="@dimen/content_padding" /> diff --git a/OsmAnd/res/layout/bottom_sheet_item_slider_with_two_text.xml b/OsmAnd/res/layout/bottom_sheet_item_slider_with_two_text.xml index f386e8c59f..fc8cb6a41e 100644 --- a/OsmAnd/res/layout/bottom_sheet_item_slider_with_two_text.xml +++ b/OsmAnd/res/layout/bottom_sheet_item_slider_with_two_text.xml @@ -11,7 +11,9 @@ android:layout_height="wrap_content" android:gravity="center_vertical" android:paddingLeft="@dimen/content_padding" - android:paddingRight="@dimen/content_padding"> + android:paddingRight="@dimen/content_padding" + android:paddingStart="@dimen/content_padding" + android:paddingEnd="@dimen/content_padding"> + android:layout_height="wrap_content" + android:layout_marginStart="@dimen/content_padding" + android:layout_marginEnd="@dimen/content_padding" /> \ No newline at end of file diff --git a/OsmAnd/res/layout/bottom_sheet_item_with_descr_radio_and_icon_btn.xml b/OsmAnd/res/layout/bottom_sheet_item_with_descr_radio_and_icon_btn.xml index c4dc6d4265..c0cacc0b79 100644 --- a/OsmAnd/res/layout/bottom_sheet_item_with_descr_radio_and_icon_btn.xml +++ b/OsmAnd/res/layout/bottom_sheet_item_with_descr_radio_and_icon_btn.xml @@ -90,7 +90,9 @@ android:paddingLeft="@dimen/content_padding" android:paddingRight="@dimen/content_padding" android:layout_width="wrap_content" - android:layout_height="match_parent"> + android:layout_height="match_parent" + android:paddingEnd="@dimen/content_padding" + android:paddingStart="@dimen/content_padding"> + tools:src="@drawable/ic_action_info_dark" + android:layout_marginEnd="@dimen/content_padding" + android:layout_marginStart="@dimen/content_padding" /> diff --git a/OsmAnd/res/layout/custom_color_picker.xml b/OsmAnd/res/layout/custom_color_picker.xml index f2133e410b..c48205c25e 100644 --- a/OsmAnd/res/layout/custom_color_picker.xml +++ b/OsmAnd/res/layout/custom_color_picker.xml @@ -6,7 +6,9 @@ android:layout_height="wrap_content" android:orientation="vertical" android:paddingLeft="@dimen/content_padding" - android:paddingRight="@dimen/content_padding"> + android:paddingRight="@dimen/content_padding" + android:paddingStart="@dimen/content_padding" + android:paddingEnd="@dimen/content_padding"> + tools:visibility="gone" + android:layout_marginEnd="@dimen/multi_selection_menu_padding_top" + android:layout_marginStart="@dimen/multi_selection_menu_padding_top" /> + app:srcCompat="@drawable/ic_configure_screen_dark" + android:layout_marginEnd="@dimen/multi_selection_menu_padding_top" + android:layout_marginStart="@dimen/multi_selection_menu_padding_top" /> + app:srcCompat="@drawable/ic_action_done" + android:layout_marginEnd="@dimen/multi_selection_menu_padding_top" + android:layout_marginStart="@dimen/multi_selection_menu_padding_top" /> + app:srcCompat="@drawable/ic_sort_waypoint_dark" + android:layout_marginStart="@dimen/multi_selection_menu_padding_top" + android:layout_marginEnd="@dimen/multi_selection_menu_padding_top" /> + android:visibility="gone" + android:layout_marginEnd="@dimen/multi_selection_menu_padding_top" + android:layout_marginStart="@dimen/multi_selection_menu_padding_top" /> + android:visibility="gone" + android:layout_marginEnd="@dimen/multi_selection_menu_padding_top" + android:layout_marginStart="@dimen/multi_selection_menu_padding_top" /> diff --git a/OsmAnd/res/layout/dialog_button_with_icon.xml b/OsmAnd/res/layout/dialog_button_with_icon.xml index 264f884495..6a80553e49 100644 --- a/OsmAnd/res/layout/dialog_button_with_icon.xml +++ b/OsmAnd/res/layout/dialog_button_with_icon.xml @@ -13,7 +13,8 @@ android:layout_marginRight="@dimen/content_padding" android:layout_marginStart="@dimen/content_padding" android:layout_marginBottom="@dimen/content_padding_small" - tools:ignore="UselessParent"> + tools:ignore="UselessParent" + android:layout_marginEnd="@dimen/content_padding"> \ No newline at end of file + tools:text="@string/read_more" + android:paddingStart="@dimen/content_padding_half" + android:paddingEnd="@dimen/content_padding_half" /> \ No newline at end of file diff --git a/OsmAnd/res/layout/enough_space_warning_card.xml b/OsmAnd/res/layout/enough_space_warning_card.xml index 3fcbb69bac..6b85dcb27c 100644 --- a/OsmAnd/res/layout/enough_space_warning_card.xml +++ b/OsmAnd/res/layout/enough_space_warning_card.xml @@ -20,7 +20,9 @@ android:layout_marginLeft="@dimen/content_padding" android:layout_marginTop="@dimen/content_padding" android:layout_marginRight="@dimen/content_padding" - app:srcCompat="@drawable/ic_action_sdcard_warning_colored" /> + app:srcCompat="@drawable/ic_action_sdcard_warning_colored" + android:layout_marginStart="@dimen/content_padding" + android:layout_marginEnd="@dimen/content_padding" /> + android:orientation="vertical" + android:layout_marginStart="@dimen/content_padding" + android:layout_marginEnd="@dimen/content_padding"> + tools:listitem="@layout/point_editor_icon_category_item" + android:paddingStart="@dimen/content_padding" + android:paddingEnd="@dimen/content_padding" /> + tools:visibility="visible" + android:paddingEnd="@dimen/content_padding" + android:paddingStart="@dimen/content_padding"> + android:layout_marginBottom="@dimen/content_padding_half" + android:layout_marginEnd="@dimen/content_padding_half" + android:layout_marginStart="@dimen/content_padding_half"> + android:paddingRight="@dimen/measurement_tool_button_margin" + android:paddingStart="@dimen/measurement_tool_button_margin" + android:paddingEnd="@dimen/measurement_tool_button_margin"> + app:typeface="@string/font_roboto_medium" + android:layout_marginStart="@dimen/content_padding" + android:layout_marginEnd="@dimen/content_padding" /> + app:typeface="@string/font_roboto_regular" + android:layout_marginEnd="@dimen/content_padding" + android:layout_marginStart="@dimen/content_padding" /> @@ -73,7 +77,9 @@ android:layout_marginTop="@dimen/content_padding_small" android:layout_marginRight="@dimen/content_padding" android:layout_marginBottom="@dimen/content_padding_small" - android:orientation="vertical"> + android:orientation="vertical" + android:layout_marginStart="@dimen/content_padding" + android:layout_marginEnd="@dimen/content_padding"> + android:stepSize="1" + android:layout_marginStart="@dimen/content_padding" + android:layout_marginEnd="@dimen/content_padding" /> + android:stepSize="1" + android:layout_marginStart="@dimen/content_padding" + android:layout_marginEnd="@dimen/content_padding" /> + tools:text="@string/routing_settings_2" + android:layout_marginStart="@dimen/content_padding" + android:layout_marginEnd="@dimen/content_padding" /> + android:paddingBottom="@dimen/content_padding_half" + android:paddingEnd="@dimen/content_padding" + android:paddingStart="@dimen/content_padding"> + android:paddingTop="@dimen/content_padding" + android:layout_marginStart="@dimen/content_padding" + android:layout_marginEnd="@dimen/content_padding" /> + tools:text="Amsterdam is the Netherlands' capital and financial, cultural and creative centre with more" + android:layout_marginEnd="@dimen/content_padding" + android:layout_marginStart="@dimen/content_padding" /> + tools:text="@string/plugin_disabled_descr" + android:paddingEnd="@dimen/content_padding" + android:paddingStart="@dimen/content_padding" /> + android:orientation="vertical" + android:layout_marginStart="@dimen/content_padding_half" + android:layout_marginEnd="@dimen/content_padding_half" /> diff --git a/OsmAnd/res/layout/import_track_card.xml b/OsmAnd/res/layout/import_track_card.xml index 24ead3b9a6..108676e545 100644 --- a/OsmAnd/res/layout/import_track_card.xml +++ b/OsmAnd/res/layout/import_track_card.xml @@ -19,7 +19,9 @@ android:text="@string/import_track_descr" android:textAppearance="@style/TextAppearance.ContextMenuSubtitle" android:textColor="?android:textColorSecondary" - osmand:typeface="@string/font_roboto_regular" /> + osmand:typeface="@string/font_roboto_regular" + android:paddingEnd="@dimen/content_padding" + android:paddingStart="@dimen/content_padding" /> diff --git a/OsmAnd/res/layout/item_header_export_expand_list.xml b/OsmAnd/res/layout/item_header_export_expand_list.xml index a77881d33a..09fc11ad23 100644 --- a/OsmAnd/res/layout/item_header_export_expand_list.xml +++ b/OsmAnd/res/layout/item_header_export_expand_list.xml @@ -22,7 +22,9 @@ android:text="@string/export_profile_dialog_description" android:textColor="?android:textColorPrimary" android:textSize="@dimen/default_list_text_size" - app:typeface="@string/font_roboto_regular" /> + app:typeface="@string/font_roboto_regular" + android:paddingStart="@dimen/content_padding" + android:paddingEnd="@dimen/content_padding" /> + tools:text="@string/plugin_disabled_descr" + android:paddingStart="@dimen/content_padding" + android:paddingEnd="@dimen/content_padding" /> diff --git a/OsmAnd/res/layout/map_hud_bottom.xml b/OsmAnd/res/layout/map_hud_bottom.xml index 629f9350a1..30acd574e9 100644 --- a/OsmAnd/res/layout/map_hud_bottom.xml +++ b/OsmAnd/res/layout/map_hud_bottom.xml @@ -76,7 +76,9 @@ android:layout_height="wrap_content" android:layout_gravity="center" android:layout_marginLeft="@dimen/dashPadding" - android:layout_marginRight="@dimen/dashPadding"/> + android:layout_marginRight="@dimen/dashPadding" + android:layout_marginStart="@dimen/dashPadding" + android:layout_marginEnd="@dimen/dashPadding" /> diff --git a/OsmAnd/res/layout/map_marker_item_header.xml b/OsmAnd/res/layout/map_marker_item_header.xml index ab0a14e08b..14e5f8e9f4 100644 --- a/OsmAnd/res/layout/map_marker_item_header.xml +++ b/OsmAnd/res/layout/map_marker_item_header.xml @@ -50,7 +50,9 @@ android:gravity="center" android:visibility="gone" android:background="?android:selectableItemBackground" - android:textColor="?attr/active_color_basic" /> + android:textColor="?attr/active_color_basic" + android:paddingEnd="@dimen/bottom_sheet_content_margin" + android:paddingStart="@dimen/bottom_sheet_content_margin" /> + osmand:typeface="@string/font_roboto_medium" + android:paddingEnd="@dimen/content_padding" + android:paddingStart="@dimen/content_padding" /> + android:text="@string/navigation_profile" + android:layout_marginEnd="@dimen/content_padding" + android:layout_marginStart="@dimen/content_padding" /> + android:visibility="gone" + android:paddingStart="@dimen/content_padding" + android:paddingEnd="@dimen/content_padding"> + android:visibility="gone" + android:paddingEnd="@dimen/content_padding" + android:paddingStart="@dimen/content_padding" /> + android:visibility="gone" + android:paddingEnd="@dimen/content_padding" + android:paddingStart="@dimen/content_padding"> + android:text="@string/add_photos_descr" + android:layout_marginEnd="@dimen/content_padding" + android:layout_marginStart="@dimen/content_padding" /> \ No newline at end of file diff --git a/OsmAnd/res/layout/plan_route_threshold_slider.xml b/OsmAnd/res/layout/plan_route_threshold_slider.xml index 54fd7609d8..6d742b3c47 100644 --- a/OsmAnd/res/layout/plan_route_threshold_slider.xml +++ b/OsmAnd/res/layout/plan_route_threshold_slider.xml @@ -12,7 +12,9 @@ android:layout_height="wrap_content" android:paddingTop="@dimen/content_padding_small" android:paddingLeft="@dimen/content_padding" - android:paddingRight="@dimen/content_padding"> + android:paddingRight="@dimen/content_padding" + android:paddingEnd="@dimen/content_padding" + android:paddingStart="@dimen/content_padding"> + android:layout_height="wrap_content" + android:layout_marginEnd="@dimen/content_padding" + android:layout_marginStart="@dimen/content_padding" /> diff --git a/OsmAnd/res/layout/point_editor_fragment_new.xml b/OsmAnd/res/layout/point_editor_fragment_new.xml index 6beccf0dd7..b146b2ea1e 100644 --- a/OsmAnd/res/layout/point_editor_fragment_new.xml +++ b/OsmAnd/res/layout/point_editor_fragment_new.xml @@ -58,7 +58,9 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginLeft="@dimen/content_padding" - android:layout_marginRight="@dimen/content_padding"> + android:layout_marginRight="@dimen/content_padding" + android:layout_marginEnd="@dimen/content_padding" + android:layout_marginStart="@dimen/content_padding"> + app:hintAnimationEnabled="false" + android:layout_marginEnd="@dimen/content_padding" + android:layout_marginStart="@dimen/content_padding"> + android:background="?attr/dashboard_divider" + android:layout_marginStart="@dimen/content_padding" + android:layout_marginEnd="@dimen/content_padding" /> + app:hintAnimationEnabled="false" + android:layout_marginStart="@dimen/content_padding" + android:layout_marginEnd="@dimen/content_padding"> + osmand:typeface="@string/font_roboto_medium" + android:paddingEnd="@dimen/content_padding" + android:paddingStart="@dimen/content_padding" /> + osmand:typeface="@string/font_roboto_medium" + android:paddingEnd="@dimen/content_padding" + android:paddingStart="@dimen/content_padding" /> + osmand:typeface="@string/font_roboto_medium" + android:paddingStart="@dimen/content_padding" + android:paddingEnd="@dimen/content_padding" /> + osmand:typeface="@string/font_roboto_medium" + android:paddingStart="@dimen/content_padding" + android:paddingEnd="@dimen/content_padding" /> + osmand:typeface="@string/font_roboto_medium" + android:paddingEnd="@dimen/content_padding" + android:paddingStart="@dimen/content_padding" /> + osmand:typeface="@string/font_roboto_medium" + android:paddingStart="@dimen/content_padding" + android:paddingEnd="@dimen/content_padding" /> + osmand:srcCompat="@drawable/ic_action_arrow_down" + android:layout_marginEnd="@dimen/content_padding" + android:layout_marginStart="@dimen/content_padding" /> + android:orientation="vertical" + android:layout_marginEnd="@dimen/content_padding" + android:layout_marginStart="@dimen/content_padding"> + osmand:typeface="@string/font_roboto_medium" + android:layout_marginStart="@dimen/content_padding" + android:layout_marginEnd="@dimen/content_padding" /> + android:orientation="horizontal" + android:paddingStart="@dimen/content_padding" + android:paddingEnd="@dimen/content_padding"> + android:padding="@dimen/content_padding_small" + android:layout_marginEnd="@dimen/dashCardMargin" + android:layout_marginStart="@dimen/dashCardMargin"> + android:padding="@dimen/content_padding_small" + android:layout_marginEnd="@dimen/dashCardMargin" + android:layout_marginStart="@dimen/dashCardMargin"> + tools:text="@string/pass_whole_track_descr" + android:paddingStart="@dimen/content_padding" + android:paddingEnd="@dimen/content_padding" /> diff --git a/OsmAnd/res/layout/read_wikipedia_ofline_banner.xml b/OsmAnd/res/layout/read_wikipedia_ofline_banner.xml index 1093ad41f1..4e27debe49 100644 --- a/OsmAnd/res/layout/read_wikipedia_ofline_banner.xml +++ b/OsmAnd/res/layout/read_wikipedia_ofline_banner.xml @@ -16,7 +16,9 @@ android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_marginLeft="@dimen/content_padding" - android:layout_marginRight="@dimen/content_padding"> + android:layout_marginRight="@dimen/content_padding" + android:layout_marginStart="@dimen/content_padding" + android:layout_marginEnd="@dimen/content_padding"> + android:visibility="invisible" + android:layout_marginEnd="@dimen/content_padding" + android:layout_marginStart="@dimen/content_padding"> + android:paddingBottom="@dimen/content_padding" + android:layout_marginEnd="@dimen/content_padding_small" + android:layout_marginStart="@dimen/content_padding_small" /> diff --git a/OsmAnd/res/layout/select_folder_row.xml b/OsmAnd/res/layout/select_folder_row.xml index 1d855ff70f..dccba6c9b8 100644 --- a/OsmAnd/res/layout/select_folder_row.xml +++ b/OsmAnd/res/layout/select_folder_row.xml @@ -20,7 +20,9 @@ android:text="@string/select_folder" android:textColor="?android:textColorSecondary" android:textSize="@dimen/default_desc_text_size" - osmand:typeface="@string/font_roboto_regular" /> + osmand:typeface="@string/font_roboto_regular" + android:paddingStart="@dimen/content_padding" + android:paddingEnd="@dimen/content_padding" /> + osmand:typeface="@string/font_roboto_regular" + android:paddingStart="@dimen/content_padding" + android:paddingEnd="@dimen/content_padding" /> + tools:text="@string/gpx_visibility_txt" + android:paddingStart="@dimen/content_padding" + android:paddingEnd="@dimen/content_padding" /> @@ -138,7 +142,9 @@ android:paddingBottom="@dimen/context_menu_first_line_top_margin" android:textColor="?android:textColorPrimary" android:textSize="@dimen/default_desc_text_size" - osmand:typeface="@string/font_roboto_regular" /> + osmand:typeface="@string/font_roboto_regular" + android:paddingEnd="@dimen/content_padding" + android:paddingStart="@dimen/content_padding" /> + osmand:typeface="@string/font_roboto_regular" + android:paddingStart="@dimen/content_padding_small" + android:paddingEnd="@dimen/content_padding_small" /> diff --git a/OsmAnd/res/layout/send_poi_fragment.xml b/OsmAnd/res/layout/send_poi_fragment.xml index 751c0b1fe8..538cc55e0b 100644 --- a/OsmAnd/res/layout/send_poi_fragment.xml +++ b/OsmAnd/res/layout/send_poi_fragment.xml @@ -57,7 +57,9 @@ android:text="@string/close_changeset" android:textColor="?android:textColorPrimary" android:textSize="@dimen/default_list_text_size" - osmand:typeface="@string/font_roboto_regular" /> + osmand:typeface="@string/font_roboto_regular" + android:paddingStart="@dimen/content_padding_small" + android:paddingEnd="@dimen/content_padding_small" /> diff --git a/OsmAnd/res/layout/settings_group_title.xml b/OsmAnd/res/layout/settings_group_title.xml index 456a3aace1..7d4fb811cd 100644 --- a/OsmAnd/res/layout/settings_group_title.xml +++ b/OsmAnd/res/layout/settings_group_title.xml @@ -70,7 +70,9 @@ android:paddingLeft="@dimen/content_padding" android:paddingTop="@dimen/content_padding_small" android:paddingRight="@dimen/content_padding" - android:paddingBottom="@dimen/content_padding_small"> + android:paddingBottom="@dimen/content_padding_small" + android:paddingStart="@dimen/content_padding" + android:paddingEnd="@dimen/content_padding"> + android:paddingRight="@dimen/content_padding" + android:paddingEnd="@dimen/content_padding" + android:paddingStart="@dimen/content_padding"> + tools:visibility="visible" + android:layout_marginStart="@dimen/content_padding_half" + android:layout_marginEnd="@dimen/content_padding_half"> + android:stepSize="1" + android:layout_marginEnd="@dimen/content_padding" + android:layout_marginStart="@dimen/content_padding" /> + android:stepSize="1" + android:layout_marginStart="@dimen/content_padding" + android:layout_marginEnd="@dimen/content_padding" /> + tools:text="@string/mapillary_menu_title_username" + android:paddingStart="@dimen/content_padding_small_half" + android:paddingEnd="@dimen/content_padding_small_half" /> + tools:text="@string/shared_string_profiles" + android:paddingStart="@dimen/content_padding_small_half" + android:paddingEnd="@dimen/content_padding_small_half" /> diff --git a/OsmAnd/res/layout/zoom_levels_with_descr.xml b/OsmAnd/res/layout/zoom_levels_with_descr.xml index 5cfbcde5e9..3d5b16a7df 100644 --- a/OsmAnd/res/layout/zoom_levels_with_descr.xml +++ b/OsmAnd/res/layout/zoom_levels_with_descr.xml @@ -78,7 +78,9 @@ android:layout_marginLeft="@dimen/content_padding" android:layout_marginRight="@dimen/content_padding" android:layout_weight="1" - android:stepSize="1" /> + android:stepSize="1" + android:layout_marginEnd="@dimen/content_padding" + android:layout_marginStart="@dimen/content_padding" /> 12 m (capped by POSITIONING_TOLERANCE) - ARRIVAL_DISTANCE = (int) (Math.max(POSITIONING_TOLERANCE, DEFAULT_SPEED * 5.) * arrivalDistanceFactor); + ARRIVAL_DISTANCE = (int) (Math.max(POSITIONING_TOLERANCE, DEFAULT_SPEED * 5.) * arrivalDistanceFactor); // 20 s: car 250 m, bicycle 56 m, pedestrian 22 m OFF_ROUTE_DISTANCE = DEFAULT_SPEED * 20 * arrivalDistanceFactor; // 20 seconds @@ -175,17 +180,14 @@ public class AnnounceTimeDistances { } private boolean isDistanceLess(float currentSpeed, double dist, double etalon, float defSpeed) { - // Check triggers: + // Check triggers: // (1) distance < etalon? if (dist - voicePromptDelayTimeSec * currentSpeed <= etalon) { return true; } // (2) time_with_current_speed < etalon_time_with_default_speed? // check only if speed > 0 - if (currentSpeed > 0 && (dist / currentSpeed - voicePromptDelayTimeSec) <= etalon / defSpeed) { - return true; - } - return false; + return currentSpeed > 0 && (dist / currentSpeed - voicePromptDelayTimeSec) <= etalon / defSpeed; } public float getSpeed(Location loc) { @@ -208,18 +210,21 @@ public class AnnounceTimeDistances { return (int) (dist - voicePromptDelayTimeSec * speed); } - private void appendTurnDesc(SpannableStringBuilder builder, String name, int dist, String meter, String second) { - appendTurnDesc(builder, name, dist, DEFAULT_SPEED, meter, second); + private void appendTurnDesc(OsmandApplication app, SpannableStringBuilder builder, String name, int dist, String meter, String second) { + appendTurnDesc(app, builder, name, dist, DEFAULT_SPEED, meter, second); } - private void appendTurnDesc(SpannableStringBuilder builder, String name, int dist, float speed, String meter, String second) { + private void appendTurnDesc(OsmandApplication app, SpannableStringBuilder builder, String name, int dist, float speed, String meter, String second) { int minDist = (dist / 5) * 5; int time = (int) (dist / speed); if (time > 15) { // round to 5 time = (time / 5) * 5; } - builder.append(String.format("\n%s: %d - %d %s, %d %s.", name, minDist, minDist + 5, meter, time, second)); + String distStr = String.format("\n%s: %d - %d %s", name, minDist, minDist + 5, meter); + String timeStr = String.format("%d %s.", time, second); + builder.append(app.getString(R.string.ltr_or_rtl_combine_via_comma, distStr, timeStr)); + } public Spannable getIntervalsDescription(OsmandApplication app) { @@ -245,35 +250,35 @@ public class AnnounceTimeDistances { builder.append(turn); makeBold(builder, turn); if (PREPARE_DISTANCE_END <= PREPARE_DISTANCE) { - appendTurnDesc(builder, prepare, PREPARE_DISTANCE, meter, second); + appendTurnDesc(app, builder, prepare, PREPARE_DISTANCE, meter, second); } if (PREPARE_LONG_DISTANCE_END <= PREPARE_LONG_DISTANCE) { - appendTurnDesc(builder, longPrepare, PREPARE_LONG_DISTANCE, meter, second); + appendTurnDesc(app, builder, longPrepare, PREPARE_LONG_DISTANCE, meter, second); } - appendTurnDesc(builder, approach, TURN_IN_DISTANCE, meter, second); - appendTurnDesc(builder, passing, TURN_NOW_DISTANCE, TURN_NOW_SPEED, meter, second); + appendTurnDesc(app, builder, approach, TURN_IN_DISTANCE, meter, second); + appendTurnDesc(app, builder, passing, TURN_NOW_DISTANCE, TURN_NOW_SPEED, meter, second); // Arrive at destination - appendTurnDesc(builder, arrive, (int) (getArrivalDistance()), meter, second); + appendTurnDesc(app, builder, arrive, (int) (getArrivalDistance()), meter, second); makeBoldFormatted(builder, arrive); // Off-route if (getOffRouteDistance() > 0) { - appendTurnDesc(builder, offRoute, (int) getOffRouteDistance(), meter, second); + appendTurnDesc(app, builder, offRoute, (int) getOffRouteDistance(), meter, second); makeBoldFormatted(builder, offRoute); } // Traffic warnings builder.append(traffic); makeBold(builder, traffic); - appendTurnDesc(builder, approach, LONG_ALARM_ANNOUNCE_RADIUS, meter, second); - appendTurnDesc(builder, passing, SHORT_ALARM_ANNOUNCE_RADIUS, meter, second); + appendTurnDesc(app, builder, approach, LONG_ALARM_ANNOUNCE_RADIUS, meter, second); + appendTurnDesc(app, builder, passing, SHORT_ALARM_ANNOUNCE_RADIUS, meter, second); // Waypoint / Favorite / POI builder.append(point); makeBold(builder, point); - appendTurnDesc(builder, approach, LONG_PNT_ANNOUNCE_RADIUS, meter, second); - appendTurnDesc(builder, passing, SHORT_PNT_ANNOUNCE_RADIUS, meter, second); + appendTurnDesc(app, builder, approach, LONG_PNT_ANNOUNCE_RADIUS, meter, second); + appendTurnDesc(app, builder, passing, SHORT_PNT_ANNOUNCE_RADIUS, meter, second); return builder; }