From 5a8a39ecf51bc8e93f70b385b296e0b8af051e1f Mon Sep 17 00:00:00 2001 From: Skalii Date: Wed, 13 Jan 2021 16:59:50 +0200 Subject: [PATCH] fix previous; "Vehicle" block, descrease padding below scroll buttons --- .../net/osmand/plus/onlinerouting/OnlineRoutingCard.java | 6 ++++++ .../plus/onlinerouting/OnlineRoutingEngineFragment.java | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/onlinerouting/OnlineRoutingCard.java b/OsmAnd/src/net/osmand/plus/onlinerouting/OnlineRoutingCard.java index 1b9e7f3b29..6c49386c47 100644 --- a/OsmAnd/src/net/osmand/plus/onlinerouting/OnlineRoutingCard.java +++ b/OsmAnd/src/net/osmand/plus/onlinerouting/OnlineRoutingCard.java @@ -5,6 +5,7 @@ import android.text.TextWatcher; import android.view.View; import android.view.View.OnClickListener; import android.view.View.OnFocusChangeListener; +import android.view.ViewGroup; import android.widget.EditText; import android.widget.TextView; @@ -127,6 +128,11 @@ public class OnlineRoutingCard extends BaseCard { rvSelectionMenu.setAdapter(adapter); } + public void removeBottomMarginSelectionMenu() { + ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) rvSelectionMenu.getLayoutParams(); + params.bottomMargin = 0; + } + public void setDescription(@NonNull String description) { showElements(tvDescription); tvDescription.setText(description); diff --git a/OsmAnd/src/net/osmand/plus/onlinerouting/OnlineRoutingEngineFragment.java b/OsmAnd/src/net/osmand/plus/onlinerouting/OnlineRoutingEngineFragment.java index e6ca05991b..b70fcc89a3 100644 --- a/OsmAnd/src/net/osmand/plus/onlinerouting/OnlineRoutingEngineFragment.java +++ b/OsmAnd/src/net/osmand/plus/onlinerouting/OnlineRoutingEngineFragment.java @@ -230,6 +230,7 @@ public class OnlineRoutingEngineFragment extends BaseOsmAndFragment { return false; } }); + vehicleCard.removeBottomMarginSelectionMenu(); vehicleCard.setFieldBoxLabelText(getString(R.string.shared_string_custom)); vehicleCard.setOnTextChangedListener(new OnTextChangedListener() { @Override @@ -284,7 +285,8 @@ public class OnlineRoutingEngineFragment extends BaseOsmAndFragment { return false; } }); - exampleCard.setFieldBoxLabelText(getString(R.string.online_routing_example_hint)); + exampleCard.setDescription(getString(R.string.online_routing_example_hint)); + exampleCard.showFieldBox(); exampleCard.setButton(getString(R.string.test_route_calculation), new View.OnClickListener() { @Override public void onClick(View v) {