From 32ec37db0bf782187476547345d95c8ce08e18b9 Mon Sep 17 00:00:00 2001 From: Nazar-Kutz Date: Tue, 21 Apr 2020 16:16:27 +0300 Subject: [PATCH] Replace all SeekBars with Material Components Sliders --- OsmAnd/res/layout-land/map_hud_bottom.xml | 5 +- OsmAnd/res/layout/adjust_speed_slider.xml | 8 +- OsmAnd/res/layout/animate_route.xml | 5 +- ...bottom_sheet_item_slider_with_two_text.xml | 14 +- OsmAnd/res/layout/download_tiles.xml | 3 +- OsmAnd/res/layout/fragment_terrain.xml | 22 +- OsmAnd/res/layout/list_item_progress.xml | 10 +- OsmAnd/res/layout/map_hud_bottom.xml | 10 +- .../res/layout/recalculation_angle_dialog.xml | 10 +- OsmAnd/res/layout/slider.xml | 13 ++ OsmAnd/res/values/sizes.xml | 3 +- OsmAnd/res/values/styles.xml | 5 + .../net/osmand/plus/ContextMenuAdapter.java | 30 ++- .../osmand/plus/OsmAndLocationSimulation.java | 14 +- OsmAnd/src/net/osmand/plus/UiUtilities.java | 72 ++++--- .../plus/activities/DownloadTilesDialog.java | 31 ++- .../plus/activities/SettingsBaseActivity.java | 29 --- .../SettingsNavigationActivity.java | 53 +++-- .../monitoring/OsmandMonitoringPlugin.java | 40 ++-- .../settings/RouteParametersFragment.java | 33 ++- ...ecalculateRouteInDeviationBottomSheet.java | 13 +- .../plus/srtmplugin/TerrainFragment.java | 20 +- .../osmand/plus/views/MapControlsLayer.java | 35 ++-- .../osmand/plus/views/SeekBarPreference.java | 189 ------------------ 24 files changed, 234 insertions(+), 433 deletions(-) create mode 100644 OsmAnd/res/layout/slider.xml delete mode 100644 OsmAnd/src/net/osmand/plus/views/SeekBarPreference.java diff --git a/OsmAnd/res/layout-land/map_hud_bottom.xml b/OsmAnd/res/layout-land/map_hud_bottom.xml index feceaba4d2..fd3da64e51 100644 --- a/OsmAnd/res/layout-land/map_hud_bottom.xml +++ b/OsmAnd/res/layout-land/map_hud_bottom.xml @@ -183,8 +183,9 @@ android:layout_marginBottom="@dimen/map_button_size" android:orientation="horizontal"> - diff --git a/OsmAnd/res/layout/adjust_speed_slider.xml b/OsmAnd/res/layout/adjust_speed_slider.xml index d2813f279b..6d7b27f58b 100644 --- a/OsmAnd/res/layout/adjust_speed_slider.xml +++ b/OsmAnd/res/layout/adjust_speed_slider.xml @@ -80,11 +80,13 @@ - \ No newline at end of file diff --git a/OsmAnd/res/layout/animate_route.xml b/OsmAnd/res/layout/animate_route.xml index bacf93ab04..d085e7a9f9 100644 --- a/OsmAnd/res/layout/animate_route.xml +++ b/OsmAnd/res/layout/animate_route.xml @@ -34,9 +34,10 @@ android:layout_marginEnd="@dimen/content_padding" android:layout_marginStart="@dimen/dialog_content_margin" /> - + android:layout_height="wrap_content" + android:paddingLeft="@dimen/content_padding" + android:paddingRight="@dimen/content_padding"> + android:layout_height="wrap_content" /> \ No newline at end of file diff --git a/OsmAnd/res/layout/download_tiles.xml b/OsmAnd/res/layout/download_tiles.xml index 2c583248fd..b466cf6254 100644 --- a/OsmAnd/res/layout/download_tiles.xml +++ b/OsmAnd/res/layout/download_tiles.xml @@ -21,8 +21,9 @@ android:layout_marginEnd="10dp" android:layout_marginStart="10dp" /> - + android:layout_marginLeft="@dimen/content_padding" + android:layout_marginRight="@dimen/content_padding" + android:stepSize="1" /> + android:layout_marginLeft="@dimen/content_padding" + android:layout_marginRight="@dimen/content_padding" + android:stepSize="1" /> - diff --git a/OsmAnd/res/layout/map_hud_bottom.xml b/OsmAnd/res/layout/map_hud_bottom.xml index 3d97216335..967f831bf4 100644 --- a/OsmAnd/res/layout/map_hud_bottom.xml +++ b/OsmAnd/res/layout/map_hud_bottom.xml @@ -98,15 +98,13 @@ android:layout_marginBottom="@dimen/map_button_size" android:orientation="horizontal"> - + android:layout_margin="@dimen/dashPadding" /> diff --git a/OsmAnd/res/layout/recalculation_angle_dialog.xml b/OsmAnd/res/layout/recalculation_angle_dialog.xml index 822b4feef4..e8b68e6b3e 100644 --- a/OsmAnd/res/layout/recalculation_angle_dialog.xml +++ b/OsmAnd/res/layout/recalculation_angle_dialog.xml @@ -118,11 +118,15 @@ - diff --git a/OsmAnd/res/layout/slider.xml b/OsmAnd/res/layout/slider.xml new file mode 100644 index 0000000000..b5681dcc8a --- /dev/null +++ b/OsmAnd/res/layout/slider.xml @@ -0,0 +1,13 @@ + + + + + + diff --git a/OsmAnd/res/values/sizes.xml b/OsmAnd/res/values/sizes.xml index 39e8847cc5..e46c3a8df8 100644 --- a/OsmAnd/res/values/sizes.xml +++ b/OsmAnd/res/values/sizes.xml @@ -361,9 +361,10 @@ 128dp 164dp - 8dp + 6dp 12dp 2dp + @dimen/slider_thumb_size 65dp \ No newline at end of file diff --git a/OsmAnd/res/values/styles.xml b/OsmAnd/res/values/styles.xml index 8fea939e8f..3b25e68f60 100644 --- a/OsmAnd/res/values/styles.xml +++ b/OsmAnd/res/values/styles.xml @@ -112,6 +112,11 @@ @color/divider_color_dark + + +