fix descrease padding below scroll buttons in "Vehicle" block

This commit is contained in:
Skalii 2021-01-14 13:13:55 +02:00
parent 4c4a439adc
commit ebbcb1778f
2 changed files with 8 additions and 3 deletions

View file

@ -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) {

View file

@ -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