From de5e1610956fce35832f185f0ada9a84b7f58823 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Mon, 20 Jul 2020 17:37:45 +0300 Subject: [PATCH] Track appearance fixes --- .../main/java/net/osmand/GPXUtilities.java | 4 + .../res/drawable/radio_button_center_dark.xml | 5 + .../drawable/radio_button_center_light.xml | 5 + .../res/drawable/radio_button_left_dark.xml | 5 + .../res/drawable/radio_button_left_light.xml | 5 + .../radio_button_regular_center_dark.xml | 7 + .../radio_button_regular_center_light.xml | 7 + .../radio_button_regular_left_dark.xml | 10 + .../radio_button_regular_left_light.xml | 10 + .../radio_button_regular_right_dark.xml | 10 + .../radio_button_regular_right_light.xml | 10 + .../res/drawable/radio_button_right_dark.xml | 5 + .../res/drawable/radio_button_right_light.xml | 5 + .../radio_button_selected_center_dark.xml | 8 + .../radio_button_selected_center_light.xml | 8 + .../radio_button_selected_left_dark.xml | 11 ++ .../radio_button_selected_left_light.xml | 11 ++ .../radio_button_selected_right_dark.xml | 11 ++ .../radio_button_selected_right_light.xml | 11 ++ .../radio_flat_text_selector_dark.xml | 5 + .../radio_flat_text_selector_light.xml | 5 + OsmAnd/res/layout/track_split_interval.xml | 12 +- OsmAnd/res/values-ru/strings.xml | 2 + OsmAnd/res/values/attrs.xml | 3 + OsmAnd/res/values/colors.xml | 3 +- OsmAnd/res/values/strings.xml | 7 + OsmAnd/res/values/styles.xml | 6 + OsmAnd/src/net/osmand/plus/GPXDatabase.java | 8 +- OsmAnd/src/net/osmand/plus/GpxDbHelper.java | 2 +- .../net/osmand/plus/GpxSelectionHelper.java | 9 +- .../osmand/plus/activities/TrackActivity.java | 2 +- .../plus/dialogs/GpxAppearanceAdapter.java | 2 +- .../editors/WptPtEditorFragment.java | 4 +- .../editors/WptPtEditorFragmentNew.java | 4 +- .../myplaces/SplitSegmentDialogFragment.java | 4 +- .../TrackActivityFragmentAdapter.java | 14 +- .../plus/myplaces/TrackSegmentFragment.java | 3 +- .../plus/track/DirectionArrowsCard.java | 48 +++++ .../osmand/plus/track/GradientScaleType.java | 3 +- .../osmand/plus/track/SaveGpxAsyncTask.java | 49 +++++ .../plus/track/SplitIntervalBottomSheet.java | 3 +- .../osmand/plus/track/SplitIntervalCard.java | 15 +- .../plus/track/SplitTrackAsyncTask.java | 75 ++++++++ .../plus/track/TrackAppearanceFragment.java | 182 ++++++++++-------- .../plus/track/TrackAppearanceViewHolder.java | 23 +++ .../osmand/plus/track/TrackColoringCard.java | 147 ++++++++------ .../net/osmand/plus/track/TrackDrawInfo.java | 42 +--- .../net/osmand/plus/track/TrackWidthCard.java | 39 ++-- .../src/net/osmand/plus/views/GPXLayer.java | 120 ++++++------ .../osmand/plus/views/MapControlsLayer.java | 3 +- .../plus/views/MapQuickActionLayer.java | 4 +- 51 files changed, 694 insertions(+), 302 deletions(-) create mode 100644 OsmAnd/res/drawable/radio_button_center_dark.xml create mode 100644 OsmAnd/res/drawable/radio_button_center_light.xml create mode 100644 OsmAnd/res/drawable/radio_button_left_dark.xml create mode 100644 OsmAnd/res/drawable/radio_button_left_light.xml create mode 100644 OsmAnd/res/drawable/radio_button_regular_center_dark.xml create mode 100644 OsmAnd/res/drawable/radio_button_regular_center_light.xml create mode 100644 OsmAnd/res/drawable/radio_button_regular_left_dark.xml create mode 100644 OsmAnd/res/drawable/radio_button_regular_left_light.xml create mode 100644 OsmAnd/res/drawable/radio_button_regular_right_dark.xml create mode 100644 OsmAnd/res/drawable/radio_button_regular_right_light.xml create mode 100644 OsmAnd/res/drawable/radio_button_right_dark.xml create mode 100644 OsmAnd/res/drawable/radio_button_right_light.xml create mode 100644 OsmAnd/res/drawable/radio_button_selected_center_dark.xml create mode 100644 OsmAnd/res/drawable/radio_button_selected_center_light.xml create mode 100644 OsmAnd/res/drawable/radio_button_selected_left_dark.xml create mode 100644 OsmAnd/res/drawable/radio_button_selected_left_light.xml create mode 100644 OsmAnd/res/drawable/radio_button_selected_right_dark.xml create mode 100644 OsmAnd/res/drawable/radio_button_selected_right_light.xml create mode 100644 OsmAnd/res/drawable/radio_flat_text_selector_dark.xml create mode 100644 OsmAnd/res/drawable/radio_flat_text_selector_light.xml create mode 100644 OsmAnd/src/net/osmand/plus/track/DirectionArrowsCard.java create mode 100644 OsmAnd/src/net/osmand/plus/track/SaveGpxAsyncTask.java create mode 100644 OsmAnd/src/net/osmand/plus/track/SplitTrackAsyncTask.java create mode 100644 OsmAnd/src/net/osmand/plus/track/TrackAppearanceViewHolder.java diff --git a/OsmAnd-java/src/main/java/net/osmand/GPXUtilities.java b/OsmAnd-java/src/main/java/net/osmand/GPXUtilities.java index d55b9e1e3e..3b003d1735 100644 --- a/OsmAnd-java/src/main/java/net/osmand/GPXUtilities.java +++ b/OsmAnd-java/src/main/java/net/osmand/GPXUtilities.java @@ -1559,6 +1559,10 @@ public class GPXUtilities { getExtensionsToWrite().put("gradient_scale_type", gradientScaleType); } + public void removeGradientScaleType() { + getExtensionsToWrite().remove("gradient_scale_type"); + } + public String getSplitType() { if (extensions != null) { return extensions.get("split_type"); diff --git a/OsmAnd/res/drawable/radio_button_center_dark.xml b/OsmAnd/res/drawable/radio_button_center_dark.xml new file mode 100644 index 0000000000..ee16a54e4a --- /dev/null +++ b/OsmAnd/res/drawable/radio_button_center_dark.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/OsmAnd/res/drawable/radio_button_center_light.xml b/OsmAnd/res/drawable/radio_button_center_light.xml new file mode 100644 index 0000000000..0ced063668 --- /dev/null +++ b/OsmAnd/res/drawable/radio_button_center_light.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/OsmAnd/res/drawable/radio_button_left_dark.xml b/OsmAnd/res/drawable/radio_button_left_dark.xml new file mode 100644 index 0000000000..235fe1c07a --- /dev/null +++ b/OsmAnd/res/drawable/radio_button_left_dark.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/OsmAnd/res/drawable/radio_button_left_light.xml b/OsmAnd/res/drawable/radio_button_left_light.xml new file mode 100644 index 0000000000..bb311906e4 --- /dev/null +++ b/OsmAnd/res/drawable/radio_button_left_light.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/OsmAnd/res/drawable/radio_button_regular_center_dark.xml b/OsmAnd/res/drawable/radio_button_regular_center_dark.xml new file mode 100644 index 0000000000..f169338f05 --- /dev/null +++ b/OsmAnd/res/drawable/radio_button_regular_center_dark.xml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/OsmAnd/res/drawable/radio_button_regular_center_light.xml b/OsmAnd/res/drawable/radio_button_regular_center_light.xml new file mode 100644 index 0000000000..e0cca408c5 --- /dev/null +++ b/OsmAnd/res/drawable/radio_button_regular_center_light.xml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/OsmAnd/res/drawable/radio_button_regular_left_dark.xml b/OsmAnd/res/drawable/radio_button_regular_left_dark.xml new file mode 100644 index 0000000000..b841d52e72 --- /dev/null +++ b/OsmAnd/res/drawable/radio_button_regular_left_dark.xml @@ -0,0 +1,10 @@ + + + + + \ No newline at end of file diff --git a/OsmAnd/res/drawable/radio_button_regular_left_light.xml b/OsmAnd/res/drawable/radio_button_regular_left_light.xml new file mode 100644 index 0000000000..4a983673da --- /dev/null +++ b/OsmAnd/res/drawable/radio_button_regular_left_light.xml @@ -0,0 +1,10 @@ + + + + + \ No newline at end of file diff --git a/OsmAnd/res/drawable/radio_button_regular_right_dark.xml b/OsmAnd/res/drawable/radio_button_regular_right_dark.xml new file mode 100644 index 0000000000..4a54d73f04 --- /dev/null +++ b/OsmAnd/res/drawable/radio_button_regular_right_dark.xml @@ -0,0 +1,10 @@ + + + + + \ No newline at end of file diff --git a/OsmAnd/res/drawable/radio_button_regular_right_light.xml b/OsmAnd/res/drawable/radio_button_regular_right_light.xml new file mode 100644 index 0000000000..e2186a923b --- /dev/null +++ b/OsmAnd/res/drawable/radio_button_regular_right_light.xml @@ -0,0 +1,10 @@ + + + + + \ No newline at end of file diff --git a/OsmAnd/res/drawable/radio_button_right_dark.xml b/OsmAnd/res/drawable/radio_button_right_dark.xml new file mode 100644 index 0000000000..a699007a3a --- /dev/null +++ b/OsmAnd/res/drawable/radio_button_right_dark.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/OsmAnd/res/drawable/radio_button_right_light.xml b/OsmAnd/res/drawable/radio_button_right_light.xml new file mode 100644 index 0000000000..c875e76957 --- /dev/null +++ b/OsmAnd/res/drawable/radio_button_right_light.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/OsmAnd/res/drawable/radio_button_selected_center_dark.xml b/OsmAnd/res/drawable/radio_button_selected_center_dark.xml new file mode 100644 index 0000000000..19757beaaf --- /dev/null +++ b/OsmAnd/res/drawable/radio_button_selected_center_dark.xml @@ -0,0 +1,8 @@ + + + + + \ No newline at end of file diff --git a/OsmAnd/res/drawable/radio_button_selected_center_light.xml b/OsmAnd/res/drawable/radio_button_selected_center_light.xml new file mode 100644 index 0000000000..3f9db228c5 --- /dev/null +++ b/OsmAnd/res/drawable/radio_button_selected_center_light.xml @@ -0,0 +1,8 @@ + + + + + \ No newline at end of file diff --git a/OsmAnd/res/drawable/radio_button_selected_left_dark.xml b/OsmAnd/res/drawable/radio_button_selected_left_dark.xml new file mode 100644 index 0000000000..e3477f5844 --- /dev/null +++ b/OsmAnd/res/drawable/radio_button_selected_left_dark.xml @@ -0,0 +1,11 @@ + + + + + + \ No newline at end of file diff --git a/OsmAnd/res/drawable/radio_button_selected_left_light.xml b/OsmAnd/res/drawable/radio_button_selected_left_light.xml new file mode 100644 index 0000000000..08dd317994 --- /dev/null +++ b/OsmAnd/res/drawable/radio_button_selected_left_light.xml @@ -0,0 +1,11 @@ + + + + + + \ No newline at end of file diff --git a/OsmAnd/res/drawable/radio_button_selected_right_dark.xml b/OsmAnd/res/drawable/radio_button_selected_right_dark.xml new file mode 100644 index 0000000000..d535b6215f --- /dev/null +++ b/OsmAnd/res/drawable/radio_button_selected_right_dark.xml @@ -0,0 +1,11 @@ + + + + + + \ No newline at end of file diff --git a/OsmAnd/res/drawable/radio_button_selected_right_light.xml b/OsmAnd/res/drawable/radio_button_selected_right_light.xml new file mode 100644 index 0000000000..0473c0140c --- /dev/null +++ b/OsmAnd/res/drawable/radio_button_selected_right_light.xml @@ -0,0 +1,11 @@ + + + + + + \ No newline at end of file diff --git a/OsmAnd/res/drawable/radio_flat_text_selector_dark.xml b/OsmAnd/res/drawable/radio_flat_text_selector_dark.xml new file mode 100644 index 0000000000..119f4989b8 --- /dev/null +++ b/OsmAnd/res/drawable/radio_flat_text_selector_dark.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/OsmAnd/res/drawable/radio_flat_text_selector_light.xml b/OsmAnd/res/drawable/radio_flat_text_selector_light.xml new file mode 100644 index 0000000000..359b2777c6 --- /dev/null +++ b/OsmAnd/res/drawable/radio_flat_text_selector_light.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/OsmAnd/res/layout/track_split_interval.xml b/OsmAnd/res/layout/track_split_interval.xml index becc0378d7..d81c89a0a8 100644 --- a/OsmAnd/res/layout/track_split_interval.xml +++ b/OsmAnd/res/layout/track_split_interval.xml @@ -22,37 +22,37 @@ android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" - android:background="@drawable/radio_button_left" + android:background="?attr/btn_radio_button_left" android:button="@android:color/transparent" android:checked="true" android:foreground="?attr/selectableItemBackground" android:gravity="center" android:text="@string/shared_string_none" - android:textColor="@drawable/radio_flat_text_selector" /> + android:textColor="@drawable/radio_flat_text_selector_light" /> + android:textColor="@drawable/radio_flat_text_selector_light" /> diff --git a/OsmAnd/res/values-ru/strings.xml b/OsmAnd/res/values-ru/strings.xml index 1bf61358ef..558dbeeb69 100644 --- a/OsmAnd/res/values-ru/strings.xml +++ b/OsmAnd/res/values-ru/strings.xml @@ -3823,4 +3823,6 @@ Необходимо указать рабочие дни для продолжения Маршрут между пунктами План маршрута + Выберите нужный вариант разбиения: по времени или по расстоянию. + Выберите интервал с которым будут отображаться метки с расстоянием или временем на треке. \ No newline at end of file diff --git a/OsmAnd/res/values/attrs.xml b/OsmAnd/res/values/attrs.xml index de8d8e697f..5ffd847b3a 100644 --- a/OsmAnd/res/values/attrs.xml +++ b/OsmAnd/res/values/attrs.xml @@ -133,6 +133,9 @@ + + + diff --git a/OsmAnd/res/values/colors.xml b/OsmAnd/res/values/colors.xml index e4acc080d8..3b6763274b 100644 --- a/OsmAnd/res/values/colors.xml +++ b/OsmAnd/res/values/colors.xml @@ -471,7 +471,8 @@ #1A237BFF #1AD28521 - #80237BFF + #80237BFF + #80D28521 #80000000 #4DCCCCCC diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index 323b511ccb..bbb97a0c4b 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -11,6 +11,13 @@ Thx - Hardy --> + Solid + Direction arrows + Custom + Select the desired splitting option: by time or by distance. + Select the interval at which marks with distance or time on the track will be displayed. + Select width + Show start finish icons Add to a Track Plan a route Route between points diff --git a/OsmAnd/res/values/styles.xml b/OsmAnd/res/values/styles.xml index 6ae9c18952..58d02716ed 100644 --- a/OsmAnd/res/values/styles.xml +++ b/OsmAnd/res/values/styles.xml @@ -297,6 +297,9 @@ @style/ToolbarStyle @style/ToolbarStyle @drawable/bg_dash_line_light + @drawable/radio_button_left_light + @drawable/radio_button_right_light + @drawable/radio_button_center_light