From a8bca97b0b402d1941060e76cf1ed435f79e9c08 Mon Sep 17 00:00:00 2001 From: androiddevkotlin <64539346+androiddevkotlin@users.noreply.github.com> Date: Wed, 24 Mar 2021 01:40:52 +0200 Subject: [PATCH 1/4] Rtl fix xml and Announcement time --- .../layout-land/fragment_measurement_tool.xml | 4 +- OsmAnd/res/layout/account_details.xml | 8 +++- .../res/layout/add_new_favorite_category.xml | 8 +++- OsmAnd/res/layout/adjust_speed_slider.xml | 4 +- ...om_sheet_item_description_with_padding.xml | 4 +- ...ttom_sheet_item_edit_with_recyclerview.xml | 4 +- .../res/layout/bottom_sheet_item_progress.xml | 4 +- ...bottom_sheet_item_slider_with_two_text.xml | 8 +++- ...eet_item_with_descr_radio_and_icon_btn.xml | 4 +- ...escr_switch_and_additional_button_56dp.xml | 4 +- OsmAnd/res/layout/custom_color_picker.xml | 4 +- OsmAnd/res/layout/dashboard_toolbar.xml | 24 ++++++++--- OsmAnd/res/layout/dialog_button_with_icon.xml | 3 +- .../layout/download_description_button.xml | 4 +- .../res/layout/enough_space_warning_card.xml | 8 +++- OsmAnd/res/layout/follow_track_card.xml | 4 +- OsmAnd/res/layout/fragment_import.xml | 8 +++- .../res/layout/fragment_measurement_tool.xml | 4 +- OsmAnd/res/layout/fragment_opr_login.xml | 12 ++++-- OsmAnd/res/layout/fragment_terrain.xml | 8 +++- ...global_preferences_toolbar_with_switch.xml | 4 +- OsmAnd/res/layout/gpx_item_list_header.xml | 4 +- .../res/layout/gpx_list_item_tab_content.xml | 4 +- OsmAnd/res/layout/gpx_overview_fragment.xml | 4 +- OsmAnd/res/layout/group_description_item.xml | 8 +++- OsmAnd/res/layout/import_track_card.xml | 4 +- .../layout/item_header_export_expand_list.xml | 4 +- OsmAnd/res/layout/item_info_fragment.xml | 4 +- OsmAnd/res/layout/map_hud_bottom.xml | 4 +- OsmAnd/res/layout/map_marker_item_header.xml | 4 +- .../layout/navigate_track_options_card.xml | 4 +- .../res/layout/navigation_profiles_card.xml | 4 +- .../online_routing_preference_segment.xml | 12 ++++-- OsmAnd/res/layout/opr_add_photo.xml | 4 +- .../layout/plan_route_threshold_slider.xml | 8 +++- .../res/layout/point_editor_fragment_new.xml | 40 ++++++++++++++----- .../layout/profile_data_list_item_group.xml | 8 +++- .../layout/quick_action_add_dialog_header.xml | 4 +- .../layout/quick_action_add_dialog_item.xml | 4 +- OsmAnd/res/layout/quick_action_list_item.xml | 8 +++- .../res/layout/radio_buttons_with_descr.xml | 4 +- .../layout/read_wikipedia_ofline_banner.xml | 8 +++- .../res/layout/recalculation_angle_dialog.xml | 4 +- OsmAnd/res/layout/select_folder_row.xml | 4 +- OsmAnd/res/layout/send_gpx_fragment.xml | 12 ++++-- OsmAnd/res/layout/send_osm_note_fragment.xml | 4 +- OsmAnd/res/layout/send_poi_fragment.xml | 4 +- OsmAnd/res/layout/settings_group_title.xml | 4 +- OsmAnd/res/layout/track_appearance.xml | 4 +- OsmAnd/res/layout/track_menu.xml | 4 +- OsmAnd/res/layout/track_split_interval.xml | 4 +- OsmAnd/res/layout/track_width_card.xml | 4 +- .../res/layout/wikivoyage_travel_gpx_card.xml | 8 +++- OsmAnd/res/layout/zoom_levels_with_descr.xml | 4 +- .../routing/data/AnnounceTimeDistances.java | 25 ++++++------ 55 files changed, 269 insertions(+), 99 deletions(-) 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 +176,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) { @@ -219,7 +217,8 @@ public class AnnounceTimeDistances { // 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)); + BidiFormatter myBidiFormatter = BidiFormatter.getInstance(); + builder.append(String.format("\n%s: %d - %d %s, %d %s.", name, minDist, minDist + 5, myBidiFormatter.unicodeWrap(meter), time, myBidiFormatter.unicodeWrap(second))); } public Spannable getIntervalsDescription(OsmandApplication app) { From 3c239cae0cc206226c2cb95fa307dc6081f7dadf Mon Sep 17 00:00:00 2001 From: androiddevkotlin <64539346+androiddevkotlin@users.noreply.github.com> Date: Wed, 24 Mar 2021 11:21:41 +0200 Subject: [PATCH 2/4] Api low --- .../osmand/plus/routing/data/AnnounceTimeDistances.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/routing/data/AnnounceTimeDistances.java b/OsmAnd/src/net/osmand/plus/routing/data/AnnounceTimeDistances.java index 9285cae0a0..d03d4f2c43 100644 --- a/OsmAnd/src/net/osmand/plus/routing/data/AnnounceTimeDistances.java +++ b/OsmAnd/src/net/osmand/plus/routing/data/AnnounceTimeDistances.java @@ -217,8 +217,13 @@ public class AnnounceTimeDistances { // round to 5 time = (time / 5) * 5; } - BidiFormatter myBidiFormatter = BidiFormatter.getInstance(); - builder.append(String.format("\n%s: %d - %d %s, %d %s.", name, minDist, minDist + 5, myBidiFormatter.unicodeWrap(meter), time, myBidiFormatter.unicodeWrap(second))); + BidiFormatter myBidiFormatter; + if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN_MR2) { + myBidiFormatter = BidiFormatter.getInstance(); + builder.append(String.format("\n%s: %d - %d %s, %d %s.", name, minDist, minDist + 5, myBidiFormatter.unicodeWrap(meter), time, myBidiFormatter.unicodeWrap(second))); + }else{ + builder.append(String.format("\n%s: %d - %d %s, %d %s.", name, minDist, minDist + 5, "\u200F"+meter, time, "\u200F"+second)); + } } public Spannable getIntervalsDescription(OsmandApplication app) { From 27002fd152146b33210c51203a5f73e03d3d3313 Mon Sep 17 00:00:00 2001 From: androiddevkotlin <64539346+androiddevkotlin@users.noreply.github.com> Date: Fri, 26 Mar 2021 01:03:37 +0200 Subject: [PATCH 3/4] Here please use ltr_or_rtl_combine_via_comma for text parts after colon (There's nothing to do with colon itself). --- .../routing/data/AnnounceTimeDistances.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/routing/data/AnnounceTimeDistances.java b/OsmAnd/src/net/osmand/plus/routing/data/AnnounceTimeDistances.java index d03d4f2c43..ea50cdf1e5 100644 --- a/OsmAnd/src/net/osmand/plus/routing/data/AnnounceTimeDistances.java +++ b/OsmAnd/src/net/osmand/plus/routing/data/AnnounceTimeDistances.java @@ -1,11 +1,13 @@ package net.osmand.plus.routing.data; import android.graphics.Typeface; -import android.text.BidiFormatter; import android.text.Spannable; import android.text.SpannableStringBuilder; import android.text.style.StyleSpan; +import androidx.core.text.TextUtilsCompat; +import androidx.core.view.ViewCompat; + import net.osmand.Location; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; @@ -13,6 +15,8 @@ import net.osmand.plus.settings.backend.ApplicationMode; import net.osmand.plus.settings.backend.OsmandSettings; import net.osmand.plus.voice.AbstractPrologCommandPlayer; +import java.util.Locale; + public class AnnounceTimeDistances { // Avoids false negatives: Pre-pone close announcements by this distance to allow for the possible over-estimation of the 'true' lead distance due to positioning error. // A smaller value will increase the timing precision, but at the risk of missing prompts which do not meet the precision limit. @@ -217,12 +221,12 @@ public class AnnounceTimeDistances { // round to 5 time = (time / 5) * 5; } - BidiFormatter myBidiFormatter; - if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN_MR2) { - myBidiFormatter = BidiFormatter.getInstance(); - builder.append(String.format("\n%s: %d - %d %s, %d %s.", name, minDist, minDist + 5, myBidiFormatter.unicodeWrap(meter), time, myBidiFormatter.unicodeWrap(second))); - }else{ - builder.append(String.format("\n%s: %d - %d %s, %d %s.", name, minDist, minDist + 5, "\u200F"+meter, time, "\u200F"+second)); + boolean isLeftToRight = TextUtilsCompat.getLayoutDirectionFromLocale(Locale.getDefault()) == ViewCompat.LAYOUT_DIRECTION_LTR; + if (isLeftToRight) { + builder.append(String.format("\n%s: %d - %d %s, %d %s.", name, minDist, minDist + 5, meter, time, second)); + } else { + builder.append(String.format("\n%s: %s %d, %s %d - %d.", name, second, time, meter, minDist, minDist + 5)); + } } From be85c4dcd6dc455ce49b1f17ff840e1971f2e831 Mon Sep 17 00:00:00 2001 From: androiddevkotlin <64539346+androiddevkotlin@users.noreply.github.com> Date: Sun, 28 Mar 2021 22:37:03 +0300 Subject: [PATCH 4/4] User suggestion --- .../routing/data/AnnounceTimeDistances.java | 35 +++++++++---------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/routing/data/AnnounceTimeDistances.java b/OsmAnd/src/net/osmand/plus/routing/data/AnnounceTimeDistances.java index ea50cdf1e5..a0f1ca0cd8 100644 --- a/OsmAnd/src/net/osmand/plus/routing/data/AnnounceTimeDistances.java +++ b/OsmAnd/src/net/osmand/plus/routing/data/AnnounceTimeDistances.java @@ -210,24 +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; } - boolean isLeftToRight = TextUtilsCompat.getLayoutDirectionFromLocale(Locale.getDefault()) == ViewCompat.LAYOUT_DIRECTION_LTR; - if (isLeftToRight) { - builder.append(String.format("\n%s: %d - %d %s, %d %s.", name, minDist, minDist + 5, meter, time, second)); - } else { - builder.append(String.format("\n%s: %s %d, %s %d - %d.", name, second, time, meter, minDist, minDist + 5)); + 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) { @@ -253,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; }