From 50c56e2051948446c782357fcded51ff4290bdbb Mon Sep 17 00:00:00 2001 From: androiddevkotlin <64539346+androiddevkotlin@users.noreply.github.com> Date: Mon, 18 Jan 2021 18:28:45 +0200 Subject: [PATCH 1/4] Fix UI 1 part Trip recording --- ...h_switch_divider_and_additional_button.xml | 6 + OsmAnd/res/layout/trip_recording_fragment.xml | 170 ++++++++++-------- .../monitoring/TripRecordingBottomSheet.java | 6 +- 3 files changed, 106 insertions(+), 76 deletions(-) diff --git a/OsmAnd/res/layout/bottom_sheet_with_switch_divider_and_additional_button.xml b/OsmAnd/res/layout/bottom_sheet_with_switch_divider_and_additional_button.xml index f0ff17170d..ac484e30f3 100644 --- a/OsmAnd/res/layout/bottom_sheet_with_switch_divider_and_additional_button.xml +++ b/OsmAnd/res/layout/bottom_sheet_with_switch_divider_and_additional_button.xml @@ -6,6 +6,10 @@ android:layout_height="wrap_content" android:gravity="center_vertical" android:minHeight="@dimen/bottom_sheet_selected_item_title_height" + android:paddingStart="@dimen/content_padding" + android:paddingLeft="@dimen/content_padding" + android:paddingEnd="@dimen/content_padding" + android:paddingRight="@dimen/content_padding" android:baselineAligned="false"> + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:osmand="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical"> - + - + - + - + - + - + + - - + - + - + + + + diff --git a/OsmAnd/src/net/osmand/plus/monitoring/TripRecordingBottomSheet.java b/OsmAnd/src/net/osmand/plus/monitoring/TripRecordingBottomSheet.java index f33f7dfa38..4f581b51b7 100644 --- a/OsmAnd/src/net/osmand/plus/monitoring/TripRecordingBottomSheet.java +++ b/OsmAnd/src/net/osmand/plus/monitoring/TripRecordingBottomSheet.java @@ -31,6 +31,7 @@ import net.osmand.plus.UiUtilities.DialogButtonType; import net.osmand.plus.activities.MapActivity; import net.osmand.plus.base.MenuBottomSheetDialogFragment; import net.osmand.plus.base.bottomsheetmenu.BottomSheetItemWithDescription; +import net.osmand.plus.base.bottomsheetmenu.simpleitems.DividerItem; import net.osmand.plus.base.bottomsheetmenu.simpleitems.DividerSpaceItem; import net.osmand.plus.helpers.AndroidUiHelper; import net.osmand.plus.helpers.FontCache; @@ -50,6 +51,7 @@ public class TripRecordingBottomSheet extends MenuBottomSheetDialogFragment { private ImageView upDownBtn; private SwitchCompat confirmEveryRun; + private RangeSlider intervalSlider; private TextView intervalValueView; private boolean infoExpanded; @@ -110,8 +112,9 @@ public class TripRecordingBottomSheet extends MenuBottomSheetDialogFragment { intervalValueView = itemView.findViewById(R.id.interval_value); updateIntervalLegend(); - RangeSlider intervalSlider = itemView.findViewById(R.id.interval_slider); + intervalSlider = itemView.findViewById(R.id.interval_slider); intervalSlider.setValueTo(secondsLength + minutesLength - 1); + intervalSlider.setVisibility(View.GONE); intervalSlider.addOnChangeListener(new RangeSlider.OnChangeListener() { @Override @@ -218,6 +221,7 @@ public class TripRecordingBottomSheet extends MenuBottomSheetDialogFragment { private void toggleInfoView() { infoExpanded = !infoExpanded; + AndroidUiHelper.updateVisibility(intervalSlider, infoExpanded); AndroidUiHelper.updateVisibility(confirmEveryRun, infoExpanded); updateUpDownBtn(); } From 1c8c45dbad1ef2cc7a2f4dbed5a84b465b79da57 Mon Sep 17 00:00:00 2001 From: androiddevkotlin <64539346+androiddevkotlin@users.noreply.github.com> Date: Tue, 19 Jan 2021 12:16:39 +0200 Subject: [PATCH 2/4] Fix UI 2 part Trip recording --- ...h_switch_divider_and_additional_button.xml | 16 ++++---- OsmAnd/res/layout/trip_recording_fragment.xml | 41 +++++++++++-------- .../monitoring/TripRecordingBottomSheet.java | 3 -- 3 files changed, 30 insertions(+), 30 deletions(-) diff --git a/OsmAnd/res/layout/bottom_sheet_with_switch_divider_and_additional_button.xml b/OsmAnd/res/layout/bottom_sheet_with_switch_divider_and_additional_button.xml index ac484e30f3..7e522baa0d 100644 --- a/OsmAnd/res/layout/bottom_sheet_with_switch_divider_and_additional_button.xml +++ b/OsmAnd/res/layout/bottom_sheet_with_switch_divider_and_additional_button.xml @@ -1,16 +1,14 @@ + android:paddingLeft="@dimen/content_padding"> @@ -46,8 +44,8 @@ android:layout_gravity="center_vertical" android:layout_marginStart="@dimen/bottom_sheet_content_margin" android:layout_marginLeft="@dimen/bottom_sheet_content_margin" - android:layout_marginEnd="@dimen/content_padding_half" - android:layout_marginRight="@dimen/content_padding_half" + android:layout_marginEnd="@dimen/content_padding" + android:layout_marginRight="@dimen/content_padding" tools:checked="true" /> diff --git a/OsmAnd/res/layout/trip_recording_fragment.xml b/OsmAnd/res/layout/trip_recording_fragment.xml index cf50719dad..62bde11259 100644 --- a/OsmAnd/res/layout/trip_recording_fragment.xml +++ b/OsmAnd/res/layout/trip_recording_fragment.xml @@ -15,9 +15,9 @@ android:paddingStart="@dimen/content_padding" android:paddingLeft="@dimen/content_padding" android:paddingTop="@dimen/content_padding_small" - android:paddingBottom="@dimen/content_padding_small" android:paddingEnd="@dimen/content_padding" android:paddingRight="@dimen/content_padding" + android:paddingBottom="@dimen/content_padding_small" android:text="@string/monitoring_settings" android:textSize="@dimen/default_list_text_size" osmand:typeface="@string/font_roboto_medium" /> @@ -68,7 +68,6 @@ android:orientation="vertical" android:paddingStart="@dimen/content_padding" android:paddingLeft="@dimen/content_padding" - android:paddingTop="@dimen/bottom_sheet_content_margin" android:paddingEnd="@dimen/content_padding" android:paddingRight="@dimen/content_padding"> @@ -78,30 +77,36 @@ android:layout_height="wrap_content" android:contentDescription="@string/save_track_interval_globally" android:stepSize="1" + app:haloRadius="@dimen/content_padding_small" app:labelBehavior="gone" - tools:visibility="visible"/> + app:thumbColor="@color/profile_icon_color_blue_light" + app:thumbRadius="@dimen/content_padding_small_half" + app:trackColorActive="@color/profile_icon_color_blue_light" + app:trackColorInactive="#4D007EB3" + app:trackHeight="@dimen/slider_track_height" + tools:visibility="visible" /> - + diff --git a/OsmAnd/src/net/osmand/plus/monitoring/TripRecordingBottomSheet.java b/OsmAnd/src/net/osmand/plus/monitoring/TripRecordingBottomSheet.java index 4f581b51b7..acad56bfb0 100644 --- a/OsmAnd/src/net/osmand/plus/monitoring/TripRecordingBottomSheet.java +++ b/OsmAnd/src/net/osmand/plus/monitoring/TripRecordingBottomSheet.java @@ -68,11 +68,8 @@ public class TripRecordingBottomSheet extends MenuBottomSheetDialogFragment { .setCustomView(itemView) .create()); - int padding = getResources().getDimensionPixelSize(R.dimen.content_padding_small); final int paddingSmall = getResources().getDimensionPixelSize(R.dimen.content_padding_small); - items.add(new DividerSpaceItem(context, padding)); - LinearLayout showTrackOnMapView = itemView.findViewById(R.id.show_track_on_map); TextView showTrackOnMapTitle = showTrackOnMapView.findViewById(R.id.title); showTrackOnMapTitle.setText(R.string.show_track_on_map); From a1aeb9953b4de1e84f32405f1d984a2d0ce33df8 Mon Sep 17 00:00:00 2001 From: androiddevkotlin <64539346+androiddevkotlin@users.noreply.github.com> Date: Wed, 20 Jan 2021 21:40:54 +0200 Subject: [PATCH 3/4] Fix rtl, icon, color tick, visible container --- ...eet_with_switch_divider_and_additional_button.xml | 12 +++++++----- OsmAnd/res/layout/trip_recording_fragment.xml | 2 +- .../plus/monitoring/TripRecordingBottomSheet.java | 10 ++++------ 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/OsmAnd/res/layout/bottom_sheet_with_switch_divider_and_additional_button.xml b/OsmAnd/res/layout/bottom_sheet_with_switch_divider_and_additional_button.xml index 7e522baa0d..681c03e560 100644 --- a/OsmAnd/res/layout/bottom_sheet_with_switch_divider_and_additional_button.xml +++ b/OsmAnd/res/layout/bottom_sheet_with_switch_divider_and_additional_button.xml @@ -8,6 +8,8 @@ android:gravity="center_vertical" android:minHeight="@dimen/bottom_sheet_selected_item_title_height" android:paddingStart="@dimen/content_padding" + android:paddingEnd="@dimen/content_padding" + android:paddingRight="@dimen/content_padding" android:paddingLeft="@dimen/content_padding"> @@ -66,11 +68,11 @@ diff --git a/OsmAnd/res/layout/trip_recording_fragment.xml b/OsmAnd/res/layout/trip_recording_fragment.xml index 62bde11259..f34545e7f2 100644 --- a/OsmAnd/res/layout/trip_recording_fragment.xml +++ b/OsmAnd/res/layout/trip_recording_fragment.xml @@ -83,6 +83,7 @@ app:thumbRadius="@dimen/content_padding_small_half" app:trackColorActive="@color/profile_icon_color_blue_light" app:trackColorInactive="#4D007EB3" + app:tickColorInactive="#007EB3" app:trackHeight="@dimen/slider_track_height" tools:visibility="visible" /> @@ -97,7 +98,6 @@ android:text="@string/confirm_every_run" android:textColor="?android:textColorPrimary" android:textSize="@dimen/default_list_text_size" - android:visibility="gone" osmand:typeface="@string/font_roboto_regular" tools:visibility="visible" /> diff --git a/OsmAnd/src/net/osmand/plus/monitoring/TripRecordingBottomSheet.java b/OsmAnd/src/net/osmand/plus/monitoring/TripRecordingBottomSheet.java index acad56bfb0..54b444ff30 100644 --- a/OsmAnd/src/net/osmand/plus/monitoring/TripRecordingBottomSheet.java +++ b/OsmAnd/src/net/osmand/plus/monitoring/TripRecordingBottomSheet.java @@ -31,8 +31,6 @@ import net.osmand.plus.UiUtilities.DialogButtonType; import net.osmand.plus.activities.MapActivity; import net.osmand.plus.base.MenuBottomSheetDialogFragment; import net.osmand.plus.base.bottomsheetmenu.BottomSheetItemWithDescription; -import net.osmand.plus.base.bottomsheetmenu.simpleitems.DividerItem; -import net.osmand.plus.base.bottomsheetmenu.simpleitems.DividerSpaceItem; import net.osmand.plus.helpers.AndroidUiHelper; import net.osmand.plus.helpers.FontCache; import net.osmand.plus.settings.backend.OsmandSettings; @@ -53,7 +51,7 @@ public class TripRecordingBottomSheet extends MenuBottomSheetDialogFragment { private SwitchCompat confirmEveryRun; private RangeSlider intervalSlider; private TextView intervalValueView; - + private LinearLayout container; private boolean infoExpanded; @Override @@ -109,9 +107,10 @@ public class TripRecordingBottomSheet extends MenuBottomSheetDialogFragment { intervalValueView = itemView.findViewById(R.id.interval_value); updateIntervalLegend(); + container = itemView.findViewById(R.id.always_ask_and_range_slider_container); intervalSlider = itemView.findViewById(R.id.interval_slider); intervalSlider.setValueTo(secondsLength + minutesLength - 1); - intervalSlider.setVisibility(View.GONE); + container.setVisibility(View.GONE); intervalSlider.addOnChangeListener(new RangeSlider.OnChangeListener() { @Override @@ -218,8 +217,7 @@ public class TripRecordingBottomSheet extends MenuBottomSheetDialogFragment { private void toggleInfoView() { infoExpanded = !infoExpanded; - AndroidUiHelper.updateVisibility(intervalSlider, infoExpanded); - AndroidUiHelper.updateVisibility(confirmEveryRun, infoExpanded); + AndroidUiHelper.updateVisibility(container, infoExpanded); updateUpDownBtn(); } From 84deb83900649a8026a5f7a3d90e0137758f9b96 Mon Sep 17 00:00:00 2001 From: androiddevkotlin <64539346+androiddevkotlin@users.noreply.github.com> Date: Wed, 20 Jan 2021 22:36:53 +0200 Subject: [PATCH 4/4] Always ask color text --- OsmAnd/res/layout/trip_recording_fragment.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/res/layout/trip_recording_fragment.xml b/OsmAnd/res/layout/trip_recording_fragment.xml index f34545e7f2..8c43e98d5f 100644 --- a/OsmAnd/res/layout/trip_recording_fragment.xml +++ b/OsmAnd/res/layout/trip_recording_fragment.xml @@ -96,7 +96,7 @@ android:paddingLeft="@dimen/content_padding_small" android:paddingRight="@dimen/content_padding_small" android:text="@string/confirm_every_run" - android:textColor="?android:textColorPrimary" + android:textColor="?attr/color_dialog_buttons" android:textSize="@dimen/default_list_text_size" osmand:typeface="@string/font_roboto_regular" tools:visibility="visible" />