From ebbcb1778ff82127123f4409741ba4477a2cba03 Mon Sep 17 00:00:00 2001 From: Skalii Date: Thu, 14 Jan 2021 13:13:55 +0200 Subject: [PATCH] fix descrease padding below scroll buttons in "Vehicle" block --- .../net/osmand/plus/onlinerouting/OnlineRoutingCard.java | 4 ++-- .../plus/onlinerouting/OnlineRoutingEngineFragment.java | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/onlinerouting/OnlineRoutingCard.java b/OsmAnd/src/net/osmand/plus/onlinerouting/OnlineRoutingCard.java index 6c49386c47..b9509fc026 100644 --- a/OsmAnd/src/net/osmand/plus/onlinerouting/OnlineRoutingCard.java +++ b/OsmAnd/src/net/osmand/plus/onlinerouting/OnlineRoutingCard.java @@ -128,9 +128,9 @@ public class OnlineRoutingCard extends BaseCard { rvSelectionMenu.setAdapter(adapter); } - public void removeBottomMarginSelectionMenu() { + public void updateBottomMarginSelectionMenu(int bottomMargin) { ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) rvSelectionMenu.getLayoutParams(); - params.bottomMargin = 0; + params.bottomMargin = bottomMargin; } public void setDescription(@NonNull String description) { diff --git a/OsmAnd/src/net/osmand/plus/onlinerouting/OnlineRoutingEngineFragment.java b/OsmAnd/src/net/osmand/plus/onlinerouting/OnlineRoutingEngineFragment.java index 541803dbfd..457fc2ee17 100644 --- a/OsmAnd/src/net/osmand/plus/onlinerouting/OnlineRoutingEngineFragment.java +++ b/OsmAnd/src/net/osmand/plus/onlinerouting/OnlineRoutingEngineFragment.java @@ -248,12 +248,17 @@ public class OnlineRoutingEngineFragment extends BaseOsmAndFragment { if (engine.vehicleType != vehicle) { engine.vehicleType = vehicle; updateCardViews(nameCard, vehicleCard, exampleCard); + if (vehicle == VehicleType.CUSTOM) { + vehicleCard.updateBottomMarginSelectionMenu((int) getResources().getDimension(R.dimen.content_padding)); + } else { + vehicleCard.updateBottomMarginSelectionMenu(0); + } return true; } return false; } }); - vehicleCard.removeBottomMarginSelectionMenu(); + vehicleCard.updateBottomMarginSelectionMenu(0); vehicleCard.setFieldBoxLabelText(getString(R.string.shared_string_custom)); vehicleCard.setOnTextChangedListener(new OnTextChangedListener() { @Override