diff --git a/OsmAnd/res/drawable/ripple_solid_dark_18dp.xml b/OsmAnd/res/drawable/ripple_solid_dark_18dp.xml new file mode 100644 index 0000000000..a214350483 --- /dev/null +++ b/OsmAnd/res/drawable/ripple_solid_dark_18dp.xml @@ -0,0 +1,9 @@ + + + + + + + + \ No newline at end of file diff --git a/OsmAnd/res/drawable/ripple_solid_light_18dp.xml b/OsmAnd/res/drawable/ripple_solid_light_18dp.xml new file mode 100644 index 0000000000..f7b1e3f1ef --- /dev/null +++ b/OsmAnd/res/drawable/ripple_solid_light_18dp.xml @@ -0,0 +1,9 @@ + + + + + + + + \ No newline at end of file diff --git a/OsmAnd/res/layout/bottom_sheet_item_edit_with_recyclerview.xml b/OsmAnd/res/layout/bottom_sheet_item_edit_with_recyclerview.xml index a03fa1879d..df28c0a05e 100644 --- a/OsmAnd/res/layout/bottom_sheet_item_edit_with_recyclerview.xml +++ b/OsmAnd/res/layout/bottom_sheet_item_edit_with_recyclerview.xml @@ -19,7 +19,10 @@ android:paddingRight="@dimen/content_padding" android:paddingTop="@dimen/content_padding_small" android:paddingBottom="@dimen/content_padding_small" - android:textAppearance="@style/TextAppearance.ListItemCategoryTitle" + android:letterSpacing="@dimen/text_button_letter_spacing" + android:textColor="?android:textColorPrimary" + android:textSize="@dimen/default_list_text_size" + osmand:typeface="@string/font_roboto_medium" tools:text="Some Title" android:paddingStart="@dimen/content_padding" android:paddingEnd="@dimen/content_padding" /> diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/HorizontalSelectionAdapter.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/HorizontalSelectionAdapter.java index 462142ae13..bf7844a0f4 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/HorizontalSelectionAdapter.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/HorizontalSelectionAdapter.java @@ -1,6 +1,7 @@ package net.osmand.plus.mapcontextmenu.other; import android.graphics.drawable.GradientDrawable; +import android.os.Build; import android.view.View; import android.view.ViewGroup; import android.widget.LinearLayout; @@ -43,7 +44,8 @@ public class HorizontalSelectionAdapter extends RecyclerView.Adapter= Build.VERSION_CODES.LOLLIPOP) { + View buttonContainer = holder.button.findViewById(R.id.button_container); + AndroidUtils.setBackground(app, buttonContainer, nightMode, R.drawable.ripple_solid_light_18dp, + R.drawable.ripple_solid_dark_18dp); + } } @Override @@ -110,7 +117,7 @@ public class HorizontalSelectionAdapter extends RecyclerView.Adapter contentHeight) { scrollView.getLayoutParams().height = contentHeight; + showTopShadow = false; } else { scrollView.getLayoutParams().height = ViewGroup.LayoutParams.WRAP_CONTENT; + showTopShadow = true; } scrollView.requestLayout(); int delay = Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP ? 300 : 1000; @@ -179,6 +182,24 @@ public class VehicleParametersBottomSheet extends BasePreferenceBottomSheet { } }, delay); contentHeightPrevious = contentHeight; + drawTopShadow(showTopShadow); + } + } + + private void drawTopShadow(boolean showTopShadow) { + final Activity activity = getActivity(); + View mainView = getView(); + if (activity == null || mainView == null) { + return; + } + if (AndroidUiHelper.isOrientationPortrait(activity)) { + mainView.setBackgroundResource(showTopShadow ? getPortraitBgResId() : getBgColorId()); + if (!showTopShadow) { + mainView.setPadding(0, 0, 0, 0); + } + } else { + mainView.setBackgroundResource(showTopShadow + ? getLandscapeTopsidesBgResId() : getLandscapeSidesBgResId()); } } }; diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/VehicleParametersFragment.java b/OsmAnd/src/net/osmand/plus/settings/fragments/VehicleParametersFragment.java index 9125ce36ea..aa9fee8058 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/VehicleParametersFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/VehicleParametersFragment.java @@ -88,6 +88,7 @@ public class VehicleParametersFragment extends BaseSettingsFragment implements O ? ROUTING_PARAMETER_NUMERIC_DEFAULT : ROUTING_PARAMETER_SYMBOLIC_DEFAULT; OsmandSettings.StringPreference pref = (OsmandSettings.StringPreference) app.getSettings() .getCustomRoutingProperty(parameterId, defValue); + VehicleSizeAssets assets = VehicleSizeAssets.getAssets(parameterId, routerProfile); Object[] values = parameter.getPossibleValues(); String[] valuesStr = new String[values.length]; for (int i = 0; i < values.length; i++) { @@ -98,7 +99,7 @@ public class VehicleParametersFragment extends BaseSettingsFragment implements O for (int i = 1; i < entriesStr.length; i++) { int firstCharIndex = Algorithms.findFirstNumberEndIndex(entriesStr[i]); entriesStr[i] = String.format(app.getString(R.string.ltr_or_rtl_combine_via_space), - entriesStr[i].substring(0, firstCharIndex), entriesStr[i].substring(firstCharIndex)); + entriesStr[i].substring(0, firstCharIndex), getString(assets.getMetricShortRes())); } Context ctx = getContext(); @@ -107,7 +108,7 @@ public class VehicleParametersFragment extends BaseSettingsFragment implements O } SizePreference vehicleSizePref = new SizePreference(ctx); vehicleSizePref.setKey(pref.getId()); - vehicleSizePref.setAssets(VehicleSizeAssets.getAssets(parameterId, routerProfile)); + vehicleSizePref.setAssets(assets); vehicleSizePref.setDefaultValue(defValue); vehicleSizePref.setTitle(title); vehicleSizePref.setEntries(entriesStr);