diff --git a/OsmAnd/res/drawable-hdpi/ic_action_add.png b/OsmAnd/res/drawable-hdpi/ic_action_add.png deleted file mode 100644 index 7c02df7207..0000000000 Binary files a/OsmAnd/res/drawable-hdpi/ic_action_add.png and /dev/null differ diff --git a/OsmAnd/res/drawable-hdpi/ic_action_manage_profiles.png b/OsmAnd/res/drawable-hdpi/ic_action_manage_profiles.png deleted file mode 100755 index fa92fba02d..0000000000 Binary files a/OsmAnd/res/drawable-hdpi/ic_action_manage_profiles.png and /dev/null differ diff --git a/OsmAnd/res/drawable-hdpi/ic_action_mode_back.png b/OsmAnd/res/drawable-hdpi/ic_action_mode_back.png deleted file mode 100644 index 6c36eae2f4..0000000000 Binary files a/OsmAnd/res/drawable-hdpi/ic_action_mode_back.png and /dev/null differ diff --git a/OsmAnd/res/drawable-hdpi/ic_action_notification.png b/OsmAnd/res/drawable-hdpi/ic_action_notification.png deleted file mode 100755 index e743a394ef..0000000000 Binary files a/OsmAnd/res/drawable-hdpi/ic_action_notification.png and /dev/null differ diff --git a/OsmAnd/res/drawable-hdpi/ic_action_privacy_and_security.png b/OsmAnd/res/drawable-hdpi/ic_action_privacy_and_security.png deleted file mode 100755 index 85f173ca57..0000000000 Binary files a/OsmAnd/res/drawable-hdpi/ic_action_privacy_and_security.png and /dev/null differ diff --git a/OsmAnd/res/drawable-hdpi/ic_action_transport_stop.png b/OsmAnd/res/drawable-hdpi/ic_action_transport_stop.png deleted file mode 100644 index d05d6e3424..0000000000 Binary files a/OsmAnd/res/drawable-hdpi/ic_action_transport_stop.png and /dev/null differ diff --git a/OsmAnd/res/drawable-hdpi/map_transport_stop_bg.png b/OsmAnd/res/drawable-hdpi/map_transport_stop_bg.png index 169363e837..18fda5981f 100644 Binary files a/OsmAnd/res/drawable-hdpi/map_transport_stop_bg.png and b/OsmAnd/res/drawable-hdpi/map_transport_stop_bg.png differ diff --git a/OsmAnd/res/drawable-hdpi/map_transport_stop_bus.png b/OsmAnd/res/drawable-hdpi/map_transport_stop_bus.png index 917fbe34aa..8692bac467 100644 Binary files a/OsmAnd/res/drawable-hdpi/map_transport_stop_bus.png and b/OsmAnd/res/drawable-hdpi/map_transport_stop_bus.png differ diff --git a/OsmAnd/res/drawable-hdpi/map_transport_stop_tram.png b/OsmAnd/res/drawable-hdpi/map_transport_stop_tram.png index 3bda97a73b..9eeb78c258 100644 Binary files a/OsmAnd/res/drawable-hdpi/map_transport_stop_tram.png and b/OsmAnd/res/drawable-hdpi/map_transport_stop_tram.png differ diff --git a/OsmAnd/res/drawable-mdpi/ic_action_add.png b/OsmAnd/res/drawable-mdpi/ic_action_add.png deleted file mode 100644 index 7f96ff2f30..0000000000 Binary files a/OsmAnd/res/drawable-mdpi/ic_action_add.png and /dev/null differ diff --git a/OsmAnd/res/drawable-mdpi/ic_action_manage_profiles.png b/OsmAnd/res/drawable-mdpi/ic_action_manage_profiles.png deleted file mode 100755 index ba5ff17ae2..0000000000 Binary files a/OsmAnd/res/drawable-mdpi/ic_action_manage_profiles.png and /dev/null differ diff --git a/OsmAnd/res/drawable-mdpi/ic_action_notification.png b/OsmAnd/res/drawable-mdpi/ic_action_notification.png deleted file mode 100755 index b2fb5e4e5e..0000000000 Binary files a/OsmAnd/res/drawable-mdpi/ic_action_notification.png and /dev/null differ diff --git a/OsmAnd/res/drawable-mdpi/ic_action_privacy_and_security.png b/OsmAnd/res/drawable-mdpi/ic_action_privacy_and_security.png deleted file mode 100755 index abffc94827..0000000000 Binary files a/OsmAnd/res/drawable-mdpi/ic_action_privacy_and_security.png and /dev/null differ diff --git a/OsmAnd/res/drawable-mdpi/ic_action_transport_stop.png b/OsmAnd/res/drawable-mdpi/ic_action_transport_stop.png deleted file mode 100644 index 32a3c1a361..0000000000 Binary files a/OsmAnd/res/drawable-mdpi/ic_action_transport_stop.png and /dev/null differ diff --git a/OsmAnd/res/drawable-mdpi/map_transport_stop_bg.png b/OsmAnd/res/drawable-mdpi/map_transport_stop_bg.png index f90c9a215b..95b0e8bf47 100644 Binary files a/OsmAnd/res/drawable-mdpi/map_transport_stop_bg.png and b/OsmAnd/res/drawable-mdpi/map_transport_stop_bg.png differ diff --git a/OsmAnd/res/drawable-mdpi/map_transport_stop_bus.png b/OsmAnd/res/drawable-mdpi/map_transport_stop_bus.png index 75c625ffa6..3968b969fb 100644 Binary files a/OsmAnd/res/drawable-mdpi/map_transport_stop_bus.png and b/OsmAnd/res/drawable-mdpi/map_transport_stop_bus.png differ diff --git a/OsmAnd/res/drawable-mdpi/map_transport_stop_tram.png b/OsmAnd/res/drawable-mdpi/map_transport_stop_tram.png index ffcb0098cf..2baf5ff167 100644 Binary files a/OsmAnd/res/drawable-mdpi/map_transport_stop_tram.png and b/OsmAnd/res/drawable-mdpi/map_transport_stop_tram.png differ diff --git a/OsmAnd/res/drawable-xhdpi/ic_action_add.png b/OsmAnd/res/drawable-xhdpi/ic_action_add.png deleted file mode 100644 index 4617bdd133..0000000000 Binary files a/OsmAnd/res/drawable-xhdpi/ic_action_add.png and /dev/null differ diff --git a/OsmAnd/res/drawable-xhdpi/ic_action_manage_profiles.png b/OsmAnd/res/drawable-xhdpi/ic_action_manage_profiles.png deleted file mode 100755 index 54ad2d0d22..0000000000 Binary files a/OsmAnd/res/drawable-xhdpi/ic_action_manage_profiles.png and /dev/null differ diff --git a/OsmAnd/res/drawable-xhdpi/ic_action_mode_back.png b/OsmAnd/res/drawable-xhdpi/ic_action_mode_back.png deleted file mode 100644 index 27bdcb79e3..0000000000 Binary files a/OsmAnd/res/drawable-xhdpi/ic_action_mode_back.png and /dev/null differ diff --git a/OsmAnd/res/drawable-xhdpi/ic_action_notification.png b/OsmAnd/res/drawable-xhdpi/ic_action_notification.png deleted file mode 100755 index 0a0e237e5a..0000000000 Binary files a/OsmAnd/res/drawable-xhdpi/ic_action_notification.png and /dev/null differ diff --git a/OsmAnd/res/drawable-xhdpi/ic_action_privacy_and_security.png b/OsmAnd/res/drawable-xhdpi/ic_action_privacy_and_security.png deleted file mode 100755 index c3704baf74..0000000000 Binary files a/OsmAnd/res/drawable-xhdpi/ic_action_privacy_and_security.png and /dev/null differ diff --git a/OsmAnd/res/drawable-xhdpi/ic_action_transport_stop.png b/OsmAnd/res/drawable-xhdpi/ic_action_transport_stop.png deleted file mode 100644 index 03c5bf0994..0000000000 Binary files a/OsmAnd/res/drawable-xhdpi/ic_action_transport_stop.png and /dev/null differ diff --git a/OsmAnd/res/drawable-xhdpi/map_transport_stop_bg.png b/OsmAnd/res/drawable-xhdpi/map_transport_stop_bg.png index 33a9b2349f..a7a0333ef9 100644 Binary files a/OsmAnd/res/drawable-xhdpi/map_transport_stop_bg.png and b/OsmAnd/res/drawable-xhdpi/map_transport_stop_bg.png differ diff --git a/OsmAnd/res/drawable-xhdpi/map_transport_stop_bus.png b/OsmAnd/res/drawable-xhdpi/map_transport_stop_bus.png index dbcec408ef..e2dd0ea9c9 100644 Binary files a/OsmAnd/res/drawable-xhdpi/map_transport_stop_bus.png and b/OsmAnd/res/drawable-xhdpi/map_transport_stop_bus.png differ diff --git a/OsmAnd/res/drawable-xhdpi/map_transport_stop_tram.png b/OsmAnd/res/drawable-xhdpi/map_transport_stop_tram.png index b8278cdae2..5bc8cb3c81 100644 Binary files a/OsmAnd/res/drawable-xhdpi/map_transport_stop_tram.png and b/OsmAnd/res/drawable-xhdpi/map_transport_stop_tram.png differ diff --git a/OsmAnd/res/drawable-xxhdpi/ic_action_add.png b/OsmAnd/res/drawable-xxhdpi/ic_action_add.png deleted file mode 100644 index b7305551e9..0000000000 Binary files a/OsmAnd/res/drawable-xxhdpi/ic_action_add.png and /dev/null differ diff --git a/OsmAnd/res/drawable-xxhdpi/ic_action_manage_profiles.png b/OsmAnd/res/drawable-xxhdpi/ic_action_manage_profiles.png deleted file mode 100755 index 96815838c8..0000000000 Binary files a/OsmAnd/res/drawable-xxhdpi/ic_action_manage_profiles.png and /dev/null differ diff --git a/OsmAnd/res/drawable-xxhdpi/ic_action_mode_back.png b/OsmAnd/res/drawable-xxhdpi/ic_action_mode_back.png deleted file mode 100644 index c2d6a542cd..0000000000 Binary files a/OsmAnd/res/drawable-xxhdpi/ic_action_mode_back.png and /dev/null differ diff --git a/OsmAnd/res/drawable-xxhdpi/ic_action_notification.png b/OsmAnd/res/drawable-xxhdpi/ic_action_notification.png deleted file mode 100755 index fcb27947c8..0000000000 Binary files a/OsmAnd/res/drawable-xxhdpi/ic_action_notification.png and /dev/null differ diff --git a/OsmAnd/res/drawable-xxhdpi/ic_action_privacy_and_security.png b/OsmAnd/res/drawable-xxhdpi/ic_action_privacy_and_security.png deleted file mode 100755 index be2d108fc6..0000000000 Binary files a/OsmAnd/res/drawable-xxhdpi/ic_action_privacy_and_security.png and /dev/null differ diff --git a/OsmAnd/res/drawable-xxhdpi/ic_action_transport_stop.png b/OsmAnd/res/drawable-xxhdpi/ic_action_transport_stop.png deleted file mode 100644 index 52daad3a5e..0000000000 Binary files a/OsmAnd/res/drawable-xxhdpi/ic_action_transport_stop.png and /dev/null differ diff --git a/OsmAnd/res/drawable-xxhdpi/map_transport_stop_bg.png b/OsmAnd/res/drawable-xxhdpi/map_transport_stop_bg.png index 7136521aca..1679401d7b 100644 Binary files a/OsmAnd/res/drawable-xxhdpi/map_transport_stop_bg.png and b/OsmAnd/res/drawable-xxhdpi/map_transport_stop_bg.png differ diff --git a/OsmAnd/res/drawable-xxhdpi/map_transport_stop_bus.png b/OsmAnd/res/drawable-xxhdpi/map_transport_stop_bus.png index 17c397c3b7..5d1636ae9e 100644 Binary files a/OsmAnd/res/drawable-xxhdpi/map_transport_stop_bus.png and b/OsmAnd/res/drawable-xxhdpi/map_transport_stop_bus.png differ diff --git a/OsmAnd/res/drawable-xxhdpi/map_transport_stop_tram.png b/OsmAnd/res/drawable-xxhdpi/map_transport_stop_tram.png index 51afe238b5..327e5250d2 100644 Binary files a/OsmAnd/res/drawable-xxhdpi/map_transport_stop_tram.png and b/OsmAnd/res/drawable-xxhdpi/map_transport_stop_tram.png differ diff --git a/OsmAnd/res/drawable-xxxhdpi/ic_action_add.png b/OsmAnd/res/drawable-xxxhdpi/ic_action_add.png deleted file mode 100644 index e36d623ad0..0000000000 Binary files a/OsmAnd/res/drawable-xxxhdpi/ic_action_add.png and /dev/null differ diff --git a/OsmAnd/res/drawable-xxxhdpi/ic_action_manage_profiles.png b/OsmAnd/res/drawable-xxxhdpi/ic_action_manage_profiles.png deleted file mode 100755 index 4b059d9cbd..0000000000 Binary files a/OsmAnd/res/drawable-xxxhdpi/ic_action_manage_profiles.png and /dev/null differ diff --git a/OsmAnd/res/drawable-xxxhdpi/ic_action_mode_back.png b/OsmAnd/res/drawable-xxxhdpi/ic_action_mode_back.png deleted file mode 100644 index 70c2040210..0000000000 Binary files a/OsmAnd/res/drawable-xxxhdpi/ic_action_mode_back.png and /dev/null differ diff --git a/OsmAnd/res/drawable-xxxhdpi/ic_action_notification.png b/OsmAnd/res/drawable-xxxhdpi/ic_action_notification.png deleted file mode 100755 index 227795dc1b..0000000000 Binary files a/OsmAnd/res/drawable-xxxhdpi/ic_action_notification.png and /dev/null differ diff --git a/OsmAnd/res/drawable-xxxhdpi/ic_action_privacy_and_security.png b/OsmAnd/res/drawable-xxxhdpi/ic_action_privacy_and_security.png deleted file mode 100755 index 48fbeeb299..0000000000 Binary files a/OsmAnd/res/drawable-xxxhdpi/ic_action_privacy_and_security.png and /dev/null differ diff --git a/OsmAnd/res/drawable/bg_right_menu_dark.xml b/OsmAnd/res/drawable/bg_right_menu_dark.xml new file mode 100644 index 0000000000..8ee6bc688b --- /dev/null +++ b/OsmAnd/res/drawable/bg_right_menu_dark.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/OsmAnd/res/drawable/bg_right_menu_light.xml b/OsmAnd/res/drawable/bg_right_menu_light.xml new file mode 100644 index 0000000000..d277dde63e --- /dev/null +++ b/OsmAnd/res/drawable/bg_right_menu_light.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/OsmAnd/res/drawable/ic_action_add.xml b/OsmAnd/res/drawable/ic_action_add.xml new file mode 100644 index 0000000000..a78016c8bf --- /dev/null +++ b/OsmAnd/res/drawable/ic_action_add.xml @@ -0,0 +1,15 @@ + + + + diff --git a/OsmAnd/res/drawable/ic_action_manage_profiles.xml b/OsmAnd/res/drawable/ic_action_manage_profiles.xml new file mode 100644 index 0000000000..58368d759f --- /dev/null +++ b/OsmAnd/res/drawable/ic_action_manage_profiles.xml @@ -0,0 +1,24 @@ + + + + + + + diff --git a/OsmAnd/res/drawable/ic_action_notification.xml b/OsmAnd/res/drawable/ic_action_notification.xml new file mode 100644 index 0000000000..620f8a873c --- /dev/null +++ b/OsmAnd/res/drawable/ic_action_notification.xml @@ -0,0 +1,19 @@ + + + + + diff --git a/OsmAnd/res/drawable/ic_action_privacy_and_security.xml b/OsmAnd/res/drawable/ic_action_privacy_and_security.xml new file mode 100644 index 0000000000..90695af004 --- /dev/null +++ b/OsmAnd/res/drawable/ic_action_privacy_and_security.xml @@ -0,0 +1,10 @@ + + + diff --git a/OsmAnd/res/drawable/ic_action_transport_stop.xml b/OsmAnd/res/drawable/ic_action_transport_stop.xml new file mode 100644 index 0000000000..4464902bd7 --- /dev/null +++ b/OsmAnd/res/drawable/ic_action_transport_stop.xml @@ -0,0 +1,29 @@ + + + + + + + diff --git a/OsmAnd/res/drawable/img_help_height_limit_day.xml b/OsmAnd/res/drawable/img_help_height_limit_day.xml new file mode 100644 index 0000000000..0942266946 --- /dev/null +++ b/OsmAnd/res/drawable/img_help_height_limit_day.xml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + diff --git a/OsmAnd/res/drawable/img_help_height_limit_night.xml b/OsmAnd/res/drawable/img_help_height_limit_night.xml new file mode 100644 index 0000000000..158ba010c0 --- /dev/null +++ b/OsmAnd/res/drawable/img_help_height_limit_night.xml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + diff --git a/OsmAnd/res/drawable/img_help_weight_limit_day.xml b/OsmAnd/res/drawable/img_help_weight_limit_day.xml new file mode 100644 index 0000000000..0c69c5b2ec --- /dev/null +++ b/OsmAnd/res/drawable/img_help_weight_limit_day.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + diff --git a/OsmAnd/res/drawable/img_help_weight_limit_night.xml b/OsmAnd/res/drawable/img_help_weight_limit_night.xml new file mode 100644 index 0000000000..d055d5802c --- /dev/null +++ b/OsmAnd/res/drawable/img_help_weight_limit_night.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + diff --git a/OsmAnd/res/drawable/img_help_width_limit_day.xml b/OsmAnd/res/drawable/img_help_width_limit_day.xml new file mode 100644 index 0000000000..a33a1fb476 --- /dev/null +++ b/OsmAnd/res/drawable/img_help_width_limit_day.xml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + diff --git a/OsmAnd/res/drawable/img_help_width_limit_night.xml b/OsmAnd/res/drawable/img_help_width_limit_night.xml new file mode 100644 index 0000000000..223a83ab78 --- /dev/null +++ b/OsmAnd/res/drawable/img_help_width_limit_night.xml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + diff --git a/OsmAnd/res/layout-land/fragment_direction_indication_dialog.xml b/OsmAnd/res/layout-land/fragment_direction_indication_dialog.xml index 4463a2d1a6..ab5e850dd8 100644 --- a/OsmAnd/res/layout-land/fragment_direction_indication_dialog.xml +++ b/OsmAnd/res/layout-land/fragment_direction_indication_dialog.xml @@ -20,7 +20,9 @@ android:layout_height="@dimen/dashboard_map_toolbar" android:minHeight="@dimen/dashboard_map_toolbar" app:contentInsetLeft="54dp" - app:contentInsetStart="54dp"> + app:contentInsetStart="54dp" + app:contentInsetRight="0dp" + app:contentInsetEnd="0dp"> + app:contentInsetStart="54dp" + app:contentInsetRight="0dp" + app:contentInsetEnd="0dp"> + app:contentInsetStart="72dp" + app:contentInsetRight="0dp" + app:contentInsetEnd="0dp"> diff --git a/OsmAnd/res/layout/bottom_sheet_item_toolbar_title.xml b/OsmAnd/res/layout/bottom_sheet_item_toolbar_title.xml index dfc6c95148..c4cc113ff6 100644 --- a/OsmAnd/res/layout/bottom_sheet_item_toolbar_title.xml +++ b/OsmAnd/res/layout/bottom_sheet_item_toolbar_title.xml @@ -7,7 +7,9 @@ android:layout_height="@dimen/bottom_sheet_selected_item_title_height" android:minHeight="@dimen/bottom_sheet_selected_item_title_height" osmand:contentInsetLeft="54dp" - osmand:contentInsetStart="54dp"> + osmand:contentInsetStart="54dp" + osmand:contentInsetRight="0dp" + osmand:contentInsetEnd="0dp"> - @@ -31,7 +31,7 @@ android:textColor="@color/gpx_chart_blue" android:textStyle="bold" android:ellipsize="end" - android:singleLine="true"/> + android:maxLines="1"/> + android:maxLines="1"/> @@ -74,7 +74,7 @@ android:textColor="@color/gpx_chart_orange" android:textStyle="bold" android:ellipsize="end" - android:singleLine="true"/> + android:maxLines="1"/> + android:maxLines="1"/> @@ -109,7 +109,7 @@ android:textColor="@color/gpx_chart_green" android:textStyle="bold" android:ellipsize="end" - android:singleLine="true"/> + android:maxLines="1"/> + android:maxLines="1"/> - \ No newline at end of file + \ No newline at end of file diff --git a/OsmAnd/res/layout/dashboard_toolbar.xml b/OsmAnd/res/layout/dashboard_toolbar.xml index c893d6c493..59317ed639 100644 --- a/OsmAnd/res/layout/dashboard_toolbar.xml +++ b/OsmAnd/res/layout/dashboard_toolbar.xml @@ -8,7 +8,9 @@ android:layout_height="@dimen/dashboard_map_toolbar" android:background="@color/app_bar_color_light" app:contentInsetLeft="4dp" - app:contentInsetStart="4dp"> + app:contentInsetStart="4dp" + app:contentInsetRight="0dp" + app:contentInsetEnd="0dp"> + app:contentInsetStart="54dp" + app:contentInsetRight="0dp" + app:contentInsetEnd="0dp"> + app:contentInsetStart="@dimen/settings_divider_margin_start" + app:contentInsetRight="0dp" + app:contentInsetEnd="0dp"/> + app:contentInsetStart="54dp" + app:contentInsetRight="0dp" + app:contentInsetEnd="0dp"> + android:src="@drawable/ic_arrow_back"/> + osmand:contentInsetStart="54dp" + osmand:contentInsetRight="0dp" + osmand:contentInsetEnd="0dp"> + app:contentInsetStart="0dp" + app:contentInsetRight="0dp" + app:contentInsetEnd="0dp"> + android:src="@drawable/ic_arrow_back" /> + app:contentInsetStart="0dp" + app:contentInsetRight="0dp" + app:contentInsetEnd="0dp"> + android:src="@drawable/ic_arrow_back" /> + app:contentInsetStart="72dp" + app:contentInsetRight="0dp" + app:contentInsetEnd="0dp" /> diff --git a/OsmAnd/res/layout/local_index_live_updates_list_item.xml b/OsmAnd/res/layout/local_index_live_updates_list_item.xml index 25c0400ba6..84bb83b093 100644 --- a/OsmAnd/res/layout/local_index_live_updates_list_item.xml +++ b/OsmAnd/res/layout/local_index_live_updates_list_item.xml @@ -1,12 +1,12 @@ + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="?attr/bg_color" + android:descendantFocusability="blocksDescendants" + android:minHeight="@dimen/list_item_height" + android:orientation="horizontal"> + android:layout_centerVertical="true" + android:src="@drawable/ic_map" + android:contentDescription="@string/map_downloaded" /> + tools:text="Belarus" /> + tools:visibility="gone" /> + tools:text="Last Update: 1 Dec 2015" /> + android:src="@drawable/ic_overflow_menu_white" /> + android:background="?attr/dashboard_divider" /> \ No newline at end of file diff --git a/OsmAnd/res/layout/main_menu_drawer_btn_configure_profile.xml b/OsmAnd/res/layout/main_menu_drawer_btn_configure_profile.xml index c3efbab785..89face3c23 100644 --- a/OsmAnd/res/layout/main_menu_drawer_btn_configure_profile.xml +++ b/OsmAnd/res/layout/main_menu_drawer_btn_configure_profile.xml @@ -37,7 +37,8 @@ diff --git a/OsmAnd/res/layout/map_context_menu_fragment.xml b/OsmAnd/res/layout/map_context_menu_fragment.xml index 6089fbc5e2..6c87325935 100644 --- a/OsmAnd/res/layout/map_context_menu_fragment.xml +++ b/OsmAnd/res/layout/map_context_menu_fragment.xml @@ -548,7 +548,9 @@ android:layout_height="@dimen/dashboard_map_toolbar" android:background="@color/app_bar_color_light" app:contentInsetLeft="4dp" - app:contentInsetStart="4dp"> + app:contentInsetStart="4dp" + app:contentInsetRight="0dp" + app:contentInsetEnd="0dp"> + android:src="@drawable/ic_arrow_back"/> + app:contentInsetRight="0dp" + app:contentInsetEnd="0dp"/> + android:paddingStart="@dimen/list_content_padding" + android:paddingRight="0dp" + android:paddingEnd="0dp"> + + app:contentInsetStart="72dp" + app:contentInsetRight="0dp" + app:contentInsetEnd="0dp"> diff --git a/OsmAnd/res/layout/profile_preference_toolbar.xml b/OsmAnd/res/layout/profile_preference_toolbar.xml index 45e7db5c82..0460fca8a2 100644 --- a/OsmAnd/res/layout/profile_preference_toolbar.xml +++ b/OsmAnd/res/layout/profile_preference_toolbar.xml @@ -7,6 +7,8 @@ android:minHeight="@dimen/dashboard_map_toolbar" osmand:contentInsetLeft="0dp" osmand:contentInsetStart="0dp" + osmand:contentInsetRight="0dp" + osmand:contentInsetEnd="0dp" osmand:theme="@style/ThemeOverlay.AppCompat.ActionBar"> + osmand:contentInsetStart="0dp" + osmand:contentInsetRight="0dp" + osmand:contentInsetEnd="0dp"> + app:contentInsetStart="54dp" + app:contentInsetRight="0dp" + app:contentInsetEnd="0dp"> + app:contentInsetStart="54dp" + app:contentInsetRight="0dp" + app:contentInsetEnd="0dp"> + app:contentInsetStart="54dp" + app:contentInsetRight="0dp" + app:contentInsetEnd="0dp"> @@ -40,6 +42,8 @@ android:visibility="gone" app:contentInsetLeft="54dp" app:contentInsetStart="54dp" + app:contentInsetRight="0dp" + app:contentInsetEnd="0dp" tools:visibility="visible"> + app:contentInsetStart="54dp" + app:contentInsetRight="0dp" + app:contentInsetEnd="0dp"> diff --git a/OsmAnd/res/layout/search_history_list_item.xml b/OsmAnd/res/layout/search_history_list_item.xml index 3d639352d7..bf93b9ac4c 100644 --- a/OsmAnd/res/layout/search_history_list_item.xml +++ b/OsmAnd/res/layout/search_history_list_item.xml @@ -21,7 +21,9 @@ android:descendantFocusability="blocksDescendants" android:orientation="horizontal" android:paddingLeft="@dimen/list_content_padding" - android:paddingStart="@dimen/list_content_padding"> + android:paddingStart="@dimen/list_content_padding" + android:paddingRight="0dp" + android:paddingEnd="0dp"> + app:contentInsetStart="54dp" + app:contentInsetRight="0dp" + app:contentInsetEnd="0dp"> + app:contentInsetStart="54dp" + app:contentInsetRight="0dp" + app:contentInsetEnd="0dp"> diff --git a/OsmAnd/res/layout/wikipedia_dialog_fragment.xml b/OsmAnd/res/layout/wikipedia_dialog_fragment.xml index dbc5444ea2..37429ac0eb 100644 --- a/OsmAnd/res/layout/wikipedia_dialog_fragment.xml +++ b/OsmAnd/res/layout/wikipedia_dialog_fragment.xml @@ -17,7 +17,9 @@ android:gravity="center_vertical" android:minHeight="@dimen/toolbar_height" osmand:contentInsetLeft="54dp" - osmand:contentInsetStart="54dp"> + osmand:contentInsetStart="54dp" + osmand:contentInsetRight="0dp" + osmand:contentInsetEnd="0dp"> + osmand:contentInsetStart="54dp" + app:contentInsetRight="0dp" + app:contentInsetEnd="0dp"> تغيير قياس زاوية الازيموث. طول \"%s\" قيمة تعرف على المزيد حول كيفية حساب أوسماند للطرق في مدونتنا. - يخضع التنقل في وسائل النقل العام حالياً للاختبار التجريبي ، ويتوقع الأخطاء . + يخضع التنقل في وسائل النقل العام حاليًا للاختبار التجريبي ، ويتوقع أن يكون فيه أخطاء . إضافة نقطة وسيطة %1$d تحويلات ضبط diff --git a/OsmAnd/res/values-cs/strings.xml b/OsmAnd/res/values-cs/strings.xml index 25d6d37d68..a3ee0f18be 100644 --- a/OsmAnd/res/values-cs/strings.xml +++ b/OsmAnd/res/values-cs/strings.xml @@ -3424,4 +3424,23 @@ Zobrazená oblast: %1$s x %2$s Zkombinujte body zájmu různých kategorií. Klepnutím na přepínač vyberete všechny, klepnutím na levou stranu vyberete kategorie. Další mapy Nepodporovaná akce %1$s + Akce kontextového menu + Seřaďte nebo skryjte položky z %1$s. + Oddělovač + Na této pozici bude umístěn oddělovač. + Skryté + Tyto položky jsou skryté z menu, ale příslušná nastavení a moduly zůstanou funkční. + Skrytá nastavení se resetují do svého původního stavu. + Stopování OsmAnd + OsmAnd + Mapillary + Rychlá akce + Kruhové pravítko + Měřit vzdálenost + Cestování (Wikivoyage a Wikipedie) + Mapové značky + Oblíbené + Předplatné - OsmAnd Live + Nákupy v OsmAnd + Průvodce symboly na mapě + Navigační profily \ No newline at end of file diff --git a/OsmAnd/res/values-es-rAR/strings.xml b/OsmAnd/res/values-es-rAR/strings.xml index 7cd506e9e2..fb0b1a1656 100644 --- a/OsmAnd/res/values-es-rAR/strings.xml +++ b/OsmAnd/res/values-es-rAR/strings.xml @@ -2915,7 +2915,7 @@ Lon %2$s En %1$s Giro a giro Tipos de caminos - Bajarse en + Bajar en Esperar en la parada Mostrar/ocultar trazas GPX Un botón que muestra u oculta las trazas GPX elegidas en el mapa. @@ -2989,7 +2989,7 @@ Lon %2$s Lea más sobre el cálculo de las rutas de OsmAnd en nuestro blog. La navegación en transporte público se encuentra actualmente en fase de pruebas beta, se esperan errores e imprecisiones. Añadir punto intermedio - A pie + Caminar Acorte la longitud de la etiqueta «%s» a menos de 255 caracteres. Longitud del valor de «%s» Marca los tipos de transporte público a evitar para la navegación: diff --git a/OsmAnd/res/values-es-rUS/strings.xml b/OsmAnd/res/values-es-rUS/strings.xml index 2c295266e6..cb8671410a 100644 --- a/OsmAnd/res/values-es-rUS/strings.xml +++ b/OsmAnd/res/values-es-rUS/strings.xml @@ -2915,7 +2915,7 @@ Lon %2$s En %1$s Giro a giro Tipos de caminos - Bajarse en + Bajar en Esperar en la parada Mostrar/ocultar trazas GPX Un botón que muestra u oculta las trazas GPX elegidas en el mapa. @@ -2989,7 +2989,7 @@ Lon %2$s Lea más sobre el cálculo de las rutas de OsmAnd en nuestro blog. La navegación en transporte público se encuentra actualmente en fase de pruebas beta, se esperan errores e imprecisiones. Añadir punto intermedio - A pie + Caminar Acorte la longitud de la etiqueta «%s» a menos de 255 caracteres. Longitud del valor de «%s» Marca los tipos de transporte público a evitar para la navegación: diff --git a/OsmAnd/res/values-fa/strings.xml b/OsmAnd/res/values-fa/strings.xml index e14f34a3fb..383d229d84 100644 --- a/OsmAnd/res/values-fa/strings.xml +++ b/OsmAnd/res/values-fa/strings.xml @@ -3713,4 +3713,7 @@ برگزیده‌ها اشتراک - OsmAnd Live خریدهای OsmAnd + سیسیلی + قزاقی + پنجابی \ No newline at end of file diff --git a/OsmAnd/res/values-fi/strings.xml b/OsmAnd/res/values-fi/strings.xml index 2992238c53..a77d2ff006 100644 --- a/OsmAnd/res/values-fi/strings.xml +++ b/OsmAnd/res/values-fi/strings.xml @@ -2537,4 +2537,11 @@ Jos pidät OsmAndista ja OSMsta ja haluat tukea niitä, on tämä täydellinen t Suosi päällystämättömiä teitä Suosi päällystämättömiä teitä Perillä %1$s + Mittaa etäisyys + Karttamarkkerit + Suosikit + Tilaus - OsmAnd Live + OsmAnd ostot + Kartan symboliikkaopas + Navigointiprofiilit \ No newline at end of file diff --git a/OsmAnd/res/values-hu/strings.xml b/OsmAnd/res/values-hu/strings.xml index 10c692fce6..cd55d01745 100644 --- a/OsmAnd/res/values-hu/strings.xml +++ b/OsmAnd/res/values-hu/strings.xml @@ -3532,9 +3532,9 @@ Ha szereted az OsmAndot és az OSM-et, és szeretnéd támogatni a fejlődésük Túrasízés Motoros hószán Egyéni OsmAnd bővítmény - %1$s olvasása sikertelen. - %1$s írása sikertelen. - %1$s importálása sikertelen. + Sikertelen olvasás innen: \'%1$s\'. + Sikertelen írás ide: \'%1$s\'. + Sikertelen importálás innen: \'%1$s\'. Felhasználói felület testreszabása Menü %1$s: elemek átrendezése vagy elrejtése. @@ -3548,7 +3548,7 @@ Ha szereted az OsmAndot és az OSM-et, és szeretnéd támogatni a fejlődésük Rendezés kategória szerint Antarktika Rejtett - A beállítások az eredeti állapotba fognak visszaállni elrejtés után. + A beállítások elrejtése visszaállítja őket az eredeti állapotukba. Fő műveletek Csak ezen a kategórián belül lehetséges az elemek áthelyezése. Fejlesztő bővítmény @@ -3562,7 +3562,7 @@ Ha szereted az OsmAndot és az OSM-et, és szeretnéd támogatni a fejlődésük Opciók menü elemei Személyre szabhatja az elemek számát a Menüben, a Térkép beállításában és az Opciókban. \n -\nA használaton kívüli bővítmények letiltásával elrejtheti őket a %1$s menüből. +\nA használaton kívüli bővítmények kikapcsolásával elrejtheti őket a %1$s menüből. Menü elemek, Opciók Jelölje ki a térképen megjelenő Wikipédia szócikkek nyelvét. A szócikk olvasása közben válthat valamennyi elérhető nyelv között. Előfordulhat, hogy néhány Wikipédia szócikk nem érhető el az ön nyelvén. @@ -3596,4 +3596,16 @@ Ha szereted az OsmAndot és az OSM-et, és szeretnéd támogatni a fejlődésük lombard Egyéni szín Egyéb térképek + OsmAnd helymegosztás + OsmAnd + Mapillary + Gyorsművelet + Sugaras vonalzó + Távolságmérés + Utazás (Wikivoyage és Wikipédia) + Térképjelölők + Kedvencek + Előfizetés - OsmAnd Live + OsmAnd vásárlások + Útmutató a térkép szimbolikájához + Navigációs profilok \ No newline at end of file diff --git a/OsmAnd/res/values-nb/strings.xml b/OsmAnd/res/values-nb/strings.xml index 6c4bc31c79..3111367ad9 100644 --- a/OsmAnd/res/values-nb/strings.xml +++ b/OsmAnd/res/values-nb/strings.xml @@ -3534,4 +3534,14 @@ Tilbakestill programtilleggsinnstillinger til forvalg Ustøttet handling %1$s Ekstra kart + Inndeler + Det kan hende noen Wikipedia-artikler ikke finnes på norsk. + Egendefinert farge + Søk etter interessepunkttyper + Hurtighandling + OsmAnd-kjøp + Favoritter + Kartmarkører + Mål avstand + Reising (Wikivoyage og Wikipedia) \ No newline at end of file diff --git a/OsmAnd/res/values-nl/strings.xml b/OsmAnd/res/values-nl/strings.xml index 1899ba99af..844e106bd4 100644 --- a/OsmAnd/res/values-nl/strings.xml +++ b/OsmAnd/res/values-nl/strings.xml @@ -2270,10 +2270,9 @@ voor Gebied: %1$s x %2$s Ga ook over privé-terreinen. Zoomniveau weergave: %1$s Voor grote afstanden: voeg tussenpunten toe als binnen de 10 minuten geen route berekend is. - OsmAnd (OSM, Automated Navigation Directions) is een kaart- en navigatieprogramma dat de gratis, wereldwijde en gedetailleerde OpenStreetMap (OSM) data gebruikt. -\n -\n -\nGebruikt visuele en gesproken navigatie, toont POI\'s (point of interest), maakt en volgt GPX-tracks, toont hoogtelijnen en hoogte informatie (via plug-in), kiest tussen auto, fiets, wandelen of andere, je kan de OSM-kaart bewerken en nog veel meer. + "OsmAnd (OSM, Automated Navigation Directions) is een kaart- en navigatieprogramma dat de gratis, wereldwijde en gedetailleerde OpenStreetMap (OSM) data gebruikt. +\n +\nGebruikt visuele en gesproken navigatie, toont POI\'s (point of interest), maakt en volgt GPX-tracks, toont hoogtelijnen en hoogte informatie (via plug-in), kiest tussen auto, fiets, wandelen of andere, je kan de OSM-kaart bewerken en nog veel meer." " GPS-navigatie • Offline (geen datakosten) of online (snellere) routeberekening @@ -2565,7 +2564,7 @@ voor Gebied: %1$s x %2$s Kaartupdates: Elk uur In-app aankoop Eenmalige betaling - "Eens aangekocht, kun je het permanent blijven gebruiken." + Eens aangekocht, kun je het permanent blijven gebruiken. %1$s Kopen Wikivoyage offline Onbeperkte downloads @@ -3371,9 +3370,9 @@ voor Gebied: %1$s x %2$s Kies een naam voor het profiel Open instellingen Plugin uitgeschakeld - Deze plugin is een afzonderlijke App. Je zal die afzonderlijk dienen te verwijderen als je die niet meer nodig denkt te hebben. -\n -\nDe plugin blijft op je toestel bij het verwijderen van OsmAnd. + "Deze plug-in is een afzonderlijke App, je zal die afzonderlijk dienen te verwijderen als je die niet meer nodig denkt te hebben. +\n +\nDe plug-in blijft op je toestel bij het verwijderen van OsmAnd." Menu %1$s — %2$s — %3$s Routering @@ -3423,4 +3422,19 @@ voor Gebied: %1$s x %2$s cirkel Ruit Min + Combineer POI-types uit verschillende categorieën. Tik op \"Schakelen\" om alles te selecteren, tik op de linkerkant voor de categoriekeuze. + Extra kaarten + Niet ondersteunde actie %1$s + OsmAnd zoeker + OsmAnd & Mapillary + Snelle actie + Radius liniaal + Afstand meten + Reizen (Wikivoyage en Wikipedia) + Markeervlaggetjes + Favorieten + Abonnement - OsmAnd Live + OsmAnd aankopen + De gids voor de kaartsymbolen + Navigatieprofielen \ No newline at end of file diff --git a/OsmAnd/res/values-pl/strings.xml b/OsmAnd/res/values-pl/strings.xml index b71b1fc492..2145f702d1 100644 --- a/OsmAnd/res/values-pl/strings.xml +++ b/OsmAnd/res/values-pl/strings.xml @@ -2442,8 +2442,8 @@ Reprezentuje obszar: %1$s x %2$s Porządkowanie według: Linie przewodnie Strzałki na mapie - Wyświetl ominięte - Ukryj ominięte + Wyświetl odwiedzone + Ukryj odwiedzone Wprowadź współrzędne Znaczniki Format współrzędnych @@ -2564,8 +2564,8 @@ Reprezentuje obszar: %1$s x %2$s Z lewej Wyświetl klawiaturę numeryczną Przesuń cel w górę i utwórz go - Na tym ekranie zostaną wyświetlone znaczniki oznaczone jako pominięte. - Oznacz jako pominięty + Na tym ekranie zostaną wyświetlone znaczniki oznaczone jako odwiedzone. + Oznacz jako odwiedzony Wprowadź długość geograficzną Wprowadź szerokość geograficzną Wprowadź szerokość i długość @@ -2841,14 +2841,14 @@ Reprezentuje obszar: %1$s x %2$s \n Czarny Przywróć - Zachowanie miniętych znaczników na mapie + Pokazuj na mapie odwiedzone znaczniki Na tym przystanku można skorzystać z większej ilości środków transportu. Usunąć znacznik mapy „%s”\? Edytuj znacznik mapy Aplikacja innej firmy Wyszukaj ulicę Najpierw wybierz miasto/miejscowość - Znaczniki dodane jako grupa ulubionych lub punkty trasy GPX oznaczone jako przekazane pozostaną na mapie. Jeśli grupa nie jest aktywna, znaczniki znikną z mapy. + Znaczniki dodane jako grupa ulubionych lub punkty trasy GPX oznaczone jako odwiedzone pozostaną na mapie. Jeśli grupa nie jest aktywna, znaczniki znikną z mapy. Plan i ceny Co miesiąc Raz na 3 miesiące diff --git a/OsmAnd/res/values-pt-rBR/strings.xml b/OsmAnd/res/values-pt-rBR/strings.xml index 6e03e4829f..bc16fce3fe 100644 --- a/OsmAnd/res/values-pt-rBR/strings.xml +++ b/OsmAnd/res/values-pt-rBR/strings.xml @@ -2976,7 +2976,7 @@ Pôr do Sol: %2$s Leia mais sobre o roteamento OsmAnd em nosso blog. A navegação de transporte público está atualmente em teste beta, espere erros e imprecisões. Adicionar ponto intermediário - Ande + A pé Reduza o comprimento da tag \"%s\" para menos de 255 caracteres. Comprimento do valor \"%s\" Selecione os tipos de transporte público a evitar para navegação: diff --git a/OsmAnd/res/values-pt/phrases.xml b/OsmAnd/res/values-pt/phrases.xml index f75dc4d647..203eb822d2 100644 --- a/OsmAnd/res/values-pt/phrases.xml +++ b/OsmAnd/res/values-pt/phrases.xml @@ -820,8 +820,8 @@ Acesso à Internet: serviço Com acesso à Internet Sem acesso à Internet - Acesso à Internet pago - Acesso à Internet grátis + Acesso à Internet: taxa paga + Acesso à Internet: grátis Mosteiro Área religiosa Cruz de beira de estrada @@ -3769,4 +3769,38 @@ Ativo Inativo Quantidade de erupções + Rede de reabastecimento de água potável + Reabastecimento de água potável: não + Reabastecimento de água potável: sim + Obstrução + Nível da água: abaixo do nível médio da água + Nível da água: acima do nível médio da água + Nível da água: flutuante + Nível da água: inundações + Nível da água: inundado + Nível da água: cobre + Nível de água: seco + Nível da água: submerso + Nível da água: parcialmente submerso + Incorreto + Primitivo + Contrastado + Somente quando é permitido caminhar + Sinal para encontrar o poste + Não + Sim + Tipo de cabine + Cabine + Não + Sim + Centro de mergulho Scuba + Base de caça + Número de referência da pista + Centro de boliche + Loja de segurança + Resgate na montanha + Paintball + Bicicleta fantasma + Vídeo + SMS \ No newline at end of file diff --git a/OsmAnd/res/values-pt/strings.xml b/OsmAnd/res/values-pt/strings.xml index 10aa8d7d34..8d09e17744 100644 --- a/OsmAnd/res/values-pt/strings.xml +++ b/OsmAnd/res/values-pt/strings.xml @@ -3652,11 +3652,9 @@ Perfis de navegação Pesquisar tipos de poi %1$s / %2$s - O pagamento será cobrado na sua conta do Google Play na confirmação da compra. -\n -\nA assinatura é renovada automaticamente, a menos que seja cancelada antes da data de renovação. Sua conta será cobrada pelo período de renovação (mensal/trimestrial/anual) somente na data de renovação. -\n -\nPode gerir e cancelar suas assinaturas acessando as configurações do Google Play. + A sua conta Google Play é cobrada no momento da compra de uma assinatura +\ne quando expirar (mês/três mês/ano), +\nnão se renovará se cancelado antes disso a partir das suas configurações do Google Play. Ação %1$s não suportada Mapas adicionais Alguns artigos da Wikipédia podem não estar disponíveis no seu idioma. @@ -3688,4 +3686,5 @@ Aragonês Lombardo Cor customizada + Combinar tipos de POI de diferentes categorias. Toque em \"Trocar\" para selecionar tudo, toque no lado esquerdo para seleção da categoria. \ No newline at end of file diff --git a/OsmAnd/res/values-sc/strings.xml b/OsmAnd/res/values-sc/strings.xml index dc76871aa6..fa74fb82d5 100644 --- a/OsmAnd/res/values-sc/strings.xml +++ b/OsmAnd/res/values-sc/strings.xml @@ -1144,8 +1144,8 @@ Chirca indiritzu… Chirca indiritzu cun OSM Nominatim Chirca in lìnia: nùmeru tzìvicu, carrera, tzitade - Chene lìnia - Ìnternet + Chirca chene lìnia + Chirca in lìnia Max ismanniamentu in lìnia Non chircare mapas a tasseddos pro ismanniamentos prus mannos de custu. Distàntzia totale %1$s, longària de su biàgiu %2$d h %3$d min. @@ -1744,7 +1744,7 @@ Lon %2$s Preguntas fitianas (FAQ) Dimandas fitianas Visione de sa mapa - Chircare in sa mapa + Chirchende in sa mapa Pranificare unu biàgiu Installatzione e solutziones a sos problemas Artìculos tècnicos @@ -3610,10 +3610,10 @@ Pro praghere iscrie su còdighe intreu Iscì-alpinismu Motoislita Estensione de OsmAnd personalizada - Modìficas aplicadas a su profilu %1$s. - Leghidura de %1$s fallida. - Iscritura de %1$s fallida. - Importatzione de %1$s fallida. + Modìficas aplicadas a su profilu \'%1$s\'. + Leghidura dae \'%1$s\' fallida. + Iscritura in \'%1$s\' fallida. + Importatzione dae \'%1$s\' fallida. Ischerta su documentu de sa rasta Limbas Limba @@ -3631,8 +3631,8 @@ Pro praghere iscrie su còdighe intreu Elementos in suta de custu puntu iscrobados dae unu separadore. Cuadu Custos elementos sunt cuados dae su menù, ma sas optziones o sas estensiones rapresentadas ant a sighire a funtzionare. - Sas impostatziones ant a torrare a sos valores predefinidos a pustis de sa cuadura. - Sas atziones printzipales cuntenent 4 butones ebbia. + Cuende sas impostatziones las as a torrare a sos istados predefinidos issoro. + Sas \'atziones printzipales\' cuntenent 4 butones ebbia. Atziones printzipales Podes mòere elementos in intro de custa categoria ebbia. Estensione pro sos isvilupadores @@ -3669,12 +3669,22 @@ Pro praghere iscrie su còdighe intreu Colore personalizadu Mapas additzionales Atzione %1$s non suportada - Su pagamentu at a èssere addebitadu a su contu tuo de Google Play cando sa còmpora at a èssere cunfirmada. -\n -\nS\'abbonamentu si rinnovat a sa sola automaticamente, francu chi siat istadu annulladu in antis de sa die de su rinnovu. Su contu tuo at a bènnere addebitadu pro su perìodu de rinnovu (mese/tres meses/annu) in sa die de rinnovu ebbia. -\n -\nPodes amministrare e annullare sos abbonamentos tuos intrende in sas impostatziones de Google Play tuas. + Su pagamentu at a èssere addebitadu a su contu tuo de Google Play cando as a comporare un\'abbonamentu +\ne cando at a iscadire su tempus (unu mese/tres meses/un\'annu), +\nno at a èssere rinnovadu si l\'as a àere annulladu, in antis de cussu momentu, dae sas impostatziones de Google Play tuas. Chirca castas de PDI - Cumbina castas de PDI de catogorias diferentes. Incarca su buone pro ischertare totu, incarca s\'ala a manca pro sa seletzione de sas categorias. + Cumbina castas de PDI de catogorias diferentes. Incarca su butone pro ischertare totu, incarca s\'ala a manca pro sa seletzione de sas categorias. %1$s / %2$s + Arrastadore de OsmAnd + OsmAnd + Mapillary + Atzione lestra + Medidura cun su raju + Medi una distàntzia + Biàgiu (Wikivoyage e Wikipedia) + Marcadores mapa + Preferidos + Abbonamentos - OsmAnd Live + Còmporas de OsmAnd + Sa ghia pro sa simbologia de sa mapa + Profilos de navigatzione \ No newline at end of file diff --git a/OsmAnd/res/values-tr/strings.xml b/OsmAnd/res/values-tr/strings.xml index 1889866479..758a7d2422 100644 --- a/OsmAnd/res/values-tr/strings.xml +++ b/OsmAnd/res/values-tr/strings.xml @@ -2420,7 +2420,7 @@ %s modu Kaçınılacak taşıma türleri… Yürü - Toplu taşıma rotaları beta aşamasındadır. + Toplu taşıma navigasyonu şu anda beta testindedir, hatalar ve yanlışlıklar olabilir. Ara nokta ekle Kalkış ve varış noktası ekle Kalkış noktası ekle @@ -2695,7 +2695,7 @@ Kamp aracı (RV) Haritada Düşük Emisyon Bölgelerini göster. Yönlendirmeyi etkilemez. Düşük Emisyon Bölgelerini göster - Geçici sınırlamaları göz önünde bulundurun + Geçici sınırlamaları göz önünde bulundur Öntanımlı Vagon Kamyonet diff --git a/OsmAnd/res/values-uk/strings.xml b/OsmAnd/res/values-uk/strings.xml index 5c07255f3b..c7f4c63438 100644 --- a/OsmAnd/res/values-uk/strings.xml +++ b/OsmAnd/res/values-uk/strings.xml @@ -920,7 +920,7 @@ Стандартна мапа OsmAnd (OSM Automated Navigation Directions) \n -\n OsmAnd — навігаційне програмне забезпечення з відкритим кодом з доступом до різноманітних картографічних даних від OSM. Всі землеписні дані (векторні та растрові) можуть бути збережені на карті пам’яті телефону для подальшого автономного використання. Також пропонується функція маршрутизації в автономному режимі та в мережевому режимі, включаючи покрокові голосові підказки. +\n OsmAnd — навігаційне програмне забезпечення з відкритим кодом з доступом до різноманітних картографічних даних від OSM. Всі землеписні дані (векторні та растрові) можуть бути збережені на карті пам’яті телефону для подальшого автономного користування. Також пропонується функція маршрутизації в автономному режимі та в мережевому режимі, включно з покроковими голосовими підказками. \n \n Кілька основних можливостей: \n - повноцінна робота без інтернет-з’єднання (просто збережіть векторні чи растрові дані на пристрій) @@ -929,10 +929,11 @@ \n - можливе накладання декількох шарів мапи, такі як GPX- або навігаційні треки, POI, Закладки, горизонталі, зупинки громадського транспорту, додаткові мапи з налаштовуваною прозорістю \n - автономний пошук адрес та POI \n - автономне прокладання маршрутів середньої дальності -\n - режими для пішохідної, автомобільної та велонавігації з опціональними: - автоматичним перемиканням до денного/нічного режиму мапи +\n - режими для пішохідної, автомобільної та велонавігації з опціональними: +\n - автоматичним перемиканням денного/нічного режиму мапи \n - самостійним масштабуванням мапи відповідно до швидкості руху \n - можливістю орієнтації мапи за компасом чи напрямком руху -\n - веденням по смугах руху, відображенням обмежень швидкості, записаними та синтезованими голосами супроводу +\n - веденням по смугах руху, показом обмежень швидкості, записаними та синтезованими голосами супроводу \n \n Обмеження цієї безкоштовної версії OsmAnd: \n - кількість завантажень мап є обмеженою @@ -1778,7 +1779,7 @@ Питання та відповіді Часті запитання Перегляд мапи - Пошук мапи + Пошук на мапі Встановлення та вирішення проблем Технічні статті Версії @@ -2003,7 +2004,7 @@ Ви досі не маєте жодних GPX-файлів Ви також можете додати GPX-файли до теки Додати ще… - Вигляд + Зовнішній вигляд Ввімкнути швидкий запуск запису Показувати сповіщення, яке дозволить почати запис мандрівки. Повідомлення @@ -2054,7 +2055,7 @@ У Вас немає завантажених мап. Ви можете вибрати мапу зі списку або завантажити її пізніше за допомогою меню — %1$s. Виберіть інший регіон Пошук мапи… - OsmAnd визначить Ваше місце розташування і запропонує завантажити мапи для цього регіону. + OsmAnd визначить ваше місце розташування і запропонує завантажити мапи для цього регіону. Неможливо визначити місце розташування З’єднання з Інтернетом відсутнє Необхідно завантажити мапи. @@ -3090,24 +3091,26 @@ Збій Під час останнього запуску OsmAnd сталася помилка. Допоможіть нам покращити OsmAnd - надішліть повідомлення про помилку. НЛО - • Профілі застосунку: створюйте довільний профіль з довільною піктограмою та кольором для Ваших особистих потреб + • Профілі застосунку: створюйте власний профіль з довільною піктограмою та кольором для ваших особистих потреб \n -\n• Налаштовуйте типову та мінімальну/максимальну швидкості профілю +\n• Налаштуйте типову мінімальну/максимальну швидкості профілю \n \n• Додано віджет з поточними координатами \n -\n• Додано можливість відображати на мапі компас і радіус-лінійку +\n• Додано можливість показувати на мапі компас і радіус-лінійку \n -\n• Виправлено записування треку у тлі +\n• Виправлено записування шляху у тлі \n \n• Покращено завантаження мап у тлі -\n +\n +\n• Повернено параметр \'Увімкнути екран\' +\n \n• Виправлено вибір мови Wikipedia \n -\n• Виправлено поведінку кнопки компасу під час навігації -\n -\n• Інші виправлення помилок +\n• Виправлено поведінку кнопки компаса під час навігації \n +\n• Інші виправлення помилок +\n \n Особистий перевізник Одноколісний @@ -3443,7 +3446,7 @@ OSM Значок відображається під час навігації чи переміщення. Значок показано в спокої. - Перевіряти та обмінюватися докладними журналами застосунку + Перевіряти та обмінюватися докладними журналами програми Не вдалося розібрати метод \'%s\'. Для використання цього параметра потрібен дозвіл. Це низькошвидкісний відсічний фільтр, щоб не записувати точки нижче певної швидкості. Це може призвести до плавнішого вигляду записаних треків при перегляді на мапі. @@ -3519,7 +3522,7 @@ Укажіть назву профілю Відкрити налаштування Втулок вимкнено - Цей втулок - окремий застосунок, його потрібно буде видалити окремо, якщо Ви більше не плануєте ним користуватися. + Цей плагін є окремою програмою, якщо ви не плануєте користуватися ним надалі, його потрібно буде видалити окремо. \n \nВтулок залишиться на пристрої після видалення OsmAnd. Меню @@ -3562,12 +3565,12 @@ Ви впевнені, що хочете очистити записані дані\? Імпорт даних з %1$s Імпорт - OsmAnd перевірить %1$s на наявність подвоєнь із наявними елементами у застосунку. + OsmAnd перевірить %1$s на наявність подвоєнь із наявними елементами у програмі. \n \nЦе може зайняти деякий час. Елементи додано Імпорт завершено - Усі дані з %1$s імпортуються, Ви можете використовувати кнопки нижче, щоб відкрити необхідну частину застосунку для управління ними. + Усі дані з %1$s імпортовано, ви можете користуватися іншими кнопками, щоби відкрити потрібну частину програми для керування нею. Маршрут буде перераховано, якщо відстань від маршруту до поточного місця розташування перевищує вибране значення. Виберіть відстань, після якого маршрут буде перераховано. Перерахунок маршруту у випадку відхилення @@ -3602,18 +3605,18 @@ Гірськолижний туризм Снігохід Користувацький втулок OsmAnd - Зміни застосовано до профілю %1$s. - Не вдається прочитати %1$s. - Не вдалося записати %1$s. - Не вдалося імпортувати %1$s. + Зміни застосовано до профілю \'%1$s\'. + Не вдається прочитати з \'%1$s\'. + Не вдалося записати до \'%1$s\'. + Не вдалося імпортувати з \'%1$s\'. Виберіть файл треку Мови Мова Усі мови Для перегляду POI Вікіпедії на мапі потрібні додаткові мапи. - Налаштуйте кількість елементів у скриньці, Налаштування мапи та контекстного меню. + Налаштуйте кількість елементів у скриньці, налаштуйте мапу та контекстне меню. \n -\nВи можете вимкнути невикористані втулки, щоб приховати всі їх елементи керування від застосунку. +\nВи можете вимкнути непотрібні плагіни, щоби приховати всі їхні елементи керування у програмі%1$s. Елементи скриньки, контекстне меню Налаштування інтерфейсу Скринька @@ -3622,14 +3625,14 @@ Дільник Елементи нижче цієї точки розділені дільником. Приховано - Ці елементи приховані від меню, але подані параметри або втулки залишаться справними. - Після приховування налаштування буде повернено до початкового стану. - Основні дії містять лише 4 кнопки. + Ці елементи приховані з меню, але встановлені параметри або плагіни продовжать роботу. + Приховування налаштувань призведе до скидання до їхнього початкового стану. + \'Основні дії\' містять лише 4 кнопки. Основні дії Ви можете переміщувати елементи лише всередині цієї категорії. Втулок розробника Елементи - Виберіть мови, якими статті на Вікіпедії з’являться на мапі. Під час читання статті ви можете переключатися між усіма доступними мовами. + Виберіть мови, якими статті на Вікіпедії з’являться на мапі. Під час читання статті ви можете перемикатися між усіма доступними мовами. Деякі статті у Вікіпедії можуть бути недоступними вашою мовою. Кантонська Південний Мін @@ -3661,4 +3664,14 @@ Користувацький колір Додаткові мапи Непідтримувана дія %1$s + %1$s / %2$s + OsmAnd трекер + OsmAnd + Mapillary + Швидка дія + Радіусна лінійка + Вимірювання відстані + Подорожі (Wikivoyage та Wikipedia) + Позначки + Закладки + Передплата - OsmAnd Live \ No newline at end of file diff --git a/OsmAnd/res/values/attrs.xml b/OsmAnd/res/values/attrs.xml index 28bdb7b983..2e5579853d 100644 --- a/OsmAnd/res/values/attrs.xml +++ b/OsmAnd/res/values/attrs.xml @@ -34,6 +34,7 @@ + diff --git a/OsmAnd/res/values/styles.xml b/OsmAnd/res/values/styles.xml index 8298bc9957..3c0411b035 100644 --- a/OsmAnd/res/values/styles.xml +++ b/OsmAnd/res/values/styles.xml @@ -20,17 +20,19 @@ @string/font_roboto_medium ?android:textColorSecondary @dimen/subHeaderMarginLeft + @dimen/subHeaderMarginLeft @@ -162,7 +164,7 @@ @drawable/context_menu_controller_text_color_light @color/ctx_menu_buttons_divider_light @color/activity_background_color_dark - @drawable/ic_action_mode_back + @drawable/ic_arrow_back @style/WhiteActionMode @color/color_white @drawable/switch_ex_background_light @@ -194,7 +196,7 @@ @color/app_bar_color_light @style/Widget.Styled.ActionBarLight - @drawable/ic_action_mode_back + @drawable/ic_arrow_back @style/WhiteActionMode @color/color_white @style/OverflowMenuButton @@ -430,6 +432,7 @@ @drawable/bg_map_context_menu_dark @drawable/bg_bottom_menu_dark @drawable/bg_left_menu_dark + @drawable/bg_right_menu_dark @drawable/bg_point_editor_view_dark @color/divider_color_dark @color/divider_color_dark @@ -683,7 +686,9 @@ diff --git a/OsmAnd/src/net/osmand/AndroidUtils.java b/OsmAnd/src/net/osmand/AndroidUtils.java index f16cc52e71..be5aa79e6c 100644 --- a/OsmAnd/src/net/osmand/AndroidUtils.java +++ b/OsmAnd/src/net/osmand/AndroidUtils.java @@ -14,6 +14,7 @@ import android.graphics.Matrix; import android.graphics.Paint; import android.graphics.PointF; import android.graphics.Typeface; +import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.ClipDrawable; import android.graphics.drawable.Drawable; import android.graphics.drawable.LayerDrawable; @@ -662,6 +663,13 @@ public class AndroidUtils { } } + public static Drawable[] getCompoundDrawables(@NonNull TextView tv){ + if (isSupportRTL()) { + return tv.getCompoundDrawablesRelative(); + } + return tv.getCompoundDrawables(); + } + public static void setPadding(View view, int start, int top, int end, int bottom) { if (isSupportRTL()) { view.setPaddingRelative(start, top, end, bottom); @@ -684,14 +692,67 @@ public class AndroidUtils { } public static int getNavigationIconResId(@NonNull Context ctx) { - return getLayoutDirection(ctx) == ViewCompat.LAYOUT_DIRECTION_RTL ? - R.drawable.ic_arrow_forward : R.drawable.ic_arrow_back; + return isLayoutRtl(ctx) ? R.drawable.ic_arrow_forward : R.drawable.ic_arrow_back; + } + + public static Drawable getDrawableForDirection(@NonNull Context ctx, + @NonNull Drawable drawable) { + return isLayoutRtl(ctx) ? getMirroredDrawable(ctx, drawable) : drawable; + } + + public static Drawable getMirroredDrawable(@NonNull Context ctx, + @NonNull Drawable drawable) { + Bitmap bitmap = drawableToBitmap(drawable); + return new BitmapDrawable(ctx.getResources(), flipBitmapHorizontally(bitmap)); + } + + public static Bitmap drawableToBitmap(Drawable drawable) { + if (drawable instanceof BitmapDrawable) { + BitmapDrawable bitmapDrawable = (BitmapDrawable) drawable; + if(bitmapDrawable.getBitmap() != null) { + return bitmapDrawable.getBitmap(); + } + } + + Bitmap bitmap = null; + if(drawable.getIntrinsicWidth() <= 0 || drawable.getIntrinsicHeight() <= 0) { + bitmap = Bitmap.createBitmap(1, 1, Bitmap.Config.ARGB_8888); + } else { + bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888); + } + + Canvas canvas = new Canvas(bitmap); + drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight()); + drawable.draw(canvas); + return bitmap; + } + + public static Bitmap flipBitmapHorizontally(Bitmap source) { + Matrix matrix = new Matrix(); + matrix.preScale(-1.0f, 1.0f, source.getWidth() / 2f, source.getHeight() / 2f); + return Bitmap.createBitmap(source, 0, 0, source.getWidth(), source.getHeight(), matrix, true); + } + + public static void setTextHorizontalGravity(@NonNull TextView tv, int hGravity) { + if (tv.getContext() != null) { + boolean isLayoutRtl = AndroidUtils.isLayoutRtl(tv.getContext()); + int gravity = Gravity.LEFT; + if (isLayoutRtl && (hGravity == Gravity.START) + || !isLayoutRtl && hGravity == Gravity.END) { + gravity = Gravity.RIGHT; + } + tv.setGravity(gravity); + } } public static boolean isSupportRTL() { return Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1; } + public static boolean isLayoutRtl(Context ctx) { + return isSupportRTL() && getLayoutDirection(ctx) == ViewCompat.LAYOUT_DIRECTION_RTL; + } + public static ArrayList getChildrenViews(ViewGroup vg) { ArrayList result = new ArrayList<>(); for (int i = 0; i < vg.getChildCount(); i++) { diff --git a/OsmAnd/src/net/osmand/SecondSplashScreenFragment.java b/OsmAnd/src/net/osmand/SecondSplashScreenFragment.java index 527c1f6f60..30fa5381c6 100644 --- a/OsmAnd/src/net/osmand/SecondSplashScreenFragment.java +++ b/OsmAnd/src/net/osmand/SecondSplashScreenFragment.java @@ -145,7 +145,7 @@ public class SecondSplashScreenFragment extends BaseOsmAndFragment { } else { elementsPaddingLeft = getNavigationBarWidth(); } - logoLayoutParams.setMargins(0, logoMarginTop, 0, 0); + AndroidUtils.setMargins(logoLayoutParams, 0, logoMarginTop, 0, 0); logo.setPadding(elementsPaddingLeft, 0, elementsPaddingRight, 0); logo.setLayoutParams(logoLayoutParams); view.addView(logo); diff --git a/OsmAnd/src/net/osmand/plus/UiUtilities.java b/OsmAnd/src/net/osmand/plus/UiUtilities.java index 2c554c51da..30da1c855e 100644 --- a/OsmAnd/src/net/osmand/plus/UiUtilities.java +++ b/OsmAnd/src/net/osmand/plus/UiUtilities.java @@ -23,7 +23,6 @@ import android.view.WindowManager; import android.widget.CompoundButton; import android.widget.ImageView; import android.widget.LinearLayout; -import android.widget.SeekBar; import android.widget.TextView; import androidx.annotation.ColorInt; @@ -620,10 +619,10 @@ public class UiUtilities { return new ContextThemeWrapper(context, nightMode ? darkStyle : lightStyle); } - public static void setMargins(View v, int l, int t, int r, int b) { + public static void setMargins(View v, int s, int t, int e, int b) { if (v.getLayoutParams() instanceof ViewGroup.MarginLayoutParams) { ViewGroup.MarginLayoutParams p = (ViewGroup.MarginLayoutParams) v.getLayoutParams(); - p.setMargins(l, t, r, b); + AndroidUtils.setMargins(p, s, t, e, b); v.requestLayout(); } } diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java index 77a0af2fca..8e343fe5ce 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java @@ -1951,11 +1951,13 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven if (settings.DO_NOT_USE_ANIMATIONS.get()) { if (event.getAction() == MotionEvent.ACTION_DOWN) { if (drawerLayout.isDrawerOpen(Gravity.START)) { - int width = AndroidUtils.dpToPx(this, 280); - if (event.getRawX() > width) { + int drawerWidth = AndroidUtils.dpToPx(this, 280); + int screenWidth = AndroidUtils.getScreenWidth(MapActivity.this); + boolean isLayoutRtl = AndroidUtils.isLayoutRtl(app); + if ((!isLayoutRtl && event.getRawX() > drawerWidth) + || (isLayoutRtl && event.getRawX() <= screenWidth - drawerWidth)) { closeDrawer(); } - } } } diff --git a/OsmAnd/src/net/osmand/plus/activities/actions/StartGPSStatus.java b/OsmAnd/src/net/osmand/plus/activities/actions/StartGPSStatus.java index 530c769491..0c64258825 100644 --- a/OsmAnd/src/net/osmand/plus/activities/actions/StartGPSStatus.java +++ b/OsmAnd/src/net/osmand/plus/activities/actions/StartGPSStatus.java @@ -117,7 +117,7 @@ public class StartGPSStatus extends OsmAndAction { final AppCompatCheckBox cb = new AppCompatCheckBox(activity); cb.setText(R.string.shared_string_remember_my_choice); LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT); - lp.setMargins(dp24, dp8, dp8, dp24); + AndroidUtils.setMargins(lp, dp24, dp8, dp8, dp24); cb.setLayoutParams(lp); cb.setPadding(dp8, 0, 0, 0); int textColorPrimary = ContextCompat.getColor(activity, isNightMode() ? R.color.text_color_primary_dark : R.color.text_color_primary_light); diff --git a/OsmAnd/src/net/osmand/plus/base/ContextMenuFragment.java b/OsmAnd/src/net/osmand/plus/base/ContextMenuFragment.java index 1e0b10ee31..343594a990 100644 --- a/OsmAnd/src/net/osmand/plus/base/ContextMenuFragment.java +++ b/OsmAnd/src/net/osmand/plus/base/ContextMenuFragment.java @@ -287,7 +287,8 @@ public abstract class ContextMenuFragment extends BaseOsmAndFragment { currentMenuState = MenuState.FULL_SCREEN; if (isSingleFragment()) { final TypedValue typedValueAttr = new TypedValue(); - mapActivity.getTheme().resolveAttribute(R.attr.left_menu_view_bg, typedValueAttr, true); + int bgAttrId = AndroidUtils.isLayoutRtl(app) ? R.attr.right_menu_view_bg : R.attr.left_menu_view_bg; + mapActivity.getTheme().resolveAttribute(bgAttrId, typedValueAttr, true); mainView.setBackgroundResource(typedValueAttr.resourceId); mainView.setLayoutParams(new FrameLayout.LayoutParams(getLandscapeWidth(), ViewGroup.LayoutParams.MATCH_PARENT)); } else { diff --git a/OsmAnd/src/net/osmand/plus/chooseplan/ChoosePlanDialogFragment.java b/OsmAnd/src/net/osmand/plus/chooseplan/ChoosePlanDialogFragment.java index cba81e6113..c4290f8355 100644 --- a/OsmAnd/src/net/osmand/plus/chooseplan/ChoosePlanDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/chooseplan/ChoosePlanDialogFragment.java @@ -16,6 +16,7 @@ import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; import android.view.Window; +import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.ProgressBar; import android.widget.TextView; @@ -187,7 +188,9 @@ public abstract class ChoosePlanDialogFragment extends BaseOsmAndDialogFragment } View view = inflate(R.layout.purchase_dialog_fragment, container); - view.findViewById(R.id.button_back).setOnClickListener(new OnClickListener() { + ImageView buttonBack = view.findViewById(R.id.button_back); + buttonBack.setImageResource(AndroidUtils.getNavigationIconResId(ctx)); + buttonBack.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { dismiss(); diff --git a/OsmAnd/src/net/osmand/plus/dashboard/DashSearchFragment.java b/OsmAnd/src/net/osmand/plus/dashboard/DashSearchFragment.java index 71ae75da3b..322521a880 100644 --- a/OsmAnd/src/net/osmand/plus/dashboard/DashSearchFragment.java +++ b/OsmAnd/src/net/osmand/plus/dashboard/DashSearchFragment.java @@ -29,7 +29,8 @@ public class DashSearchFragment extends DashBaseFragment { View view = getActivity().getLayoutInflater().inflate(R.layout.dash_search_fragment, container, false); TextView searchFor = (TextView) view.findViewById(R.id.search_for); - searchFor.setCompoundDrawablesWithIntrinsicBounds(getMyApplication().getUIUtilities().getThemedIcon(R.drawable.ic_action_search_dark), null, null, null); + AndroidUtils.setCompoundDrawablesWithIntrinsicBounds(searchFor, + getMyApplication().getUIUtilities().getThemedIcon(R.drawable.ic_action_search_dark), null, null, null); searchFor.setCompoundDrawablePadding(AndroidUtils.dpToPx(getActivity(), 16f)); view.findViewById(R.id.search_card).setOnClickListener(new View.OnClickListener() { diff --git a/OsmAnd/src/net/osmand/plus/dashboard/DashboardOnMap.java b/OsmAnd/src/net/osmand/plus/dashboard/DashboardOnMap.java index 243750ecd8..fca947ca37 100644 --- a/OsmAnd/src/net/osmand/plus/dashboard/DashboardOnMap.java +++ b/OsmAnd/src/net/osmand/plus/dashboard/DashboardOnMap.java @@ -395,9 +395,9 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks, IRouteInfo private FrameLayout.LayoutParams getActionButtonLayoutParams(int btnSizePx) { int topPadPx = mapActivity.getResources().getDimensionPixelSize(R.dimen.dashboard_map_top_padding); FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(btnSizePx, btnSizePx); - int marginRight = btnSizePx / 4; - params.setMargins(0, landscape ? 0 : topPadPx - 2 * btnSizePx, marginRight, landscape ? marginRight : 0); - params.gravity = landscape ? Gravity.BOTTOM | Gravity.RIGHT : Gravity.TOP | Gravity.RIGHT; + int marginEnd = btnSizePx / 4; + AndroidUtils.setMargins(params, 0, landscape ? 0 : topPadPx - 2 * btnSizePx, marginEnd, landscape ? marginEnd : 0); + params.gravity = landscape ? Gravity.BOTTOM | Gravity.END : Gravity.TOP | Gravity.END; return params; } diff --git a/OsmAnd/src/net/osmand/plus/dialogs/HelpArticleDialogFragment.java b/OsmAnd/src/net/osmand/plus/dialogs/HelpArticleDialogFragment.java index 996ed1e80f..06a272263d 100644 --- a/OsmAnd/src/net/osmand/plus/dialogs/HelpArticleDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/dialogs/HelpArticleDialogFragment.java @@ -14,6 +14,7 @@ import androidx.annotation.NonNull; import androidx.appcompat.widget.Toolbar; import androidx.fragment.app.DialogFragment; +import net.osmand.AndroidUtils; import net.osmand.PlatformUtil; import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandSettings; @@ -58,6 +59,7 @@ public class HelpArticleDialogFragment extends DialogFragment { final View view = inflater.inflate(R.layout.fragment_help_article, container, false); Toolbar toolbar = (Toolbar) view.findViewById(R.id.toolbar); + toolbar.setNavigationIcon(AndroidUtils.getNavigationIconResId(getContext())); toolbar.setNavigationContentDescription(R.string.access_shared_string_navigate_up); toolbar.setNavigationOnClickListener(new View.OnClickListener() { @Override diff --git a/OsmAnd/src/net/osmand/plus/liveupdates/LiveUpdatesFragment.java b/OsmAnd/src/net/osmand/plus/liveupdates/LiveUpdatesFragment.java index 9c7489a881..ee4d486aaf 100644 --- a/OsmAnd/src/net/osmand/plus/liveupdates/LiveUpdatesFragment.java +++ b/OsmAnd/src/net/osmand/plus/liveupdates/LiveUpdatesFragment.java @@ -15,7 +15,6 @@ import android.util.TypedValue; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import android.widget.AbsListView; import android.widget.Button; import android.widget.CompoundButton; import android.widget.ExpandableListView; @@ -547,15 +546,12 @@ public class LiveUpdatesFragment extends BaseOsmAndFragment implements InAppPurc } private static class LocalFullMapsViewHolder { - public static final int UPDATES_ENABLED_ITEM_HEIGHT = 72; - public static final int UPDATES_DISABLED_ITEM_HEIGHT = 50; private final ImageView icon; private final TextView nameTextView; private final TextView subheaderTextView; private final TextView descriptionTextView; private final ImageButton options; private final LiveUpdatesFragment fragment; - private final View view; private final int secondaryColor; private final View divider; @@ -565,7 +561,6 @@ public class LiveUpdatesFragment extends BaseOsmAndFragment implements InAppPurc subheaderTextView = (TextView) view.findViewById(R.id.subheaderTextView); descriptionTextView = (TextView) view.findViewById(R.id.descriptionTextView); options = (ImageButton) view.findViewById(R.id.options); - this.view = view; this.fragment = context; TypedValue typedValue = new TypedValue(); @@ -582,7 +577,6 @@ public class LiveUpdatesFragment extends BaseOsmAndFragment implements InAppPurc IncrementalChangesManager changesManager = context.getResourceManager().getChangesManager(); nameTextView.setText(getNameToDisplay(item, fragment.getMyActivity())); - AbsListView.LayoutParams layoutParams = (AbsListView.LayoutParams) view.getLayoutParams(); if (shouldUpdatePreference.get()) { final Integer frequencyId = preferenceUpdateFrequency(item, fragment.getSettings()).get(); final Integer timeOfDateToUpdateId = preferenceTimeOfDayToUpdate(item, fragment.getSettings()).get(); @@ -598,14 +592,11 @@ public class LiveUpdatesFragment extends BaseOsmAndFragment implements InAppPurc .getColor(R.color.osmand_orange)); icon.setImageDrawable(fragment.getIcon(R.drawable.ic_map, R.color.osmand_orange)); options.setImageDrawable(getSecondaryColorPaintedIcon(R.drawable.ic_overflow_menu_white)); - layoutParams.height = (int) dpToPx(view.getContext(), UPDATES_ENABLED_ITEM_HEIGHT); } else { subheaderTextView.setVisibility(View.GONE); icon.setImageDrawable(getSecondaryColorPaintedIcon(R.drawable.ic_map)); options.setImageDrawable(getSecondaryColorPaintedIcon(R.drawable.ic_action_plus)); - layoutParams.height = (int) dpToPx(view.getContext(), UPDATES_DISABLED_ITEM_HEIGHT); } - view.setLayoutParams(layoutParams); final String fileNameWithoutExtension = Algorithms.getFileNameWithoutExtension(new File(item)); @@ -710,10 +701,6 @@ public class LiveUpdatesFragment extends BaseOsmAndFragment implements InAppPurc adapter.notifyDataSetChanged(); } - public static float dpToPx(final Context context, final float dp) { - return dp * context.getResources().getDisplayMetrics().density; - } - @Override public void onError(InAppPurchaseTaskType taskType, String error) { disableProgress(); diff --git a/OsmAnd/src/net/osmand/plus/liveupdates/SubscriptionFragment.java b/OsmAnd/src/net/osmand/plus/liveupdates/SubscriptionFragment.java index c51e62c988..7f8b0e4abc 100644 --- a/OsmAnd/src/net/osmand/plus/liveupdates/SubscriptionFragment.java +++ b/OsmAnd/src/net/osmand/plus/liveupdates/SubscriptionFragment.java @@ -2,6 +2,7 @@ package net.osmand.plus.liveupdates; import android.app.Activity; import android.app.ProgressDialog; +import android.graphics.drawable.Drawable; import android.os.Bundle; import android.view.LayoutInflater; import android.view.MotionEvent; @@ -98,7 +99,7 @@ public class SubscriptionFragment extends BaseOsmAndDialogFragment implements In @Override public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { - + OsmandApplication app = getMyApplication(); String userName = settings.BILLING_USER_NAME.get(); String email = settings.BILLING_USER_EMAIL.get(); String countryDownloadName = settings.BILLING_USER_COUNTRY_DOWNLOAD_NAME.get(); @@ -122,7 +123,8 @@ public class SubscriptionFragment extends BaseOsmAndDialogFragment implements In View view = inflater.inflate(R.layout.subscription_fragment, container, false); ImageButton closeButton = (ImageButton) view.findViewById(R.id.closeButton); - closeButton.setImageDrawable(getMyApplication().getUIUtilities().getIcon(R.drawable.ic_action_mode_back)); + Drawable icBack = app.getUIUtilities().getIcon(AndroidUtils.getNavigationIconResId(app)); + closeButton.setImageDrawable(icBack); closeButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java index f998c97e7e..630fa3f752 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java @@ -320,7 +320,8 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo if (menu.isLandscapeLayout()) { final TypedValue typedValueAttr = new TypedValue(); - mapActivity.getTheme().resolveAttribute(R.attr.left_menu_view_bg, typedValueAttr, true); + int bgAttrId = AndroidUtils.isLayoutRtl(app) ? R.attr.right_menu_view_bg : R.attr.left_menu_view_bg; + mapActivity.getTheme().resolveAttribute(bgAttrId, typedValueAttr, true); mainView.setBackgroundResource(typedValueAttr.resourceId); mainView.setLayoutParams(new FrameLayout.LayoutParams(menu.getLandscapeWidthPx(), ViewGroup.LayoutParams.MATCH_PARENT)); diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java index 12ed950536..aa2d5de59b 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java @@ -1112,7 +1112,7 @@ public class MenuBuilder { } else { button.setTextColor(ContextCompat.getColor(context, light ? R.color.text_color_primary_light : R.color.text_color_primary_dark)); } - button.setGravity(Gravity.LEFT | Gravity.CENTER_VERTICAL); + button.setGravity(Gravity.START | Gravity.CENTER_VERTICAL); button.setSingleLine(singleLine); button.setEllipsize(TextUtils.TruncateAt.END); diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/TransportRouteController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/TransportRouteController.java index 0b08118495..585ba61f62 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/TransportRouteController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/TransportRouteController.java @@ -6,6 +6,7 @@ import android.view.View.OnClickListener; import androidx.annotation.NonNull; +import net.osmand.AndroidUtils; import net.osmand.binary.OsmandOdb.TransportRouteStop; import net.osmand.data.LatLon; import net.osmand.data.PointDescription; @@ -29,8 +30,10 @@ public class TransportRouteController extends MenuController { super(new MenuBuilder(mapActivity), pointDescription, mapActivity); this.transportRoute = transportRoute; builder.setShowOnlinePhotos(false); + int navigationIconResId = AndroidUtils.getNavigationIconResId(mapActivity); toolbarController = new ContextMenuToolbarController(this); toolbarController.setTitle(getNameStr()); + toolbarController.setBackBtnIconIds(navigationIconResId, navigationIconResId); toolbarController.setOnBackButtonClickListener(new OnClickListener() { @Override public void onClick(View v) { @@ -66,7 +69,6 @@ public class TransportRouteController extends MenuController { } }; leftTitleButtonController.caption = mapActivity.getString(R.string.shared_string_previous); - leftTitleButtonController.leftIconId = R.drawable.ic_arrow_back; rightTitleButtonController = new TitleButtonController() { @Override @@ -78,7 +80,14 @@ public class TransportRouteController extends MenuController { } }; rightTitleButtonController.caption = mapActivity.getString(R.string.shared_string_next); - rightTitleButtonController.rightIconId = R.drawable.ic_arrow_forward; + + if (AndroidUtils.isLayoutRtl(mapActivity)) { + leftTitleButtonController.rightIconId = R.drawable.ic_arrow_forward; + rightTitleButtonController.leftIconId = R.drawable.ic_arrow_back; + } else { + leftTitleButtonController.leftIconId = R.drawable.ic_arrow_back; + rightTitleButtonController.rightIconId = R.drawable.ic_arrow_forward; + } } @NonNull diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/TrackDetailsMenuFragment.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/TrackDetailsMenuFragment.java index 1ee6d9ee03..fad7483291 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/TrackDetailsMenuFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/TrackDetailsMenuFragment.java @@ -3,6 +3,7 @@ package net.osmand.plus.mapcontextmenu.other; import android.graphics.drawable.Drawable; import android.os.Build; import android.os.Bundle; +import android.util.TypedValue; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -195,7 +196,10 @@ public class TrackDetailsMenuFragment extends BaseOsmAndFragment { if (!landscapeLayout) { AndroidUtils.setBackground(ctx, mainView, nightMode, R.drawable.bg_bottom_menu_light, R.drawable.bg_bottom_menu_dark); } else { - AndroidUtils.setBackground(ctx, mainView, nightMode, R.drawable.bg_left_menu_light, R.drawable.bg_left_menu_dark); + final TypedValue typedValueAttr = new TypedValue(); + int bgAttrId = AndroidUtils.isLayoutRtl(ctx) ? R.attr.right_menu_view_bg : R.attr.left_menu_view_bg; + ctx.getTheme().resolveAttribute(bgAttrId, typedValueAttr, true); + mainView.setBackgroundResource(typedValueAttr.resourceId); } AndroidUtils.setTextPrimaryColor(ctx, (TextView) mainView.findViewById(R.id.y_axis_title), nightMode); diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkerSelectionFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkerSelectionFragment.java index fd63e7bd3e..993c5c1d93 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkerSelectionFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkerSelectionFragment.java @@ -1,6 +1,7 @@ package net.osmand.plus.mapmarkers; import android.content.Context; +import android.graphics.drawable.Drawable; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; @@ -81,7 +82,8 @@ public class MapMarkerSelectionFragment extends BaseOsmAndDialogFragment { View view = inflater.inflate(R.layout.map_marker_selection_fragment, container, false); ImageButton closeButton = (ImageButton) view.findViewById(R.id.closeButton); - closeButton.setImageDrawable(getMyApplication().getUIUtilities().getIcon(R.drawable.ic_action_mode_back)); + Drawable icBack = app.getUIUtilities().getIcon(AndroidUtils.getNavigationIconResId(app)); + closeButton.setImageDrawable(icBack); closeButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/PlanRouteFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/PlanRouteFragment.java index 6c23918c90..6446258faa 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/PlanRouteFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/PlanRouteFragment.java @@ -200,8 +200,9 @@ public class PlanRouteFragment extends BaseOsmAndFragment implements OsmAndLocat } }); + int navigationIconResId = AndroidUtils.getNavigationIconResId(mapActivity); toolbarController = new PlanRouteToolbarController(); - toolbarController.setBackBtnIconIds(R.drawable.ic_action_mode_back, R.drawable.ic_action_mode_back); + toolbarController.setBackBtnIconIds(navigationIconResId, navigationIconResId); toolbarController.setTitle(getString(R.string.plan_route)); toolbarController.setOnBackButtonClickListener(new View.OnClickListener() { @Override diff --git a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java index c084448d7d..1299018bda 100644 --- a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java +++ b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java @@ -296,7 +296,8 @@ public class MeasurementToolFragment extends BaseOsmAndFragment { undoBtn = ((ImageButton) mainView.findViewById(R.id.undo_point_button)); redoBtn = ((ImageButton) mainView.findViewById(R.id.redo_point_button)); - undoBtn.setImageDrawable(getContentIcon(R.drawable.ic_action_undo_dark)); + Drawable undoDrawable = getContentIcon(R.drawable.ic_action_undo_dark); + undoBtn.setImageDrawable(AndroidUtils.getDrawableForDirection(mapActivity, undoDrawable)); undoBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { @@ -316,7 +317,8 @@ public class MeasurementToolFragment extends BaseOsmAndFragment { } }); - redoBtn.setImageDrawable(getContentIcon(R.drawable.ic_action_redo_dark)); + Drawable redoDrawable = getContentIcon(R.drawable.ic_action_redo_dark); + redoBtn.setImageDrawable(AndroidUtils.getDrawableForDirection(mapActivity, redoDrawable)); redoBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { @@ -394,7 +396,8 @@ public class MeasurementToolFragment extends BaseOsmAndFragment { toolBarController = new MeasurementToolBarController(newGpxData); if (editingCtx.getSelectedPointPosition() != -1) { - toolBarController.setBackBtnIconIds(R.drawable.ic_action_mode_back, R.drawable.ic_action_mode_back); + int navigationIconResId = AndroidUtils.getNavigationIconResId(mapActivity); + toolBarController.setBackBtnIconIds(navigationIconResId, navigationIconResId); } else { toolBarController.setBackBtnIconIds(R.drawable.ic_action_remove_dark, R.drawable.ic_action_remove_dark); } @@ -971,7 +974,8 @@ public class MeasurementToolFragment extends BaseOsmAndFragment { private void switchMovePointMode(boolean enable) { if (enable) { - toolBarController.setBackBtnIconIds(R.drawable.ic_action_mode_back, R.drawable.ic_action_mode_back); + int navigationIconResId = AndroidUtils.getNavigationIconResId(getMapActivity()); + toolBarController.setBackBtnIconIds(navigationIconResId, navigationIconResId); } else { toolBarController.setBackBtnIconIds(R.drawable.ic_action_remove_dark, R.drawable.ic_action_remove_dark); } @@ -990,7 +994,8 @@ public class MeasurementToolFragment extends BaseOsmAndFragment { private void switchAddPointBeforeAfterMode(boolean enable) { if (enable) { - toolBarController.setBackBtnIconIds(R.drawable.ic_action_mode_back, R.drawable.ic_action_mode_back); + int navigationIconResId = AndroidUtils.getNavigationIconResId(getMapActivity()); + toolBarController.setBackBtnIconIds(navigationIconResId, navigationIconResId); } else { toolBarController.setBackBtnIconIds(R.drawable.ic_action_remove_dark, R.drawable.ic_action_remove_dark); } diff --git a/OsmAnd/src/net/osmand/plus/measurementtool/RecyclerViewFragment.java b/OsmAnd/src/net/osmand/plus/measurementtool/RecyclerViewFragment.java index 771e641079..fca7c80377 100644 --- a/OsmAnd/src/net/osmand/plus/measurementtool/RecyclerViewFragment.java +++ b/OsmAnd/src/net/osmand/plus/measurementtool/RecyclerViewFragment.java @@ -57,7 +57,8 @@ public class RecyclerViewFragment extends Fragment { final int backgroundColor = ContextCompat.getColor(getActivity(), nightMode ? R.color.activity_background_color_dark : R.color.activity_background_color_light); final TypedValue typedValueAttr = new TypedValue(); - getActivity().getTheme().resolveAttribute(R.attr.left_menu_view_bg, typedValueAttr, true); + int bgAttrId = AndroidUtils.isLayoutRtl(getActivity()) ? R.attr.right_menu_view_bg : R.attr.left_menu_view_bg; + getActivity().getTheme().resolveAttribute(bgAttrId, typedValueAttr, true); parent = new FrameLayout(mapActivity); parent.setLayoutParams(new LayoutParams(width + AndroidUtils.dpToPx(getActivity(), 16), height)); diff --git a/OsmAnd/src/net/osmand/plus/measurementtool/SaveAsNewTrackBottomSheetDialogFragment.java b/OsmAnd/src/net/osmand/plus/measurementtool/SaveAsNewTrackBottomSheetDialogFragment.java index b2498bda2f..a3a1741192 100644 --- a/OsmAnd/src/net/osmand/plus/measurementtool/SaveAsNewTrackBottomSheetDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/measurementtool/SaveAsNewTrackBottomSheetDialogFragment.java @@ -1,5 +1,6 @@ package net.osmand.plus.measurementtool; +import android.graphics.drawable.Drawable; import android.os.Build; import android.os.Bundle; import android.view.ContextThemeWrapper; @@ -7,6 +8,8 @@ import android.view.MotionEvent; import android.view.View; import android.widget.ImageView; +import net.osmand.AndroidUtils; +import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; import net.osmand.plus.base.MenuBottomSheetDialogFragment; import net.osmand.plus.base.bottomsheetmenu.BaseBottomSheetItem; @@ -26,6 +29,11 @@ public class SaveAsNewTrackBottomSheetDialogFragment extends MenuBottomSheetDial @Override public void createMenuItems(Bundle savedInstanceState) { + OsmandApplication app = getMyApplication(); + if (app == null) { + return; + } + items.add(new TitleItem(getString(R.string.shared_string_save_as_gpx))); items.add(new ShortDescriptionItem(getString(R.string.measurement_tool_save_as_new_track_descr))); @@ -37,12 +45,16 @@ public class SaveAsNewTrackBottomSheetDialogFragment extends MenuBottomSheetDial final ImageView routePointImage = (ImageView) imagesRow.findViewById(R.id.route_point_image); final ImageView lineImage = (ImageView) imagesRow.findViewById(R.id.line_image); - routePointImage.setImageResource(nightMode + Drawable routePointDrawable = app.getUIUtilities().getIcon(nightMode ? R.drawable.img_help_trip_route_points_night : R.drawable.img_help_trip_route_points_day); - lineImage.setImageResource(nightMode + Drawable lineDrawable = app.getUIUtilities().getIcon(nightMode ? R.drawable.img_help_trip_track_night : R.drawable.img_help_trip_track_day); + if (routePointDrawable != null && lineDrawable != null) { + routePointImage.setImageDrawable(AndroidUtils.getDrawableForDirection(app, routePointDrawable)); + lineImage.setImageDrawable(AndroidUtils.getDrawableForDirection(app, lineDrawable)); + } routePointImage.setOnClickListener(saveAsRoutePointOnClickListener); lineImage.setOnClickListener(saveAsLineOnClickListener); diff --git a/OsmAnd/src/net/osmand/plus/monitoring/OsmandMonitoringPlugin.java b/OsmAnd/src/net/osmand/plus/monitoring/OsmandMonitoringPlugin.java index cd92b36ab9..8dbd3d3d0f 100644 --- a/OsmAnd/src/net/osmand/plus/monitoring/OsmandMonitoringPlugin.java +++ b/OsmAnd/src/net/osmand/plus/monitoring/OsmandMonitoringPlugin.java @@ -573,9 +573,9 @@ public class OsmandMonitoringPlugin extends OsmandPlugin { cb.setTextColor(textColorPrimary); LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT); - lp.setMargins(dp24, dp8, dp24, 0); + AndroidUtils.setMargins(lp, dp24, dp8, dp24, 0); cb.setLayoutParams(lp); - cb.setPadding(dp8, 0, 0, 0); + AndroidUtils.setPadding(cb, dp8, 0, 0, 0); cb.setChecked(!choice.value); cb.setOnCheckedChangeListener(new OnCheckedChangeListener() { @Override @@ -590,7 +590,7 @@ public class OsmandMonitoringPlugin extends OsmandPlugin { if (showTrackSelection) { View divider = new View(uiCtx); LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, AndroidUtils.dpToPx(uiCtx, 1f)); - lp.setMargins(0, dp8 * 2, 0, 0); + AndroidUtils.setMargins(lp, 0, dp8 * 2, 0, 0); divider.setLayoutParams(lp); divider.setBackgroundColor(uiCtx.getResources().getColor(nightMode ? R.color.divider_color_dark : R.color.divider_color_light)); ll.addView(divider); @@ -600,9 +600,9 @@ public class OsmandMonitoringPlugin extends OsmandPlugin { cb.setTextColor(textColorPrimary); lp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT); - lp.setMargins(dp24, dp8 * 2, dp24, 0); + AndroidUtils.setMargins(lp, dp24, dp8 * 2, dp24, 0); cb.setLayoutParams(lp); - cb.setPadding(dp8, 0, 0, 0); + AndroidUtils.setPadding(cb, dp8, 0, 0, 0); cb.setChecked(app.getSelectedGpxHelper().getSelectedCurrentRecordingTrack() != null); cb.setOnCheckedChangeListener(new OnCheckedChangeListener() { diff --git a/OsmAnd/src/net/osmand/plus/osmedit/AdvancedEditPoiFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/AdvancedEditPoiFragment.java index e640f9da50..541df2c7f6 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/AdvancedEditPoiFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/AdvancedEditPoiFragment.java @@ -7,6 +7,7 @@ import android.text.Editable; import android.text.InputFilter; import android.text.TextWatcher; import android.view.ContextThemeWrapper; +import android.view.Gravity; import android.view.LayoutInflater; import android.view.View; import android.view.View.OnFocusChangeListener; @@ -21,6 +22,7 @@ import android.widget.TextView; import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import net.osmand.AndroidUtils; import net.osmand.PlatformUtil; import net.osmand.osm.AbstractPoiType; import net.osmand.osm.MapPoiTypes; @@ -202,6 +204,7 @@ public class AdvancedEditPoiFragment extends BaseOsmAndFragment .inflate(R.layout.poi_tag_list_item, null, false); final AutoCompleteTextView tagEditText = (AutoCompleteTextView) convertView.findViewById(R.id.tagEditText); + AndroidUtils.setTextHorizontalGravity(tagEditText, Gravity.START); ImageButton deleteItemImageButton = (ImageButton) convertView.findViewById(R.id.deleteItemImageButton); deleteItemImageButton.setImageDrawable(deleteDrawable); @@ -215,6 +218,7 @@ public class AdvancedEditPoiFragment extends BaseOsmAndFragment }); final AutoCompleteTextView valueEditText = (AutoCompleteTextView) convertView.findViewById(R.id.valueEditText); + AndroidUtils.setTextHorizontalGravity(valueEditText, Gravity.START); valueEditText.setFilters(new InputFilter[] { new InputFilter.LengthFilter(AMENITY_TEXT_LENGTH) }); diff --git a/OsmAnd/src/net/osmand/plus/osmedit/BasicEditPoiFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/BasicEditPoiFragment.java index c9455a9c15..dcf4846f7f 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/BasicEditPoiFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/BasicEditPoiFragment.java @@ -10,6 +10,7 @@ import android.text.TextUtils; import android.text.TextWatcher; import android.util.TypedValue; import android.view.ContextThemeWrapper; +import android.view.Gravity; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -24,6 +25,7 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.fragment.app.Fragment; +import net.osmand.AndroidUtils; import net.osmand.PlatformUtil; import net.osmand.osm.edit.OSMSettings; import net.osmand.plus.R; @@ -104,6 +106,11 @@ public class BasicEditPoiFragment extends BaseOsmAndFragment phoneEditText.setFilters(lengthLimit); webSiteEditText.setFilters(lengthLimit); descriptionEditText.setFilters(lengthLimit); + AndroidUtils.setTextHorizontalGravity(streetEditText, Gravity.START); + AndroidUtils.setTextHorizontalGravity(houseNumberEditText, Gravity.START); + AndroidUtils.setTextHorizontalGravity(phoneEditText, Gravity.START); + AndroidUtils.setTextHorizontalGravity(webSiteEditText, Gravity.START); + AndroidUtils.setTextHorizontalGravity(descriptionEditText, Gravity.START); Button addOpeningHoursButton = (Button) view.findViewById(R.id.addOpeningHoursButton); addOpeningHoursButton.setOnClickListener(new View.OnClickListener() { @Override diff --git a/OsmAnd/src/net/osmand/plus/osmedit/EditPoiDialogFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/EditPoiDialogFragment.java index b4c376f0cd..ce527c5ca0 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/EditPoiDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/EditPoiDialogFragment.java @@ -16,6 +16,7 @@ import android.text.Editable; import android.text.TextUtils; import android.text.TextWatcher; import android.util.TypedValue; +import android.view.Gravity; import android.view.KeyEvent; import android.view.LayoutInflater; import android.view.MotionEvent; @@ -247,6 +248,7 @@ public class EditPoiDialogFragment extends BaseOsmAndDialogFragment { }); EditText poiNameEditText = (EditText) view.findViewById(R.id.poiNameEditText); + AndroidUtils.setTextHorizontalGravity(poiNameEditText, Gravity.START); poiNameEditText.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { @@ -273,6 +275,7 @@ public class EditPoiDialogFragment extends BaseOsmAndDialogFragment { AndroidUtils.showSoftKeyboard(poiNameEditText); poiTypeTextInputLayout = (TextInputLayout) view.findViewById(R.id.poiTypeTextInputLayout); poiTypeEditText = (AutoCompleteTextView) view.findViewById(R.id.poiTypeEditText); + AndroidUtils.setTextHorizontalGravity(poiTypeEditText, Gravity.START); poiTypeEditText.setText(editPoiData.getPoiTypeString()); poiTypeEditText.addTextChangedListener(new TextWatcher() { @Override @@ -301,12 +304,26 @@ public class EditPoiDialogFragment extends BaseOsmAndDialogFragment { poiTypeEditText.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(final View v, MotionEvent event) { + Context ctx = getContext(); + if (ctx == null) { + return false; + } + boolean isLayoutRtl = AndroidUtils.isLayoutRtl(getContext()); final EditText editText = (EditText) v; - final int DRAWABLE_RIGHT = 2; if (event.getAction() == MotionEvent.ACTION_UP) { - if (event.getX() >= (editText.getRight() - - editText.getCompoundDrawables()[DRAWABLE_RIGHT].getBounds().width() - - editText.getPaddingRight())) { + final int DRAWABLE_END = 2; + int expandBtnWidth = AndroidUtils.getCompoundDrawables(editText)[DRAWABLE_END].getBounds().width(); + + boolean expandButtonPressed = false; + if (isLayoutRtl) { + expandButtonPressed = event.getX() <= (editText.getLeft() + expandBtnWidth + + editText.getPaddingLeft()); + } else { + expandButtonPressed = event.getX() >= (editText.getRight() - expandBtnWidth + - editText.getPaddingRight()); + } + + if (expandButtonPressed) { PoiCategory category = editPoiData.getPoiCategory(); if (category != null) { PoiSubTypeDialogFragment dialogFragment = @@ -319,7 +336,6 @@ public class EditPoiDialogFragment extends BaseOsmAndDialogFragment { }); dialogFragment.show(getChildFragmentManager(), "PoiSubTypeDialogFragment"); } - return true; } } diff --git a/OsmAnd/src/net/osmand/plus/quickaction/actions/ShowHidePoiAction.java b/OsmAnd/src/net/osmand/plus/quickaction/actions/ShowHidePoiAction.java index 44fd583074..7b2a5bfc86 100644 --- a/OsmAnd/src/net/osmand/plus/quickaction/actions/ShowHidePoiAction.java +++ b/OsmAnd/src/net/osmand/plus/quickaction/actions/ShowHidePoiAction.java @@ -40,7 +40,7 @@ public class ShowHidePoiAction extends QuickAction { public static final QuickActionType TYPE = new QuickActionType(5, "poi.showhide", ShowHidePoiAction.class). - nameRes(R.string.quick_action_showhide_poi_title).iconRes(R.drawable.ic_action_gabout_dark).nonEditable(). + nameRes(R.string.quick_action_showhide_poi_title).iconRes(R.drawable.ic_action_gabout_dark). category(QuickActionType.CONFIGURE_MAP); diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/ChooseRouteFragment.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/ChooseRouteFragment.java index 77f4a1d442..4ecc22f17b 100644 --- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/ChooseRouteFragment.java +++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/ChooseRouteFragment.java @@ -147,7 +147,8 @@ public class ChooseRouteFragment extends BaseOsmAndFragment implements ContextMe solidToolbarView.setLayoutParams(new FrameLayout.LayoutParams(width, ViewGroup.LayoutParams.WRAP_CONTENT)); solidToolbarView.setVisibility(View.VISIBLE); final TypedValue typedValueAttr = new TypedValue(); - mapActivity.getTheme().resolveAttribute(R.attr.left_menu_view_bg, typedValueAttr, true); + int bgAttrId = AndroidUtils.isLayoutRtl(mapActivity) ? R.attr.right_menu_view_bg : R.attr.left_menu_view_bg; + mapActivity.getTheme().resolveAttribute(bgAttrId, typedValueAttr, true); view.findViewById(R.id.pager_container).setBackgroundResource(typedValueAttr.resourceId); view.setLayoutParams(new FrameLayout.LayoutParams(getResources().getDimensionPixelSize(R.dimen.dashboard_land_width), ViewGroup.LayoutParams.MATCH_PARENT)); } @@ -327,11 +328,11 @@ public class ChooseRouteFragment extends BaseOsmAndFragment implements ContextMe active ? R.drawable.pages_active_light : R.drawable.pages_inactive_light, active ? R.drawable.pages_active_dark : R.drawable.pages_inactive_dark); if (i == 0) { - layoutParams.setMargins(itemMargin, 0, itemPadding, 0); + AndroidUtils.setMargins(layoutParams, itemMargin, 0, itemPadding, 0); } else if (i == routesCount - 1) { - layoutParams.setMargins(0, 0, itemMargin, 0); + AndroidUtils.setMargins(layoutParams, 0, 0, itemMargin, 0); } else { - layoutParams.setMargins(0, 0, itemPadding, 0); + AndroidUtils.setMargins(layoutParams, 0, 0, itemPadding, 0); } itemView.setLayoutParams(layoutParams); pagesView.addView(itemView); diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/MapRouteInfoMenu.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/MapRouteInfoMenu.java index e16c872c91..1358390802 100644 --- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/MapRouteInfoMenu.java +++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/MapRouteInfoMenu.java @@ -1004,7 +1004,7 @@ public class MapRouteInfoMenu implements IRouteInformationListener, CardListener optionsTitle.setVisibility(View.VISIBLE); endPadding += AndroidUtils.getTextWidth(app.getResources().getDimensionPixelSize(R.dimen.text_button_text_size), app.getString(R.string.shared_string_options)); } - if (AndroidUtils.getLayoutDirection(app) == View.LAYOUT_DIRECTION_RTL) { + if (AndroidUtils.isLayoutRtl(app)) { optionsContainer.setPadding(endPadding, optionsContainer.getPaddingTop(), optionsContainer.getPaddingRight(), optionsContainer.getPaddingBottom()); } else { // LTR optionsContainer.setPadding(optionsContainer.getPaddingLeft(), optionsContainer.getPaddingTop(), endPadding, optionsContainer.getPaddingBottom()); diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/MapRouteInfoMenuFragment.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/MapRouteInfoMenuFragment.java index b5e610c60b..fb59e8e148 100644 --- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/MapRouteInfoMenuFragment.java +++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/MapRouteInfoMenuFragment.java @@ -128,10 +128,10 @@ public class MapRouteInfoMenuFragment extends ContextMenuFragment { int widthNoShadow = getLandscapeNoShadowWidth(); modesLayoutToolbar.setLayoutParams(new FrameLayout.LayoutParams(widthNoShadow, ViewGroup.LayoutParams.WRAP_CONTENT)); FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(widthNoShadow, ViewGroup.LayoutParams.WRAP_CONTENT); - params.gravity = Gravity.BOTTOM; + params.gravity = Gravity.BOTTOM|Gravity.START; view.findViewById(R.id.control_buttons).setLayoutParams(params); View appModesView = view.findViewById(R.id.app_modes); - appModesView.setPadding(0, 0, appModesView.getPaddingRight(), 0); + AndroidUtils.setPadding(appModesView, 0, 0, appModesView.getPaddingRight(), 0); } } return view; diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/RouteDetailsFragment.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/RouteDetailsFragment.java index a645fa64a5..f0a0550400 100644 --- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/RouteDetailsFragment.java +++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/RouteDetailsFragment.java @@ -186,7 +186,7 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT view.findViewById(getBottomScrollViewId()).setBackgroundDrawable(null); LinearLayout cardsContainer = getCardsContainer(); FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) cardsContainer.getLayoutParams(); - layoutParams.setMargins(pageMarginPx, 0, pageMarginPx, 0); + AndroidUtils.setMargins(layoutParams, pageMarginPx, 0, pageMarginPx, 0); cardsContainer.setLayoutParams(layoutParams); updateCardsLayout(); } @@ -459,7 +459,7 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT ImageView routeLine = new ImageView(view.getContext()); FrameLayout.LayoutParams routeLineParams = new FrameLayout.LayoutParams(dpToPx(8f), ViewGroup.LayoutParams.MATCH_PARENT); routeLineParams.gravity = Gravity.START; - routeLineParams.setMargins(dpToPx(24), dpToPx(14), dpToPx(22), dpToPx(36)); + AndroidUtils.setMargins(routeLineParams, dpToPx(24), dpToPx(14), dpToPx(22), dpToPx(36)); routeLine.setLayoutParams(routeLineParams); int bgColor = transportStopRoute.getColor(app, isNightMode()); routeLine.setBackgroundColor(bgColor); @@ -595,7 +595,7 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT private View createImagesContainer(@NonNull Context context) { LinearLayout imagesContainer = new LinearLayout(context); FrameLayout.LayoutParams imagesContainerParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.MATCH_PARENT); - imagesContainer.setPadding(dpToPx(16), dpToPx(12), dpToPx(24), 0); + AndroidUtils.setPadding(imagesContainer, dpToPx(16), dpToPx(12), dpToPx(24), 0); imagesContainer.setOrientation(LinearLayout.VERTICAL); imagesContainer.setLayoutParams(imagesContainerParams); return imagesContainer; @@ -745,7 +745,7 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT ImageView walkLineImage = new ImageView(container.getContext()); walkLineImage.setImageDrawable(app.getUIUtilities().getIcon(R.drawable.walk_route_item_light)); LinearLayout.LayoutParams walkImageLayoutParams = new LinearLayout.LayoutParams(dpToPx(10), dpToPx(14)); - walkImageLayoutParams.setMargins(dpToPx(7), dpToPx(6), 0, dpToPx(6)); + AndroidUtils.setMargins(walkImageLayoutParams, dpToPx(7), dpToPx(6), 0, dpToPx(6)); walkLineImage.setLayoutParams(walkImageLayoutParams); container.addView(walkLineImage); } @@ -862,12 +862,12 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT LinearLayout llIconCollapse = new LinearLayout(view.getContext()); llIconCollapse.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, dpToPx(48f))); llIconCollapse.setOrientation(LinearLayout.HORIZONTAL); - llIconCollapse.setGravity(Gravity.CENTER_VERTICAL); + llIconCollapse.setGravity(Gravity.CENTER_VERTICAL|Gravity.START); ll.addView(llIconCollapse); LinearLayout.LayoutParams llIconCollapseParams = new LinearLayout.LayoutParams(dpToPx(24f), dpToPx(24f)); - llIconCollapseParams.setMargins(0, dpToPx(12f), 0, dpToPx(12f)); - llIconCollapseParams.gravity = Gravity.CENTER_VERTICAL; + AndroidUtils.setMargins(llIconCollapseParams,0, dpToPx(12f), 0, dpToPx(12f)); + llIconCollapseParams.gravity = Gravity.CENTER_VERTICAL|Gravity.START; iconViewCollapse.setLayoutParams(llIconCollapseParams); iconViewCollapse.setScaleType(ImageView.ScaleType.CENTER_INSIDE); iconViewCollapse.setImageDrawable(getCollapseIcon(collapsableView.getContenView().getVisibility() == View.GONE)); @@ -934,13 +934,13 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT ImageView iconView = new ImageView(view.getContext()); iconView.setImageDrawable(icon); FrameLayout.LayoutParams imageViewLayoutParams = new FrameLayout.LayoutParams(dpToPx(28), dpToPx(28)); - imageViewLayoutParams.gravity = Gravity.TOP; + imageViewLayoutParams.gravity = Gravity.TOP|Gravity.START; iconView.setLayoutParams(imageViewLayoutParams); iconView.setScaleType(ImageView.ScaleType.CENTER_INSIDE); - imageViewLayoutParams.setMargins(dpToPx(14), dpToPx(8), dpToPx(22), 0); + AndroidUtils.setMargins(imageViewLayoutParams, dpToPx(14), dpToPx(8), dpToPx(22), 0); iconView.setBackgroundResource(R.drawable.border_round_solid_light); - iconView.setPadding(dpToPx(2), dpToPx(2), dpToPx(2), dpToPx(2)); + AndroidUtils.setPadding(iconView, dpToPx(2), dpToPx(2), dpToPx(2), dpToPx(2)); baseItemView.addView(iconView); } @@ -957,9 +957,9 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT TextView timeView = new TextView(view.getContext()); FrameLayout.LayoutParams timeViewParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); timeViewParams.gravity = Gravity.END | Gravity.TOP; - timeViewParams.setMargins(0, dpToPx(8), 0, 0); + AndroidUtils.setMargins(timeViewParams,0, dpToPx(8), 0, 0); timeView.setLayoutParams(timeViewParams); - timeView.setPadding(0, 0, dpToPx(16), 0); + AndroidUtils.setPadding(timeView,0, 0, dpToPx(16), 0); timeView.setTextSize(16); timeView.setTextColor(getMainFontColor()); @@ -1008,7 +1008,7 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT View routeBadge = createRouteBadge(mapActivity, transportStopRoute); LinearLayout.LayoutParams routeBadgeParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); - routeBadgeParams.setMargins(0, dpToPx(6), 0, dpToPx(8)); + AndroidUtils.setMargins(routeBadgeParams, 0, dpToPx(6), 0, dpToPx(8)); routeBadge.setLayoutParams(routeBadgeParams); llText.addView(routeBadge); @@ -1045,13 +1045,13 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT ImageView iconView = new ImageView(view.getContext()); iconView.setImageDrawable(icon); FrameLayout.LayoutParams imageViewLayoutParams = new FrameLayout.LayoutParams(dpToPx(28), dpToPx(28)); - imageViewLayoutParams.gravity = Gravity.TOP; + imageViewLayoutParams.gravity = Gravity.TOP|Gravity.START; iconView.setLayoutParams(imageViewLayoutParams); iconView.setScaleType(ImageView.ScaleType.CENTER_INSIDE); - imageViewLayoutParams.setMargins(dpToPx(14), dpToPx(8), dpToPx(22), 0); + AndroidUtils.setMargins(imageViewLayoutParams, dpToPx(14), dpToPx(8), dpToPx(22), 0); iconView.setBackgroundResource(R.drawable.border_round_solid_light); - iconView.setPadding(dpToPx(2), dpToPx(2), dpToPx(2), dpToPx(2)); + AndroidUtils.setPadding(iconView, dpToPx(2), dpToPx(2), dpToPx(2), dpToPx(2)); baseItemView.addView(iconView); } @@ -1068,9 +1068,9 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT TextView timeView = new TextView(view.getContext()); FrameLayout.LayoutParams timeViewParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); timeViewParams.gravity = Gravity.END | Gravity.TOP; - timeViewParams.setMargins(0, dpToPx(8), 0, 0); + AndroidUtils.setMargins(timeViewParams, 0, dpToPx(8), 0, 0); timeView.setLayoutParams(timeViewParams); - timeView.setPadding(0, 0, dpToPx(16), 0); + AndroidUtils.setPadding(timeView, 0, 0, dpToPx(16), 0); timeView.setTextSize(16); timeView.setTextColor(getMainFontColor()); @@ -1127,16 +1127,16 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT Drawable icon = getPaintedContentIcon(R.drawable.ic_action_pedestrian_dark, getActiveColor()); ImageView iconView = new ImageView(view.getContext()); - iconView.setImageDrawable(icon); + iconView.setImageDrawable(AndroidUtils.getDrawableForDirection(view.getContext(), icon)); FrameLayout.LayoutParams imageViewLayoutParams = new FrameLayout.LayoutParams(dpToPx(24), dpToPx(24)); - imageViewLayoutParams.gravity = imagesContainer != null ? Gravity.TOP : Gravity.CENTER_VERTICAL; + imageViewLayoutParams.gravity = Gravity.START| (imagesContainer != null ? Gravity.TOP : Gravity.CENTER_VERTICAL); iconView.setLayoutParams(imageViewLayoutParams); iconView.setScaleType(ImageView.ScaleType.CENTER_INSIDE); if (imagesContainer != null) { imagesContainer.addView(iconView); } else { - imageViewLayoutParams.setMargins(dpToPx(16), 0, dpToPx(24), 0); + AndroidUtils.setMargins(imageViewLayoutParams, dpToPx(16), 0, dpToPx(24), 0); baseItemView.addView(iconView); } @@ -1183,7 +1183,7 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT if (imagesContainer != null) { imagesContainer.addView(iconView); } else { - imageViewLayoutParams.setMargins(dpToPx(16), 0, dpToPx(24), 0); + AndroidUtils.setMargins(imageViewLayoutParams, dpToPx(16), 0, dpToPx(24), 0); baseItemView.addView(iconView); } } @@ -1197,9 +1197,9 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT TextView timeView = new TextView(view.getContext()); FrameLayout.LayoutParams timeViewParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); timeViewParams.gravity = Gravity.END | Gravity.TOP; - timeViewParams.setMargins(0, dpToPx(8), 0, 0); + AndroidUtils.setMargins(timeViewParams, 0, dpToPx(8), 0, 0); timeView.setLayoutParams(timeViewParams); - timeView.setPadding(0, 0, dpToPx(16), 0); + AndroidUtils.setPadding(timeView, 0, 0, dpToPx(16), 0); timeView.setTextSize(16); timeView.setTextColor(getMainFontColor()); @@ -1247,7 +1247,7 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT if (imagesContainer != null) { imagesContainer.addView(iconView); } else { - imageViewLayoutParams.setMargins(dpToPx(16), 0, dpToPx(24), 0); + AndroidUtils.setMargins(imageViewLayoutParams, dpToPx(16), 0, dpToPx(24), 0); baseItemView.addView(iconView); } @@ -1271,9 +1271,9 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT TextView timeView = new TextView(view.getContext()); FrameLayout.LayoutParams timeViewParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); timeViewParams.gravity = Gravity.END | Gravity.TOP; - timeViewParams.setMargins(0, dpToPx(8), 0, 0); + AndroidUtils.setMargins(timeViewParams, 0, dpToPx(8), 0, 0); timeView.setLayoutParams(timeViewParams); - timeView.setPadding(0, 0, dpToPx(16), 0); + AndroidUtils.setPadding(timeView, 0, 0, dpToPx(16), 0); timeView.setTextSize(16); timeView.setTextColor(getMainFontColor()); @@ -1315,13 +1315,13 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT ImageView iconView = new ImageView(view.getContext()); iconView.setImageDrawable(icon); FrameLayout.LayoutParams imageViewLayoutParams = new FrameLayout.LayoutParams(dpToPx(22), dpToPx(22)); - imageViewLayoutParams.gravity = Gravity.CENTER_VERTICAL; + imageViewLayoutParams.gravity = Gravity.CENTER_VERTICAL | Gravity.START; iconView.setLayoutParams(imageViewLayoutParams); iconView.setScaleType(ImageView.ScaleType.CENTER_INSIDE); - imageViewLayoutParams.setMargins(dpToPx(17), 0, dpToPx(25), 0); + AndroidUtils.setMargins(imageViewLayoutParams, dpToPx(17), 0, dpToPx(25), 0); iconView.setBackgroundResource(R.drawable.border_round_solid_light_small); - iconView.setPadding(dpToPx(2), dpToPx(2), dpToPx(2), dpToPx(2)); + AndroidUtils.setPadding(iconView, dpToPx(2), dpToPx(2), dpToPx(2), dpToPx(2)); baseItemView.addView(iconView); } @@ -1366,7 +1366,7 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT OsmandApplication app = requireMyApplication(); TextViewEx titleView = new TextViewEx(container.getContext()); FrameLayout.LayoutParams titleParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); - titleParams.gravity = Gravity.CENTER_VERTICAL; + titleParams.gravity = Gravity.CENTER_VERTICAL | Gravity.START; titleView.setTypeface(FontCache.getRobotoRegular(container.getContext())); titleView.setLayoutParams(titleParams); titleView.setTextSize(16); @@ -1380,7 +1380,7 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT OsmandApplication app = requireMyApplication(); TextViewEx textViewDescription = new TextViewEx(container.getContext()); LinearLayout.LayoutParams descriptionParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); - descriptionParams.setMargins(0, dpToPx(paddingTop), 0, dpToPx(paddingBottom)); + AndroidUtils.setMargins(descriptionParams, 0, dpToPx(paddingTop), 0, dpToPx(paddingBottom)); textViewDescription.setLayoutParams(descriptionParams); textViewDescription.setTypeface(FontCache.getRobotoRegular(container.getContext())); textViewDescription.setTextSize(14); @@ -1394,7 +1394,7 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT llText.setOrientation(LinearLayout.VERTICAL); LinearLayout.LayoutParams llTextViewParams = new LinearLayout.LayoutParams(0, ViewGroup.LayoutParams.WRAP_CONTENT); llTextViewParams.weight = 1f; - llTextViewParams.gravity = Gravity.CENTER_VERTICAL; + llTextViewParams.gravity = Gravity.CENTER_VERTICAL | Gravity.START; llText.setLayoutParams(llTextViewParams); return llText; } @@ -1406,7 +1406,7 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT ll.setMinimumHeight(dpToPx(minHeight)); ll.setLayoutParams(llParams); ll.setBackgroundResource(AndroidUtils.resolveAttribute(context, android.R.attr.selectableItemBackground)); - ll.setPadding(dpToPx(64f), 0, dpToPx(16f), 0); + AndroidUtils.setPadding(ll, dpToPx(64f), 0, dpToPx(16f), 0); ll.setOnLongClickListener(onLongClickListener); return ll; } @@ -1471,9 +1471,9 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT OsmandApplication app = requireMyApplication(); View horizontalLine = new View(view.getContext()); LinearLayout.LayoutParams llHorLineParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, dpToPx(1f)); - llHorLineParams.gravity = Gravity.BOTTOM; + llHorLineParams.gravity = Gravity.BOTTOM | Gravity.START; if (needMargin) { - llHorLineParams.setMargins(dpToPx(64), 0, 0, 0); + AndroidUtils.setMargins(llHorLineParams, dpToPx(64), 0, 0, 0); } horizontalLine.setLayoutParams(llHorLineParams); horizontalLine.setBackgroundColor(ContextCompat.getColor(app, isNightMode() ? R.color.divider_color_dark : R.color.divider_color_light)); diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/WaypointsFragment.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/WaypointsFragment.java index 27918a081e..22ff37b4e7 100644 --- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/WaypointsFragment.java +++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/WaypointsFragment.java @@ -162,13 +162,14 @@ public class WaypointsFragment extends BaseOsmAndFragment implements ObservableS if (!portrait) { final TypedValue typedValueAttr = new TypedValue(); - mapActivity.getTheme().resolveAttribute(R.attr.left_menu_view_bg, typedValueAttr, true); + int bgAttrId = AndroidUtils.isLayoutRtl(mapActivity) ? R.attr.right_menu_view_bg : R.attr.left_menu_view_bg; + mapActivity.getTheme().resolveAttribute(bgAttrId, typedValueAttr, true); mainView.setBackgroundResource(typedValueAttr.resourceId); mainView.setLayoutParams(new FrameLayout.LayoutParams(getResources().getDimensionPixelSize(R.dimen.dashboard_land_width), ViewGroup.LayoutParams.MATCH_PARENT)); int width = getResources().getDimensionPixelSize(R.dimen.dashboard_land_width) - getResources().getDimensionPixelSize(R.dimen.dashboard_land_shadow_width); FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(width, ViewGroup.LayoutParams.WRAP_CONTENT); - params.gravity = Gravity.BOTTOM; + params.gravity = Gravity.BOTTOM|Gravity.START; view.findViewById(R.id.control_buttons).setLayoutParams(params); } diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/cards/PublicTransportCard.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/cards/PublicTransportCard.java index c0deef7a6b..c75c522219 100644 --- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/cards/PublicTransportCard.java +++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/cards/PublicTransportCard.java @@ -1,6 +1,7 @@ package net.osmand.plus.routepreparationmenu.cards; import android.graphics.Typeface; +import android.graphics.drawable.Drawable; import android.graphics.drawable.GradientDrawable; import android.os.Build; import android.text.SpannableString; @@ -389,7 +390,8 @@ public class PublicTransportCard extends BaseCard { TextView transportStopRouteTextView = (TextView) bageView.findViewById(R.id.transport_stop_route_text); ImageView transportStopRouteImageView = (ImageView) bageView.findViewById(R.id.transport_stop_route_icon); - transportStopRouteImageView.setImageDrawable(getActiveIcon(R.drawable.ic_action_pedestrian_dark)); + Drawable icPedestrian = getActiveIcon(R.drawable.ic_action_pedestrian_dark); + transportStopRouteImageView.setImageDrawable(AndroidUtils.getDrawableForDirection(app, icPedestrian)); transportStopRouteTextView.setText(OsmAndFormatter.getFormattedDuration((int) walkTime, app)); GradientDrawable gradientDrawableBg = (GradientDrawable) bageView.getBackground(); gradientDrawableBg.setColor(activeColor); @@ -413,7 +415,8 @@ public class PublicTransportCard extends BaseCard { private View createArrow() { LinearLayout container = new LinearLayout(app); ImageView arrow = new ImageView(app); - arrow.setImageDrawable(getContentIcon(R.drawable.ic_action_arrow_forward_16)); + Drawable icArrow = getContentIcon(R.drawable.ic_action_arrow_forward_16); + arrow.setImageDrawable(AndroidUtils.getDrawableForDirection(app, icArrow)); container.addView(arrow, new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, AndroidUtils.dpToPx(app, 28))); return container; } diff --git a/OsmAnd/src/net/osmand/plus/settings/ConfigureMenuItemsFragment.java b/OsmAnd/src/net/osmand/plus/settings/ConfigureMenuItemsFragment.java index c7acef5698..fd699dc4f3 100644 --- a/OsmAnd/src/net/osmand/plus/settings/ConfigureMenuItemsFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/ConfigureMenuItemsFragment.java @@ -212,7 +212,9 @@ public class ConfigureMenuItemsFragment extends BaseOsmAndFragment toolbarTitle.setTextColor(nightMode ? getResources().getColor(R.color.text_color_primary_dark) : getResources().getColor(R.color.list_background_color_dark)); - toolbarButton.setImageDrawable(getPaintedContentIcon(R.drawable.ic_arrow_back, getResources().getColor(R.color.text_color_secondary_light))); + toolbarButton.setImageDrawable(getPaintedContentIcon( + AndroidUtils.getNavigationIconResId(app), + getResources().getColor(R.color.text_color_secondary_light))); toolbarTitle.setText(screenType.titleRes); toolbarButton.setOnClickListener(new View.OnClickListener() { @Override diff --git a/OsmAnd/src/net/osmand/plus/settings/ConfigureMenuRootFragment.java b/OsmAnd/src/net/osmand/plus/settings/ConfigureMenuRootFragment.java index 671cc952c9..8dda7cf446 100644 --- a/OsmAnd/src/net/osmand/plus/settings/ConfigureMenuRootFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/ConfigureMenuRootFragment.java @@ -106,7 +106,9 @@ public class ConfigureMenuRootFragment extends BaseOsmAndFragment { ? getResources().getColor(R.color.text_color_primary_dark) : getResources().getColor(R.color.list_background_color_dark)); toolbarSubTitle.setTextColor(getResources().getColor(R.color.text_color_secondary_light)); - toolbarButton.setImageDrawable(getPaintedContentIcon(R.drawable.ic_arrow_back, getResources().getColor(R.color.text_color_secondary_light))); + toolbarButton.setImageDrawable(getPaintedContentIcon( + AndroidUtils.getNavigationIconResId(app), + getResources().getColor(R.color.text_color_secondary_light))); toolbarButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { diff --git a/OsmAnd/src/net/osmand/plus/settings/ImportDuplicatesFragment.java b/OsmAnd/src/net/osmand/plus/settings/ImportDuplicatesFragment.java index 0820b24052..9808881c46 100644 --- a/OsmAnd/src/net/osmand/plus/settings/ImportDuplicatesFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/ImportDuplicatesFragment.java @@ -283,7 +283,8 @@ public class ImportDuplicatesFragment extends BaseOsmAndFragment implements View private void setupToolbar(Toolbar toolbar) { toolbar.setTitle(R.string.import_duplicates_title); - toolbar.setNavigationIcon(getPaintedContentIcon(R.drawable.ic_arrow_back, + toolbar.setNavigationIcon(getPaintedContentIcon( + AndroidUtils.getNavigationIconResId(app), nightMode ? getResources().getColor(R.color.active_buttons_and_links_text_dark) : getResources().getColor(R.color.active_buttons_and_links_text_light))); diff --git a/OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java b/OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java index 1f4f32c4c2..af1e61053f 100644 --- a/OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java +++ b/OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java @@ -28,6 +28,7 @@ import android.view.View; import android.view.WindowManager; import android.widget.Toast; +import net.osmand.AndroidUtils; import net.osmand.PlatformUtil; import net.osmand.access.AccessibilityActionsProvider; import net.osmand.core.android.MapRendererView; @@ -632,7 +633,8 @@ public class OsmandMapTileView implements IMapDownloaderCallback { } else if (mapPosition == OsmandSettings.LANDSCAPE_MIDDLE_RIGHT_CONSTANT) { ratiox = 0.7f; } else { - ratiox = mapPositionX == 0 ? 0.5f : 0.75f; + boolean isLayoutRtl = AndroidUtils.isLayoutRtl(application); + ratiox = mapPositionX == 0 ? 0.5f : (isLayoutRtl ? 0.25f : 0.75f); } final int cy = (int) (ratioy * view.getHeight()); final int cx = (int) (ratiox * view.getWidth()); diff --git a/OsmAnd/src/net/osmand/plus/widgets/FlowLayout.java b/OsmAnd/src/net/osmand/plus/widgets/FlowLayout.java index c59ebb37fa..63a43e56ad 100644 --- a/OsmAnd/src/net/osmand/plus/widgets/FlowLayout.java +++ b/OsmAnd/src/net/osmand/plus/widgets/FlowLayout.java @@ -6,10 +6,11 @@ import android.util.AttributeSet; import android.view.View; import android.view.ViewGroup; +import net.osmand.AndroidUtils; + public class FlowLayout extends ViewGroup { private int line_height; - private boolean rtl = false; public static class LayoutParams extends ViewGroup.LayoutParams { @@ -91,12 +92,10 @@ public class FlowLayout extends ViewGroup { @Override protected void onLayout(boolean changed, int l, int t, int r, int b) { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { - rtl = getLayoutDirection() == LAYOUT_DIRECTION_RTL; - } final int count = getChildCount(); final int width = r - l; - int xpos = rtl ? width - getPaddingRight() : getPaddingLeft(); + boolean isLayoutRtl = AndroidUtils.isLayoutRtl(getContext()); + int xpos = isLayoutRtl ? width - getPaddingRight() : getPaddingLeft(); int ypos = getPaddingTop(); for (int i = 0; i < count; i++) { final View child = getChildAt(i); @@ -104,13 +103,13 @@ public class FlowLayout extends ViewGroup { final int childw = child.getMeasuredWidth(); final int childh = child.getMeasuredHeight(); final LayoutParams lp = (LayoutParams) child.getLayoutParams(); - if (rtl) { + if (isLayoutRtl) { if (xpos - childw < l) { xpos = width - getPaddingRight(); ypos += line_height; } child.layout(xpos - childw, ypos, xpos, ypos + childh); - xpos -= childw - lp.horizontal_spacing; + xpos -= childw + lp.horizontal_spacing; } else { if (xpos + childw > width) { xpos = getPaddingLeft();