Hi everyone,
i have a Component which shows an image on the left and on the right are some inputs.
Currently i have it like the code below, but i think there must be a better way. On smaller devices the image gets not resized.
Has anyone a hint how to improve it?
private Component createTop() {
Div div = new Div();
div.addClassNames(LumoUtility.Display.FLEX, LumoUtility.FlexWrap.WRAP, LumoUtility.FlexDirection.COLUMN,
LumoUtility.FlexDirection.Breakpoint.Medium.ROW, LumoUtility.Gap.MEDIUM);
div.setWidthFull();
Image image = new Image("/images/banner2.png", "");
image.setMaxWidth("50%");
div.add(image);
Div searchBox = new Div();
searchBox.addClassNames(LumoUtility.FlexDirection.COLUMN);
searchBox.getStyle().set("margin", "0 auto");
searchBox.getStyle().setJustifyContent(Style.JustifyContent.CENTER);
searchBox.getStyle().setAlignItems(Style.AlignItems.CENTER);
searchBox.getStyle().setAlignSelf(Style.AlignSelf.CENTER);
searchBox.getStyle().setTextAlign(Style.TextAlign.CENTER);
searchBox.setMaxWidth("100%");
HorizontalLayout horizontalLayoutCity = new HorizontalLayout();
horizontalLayoutCity.add(tfZip, selectDistance);
searchBox.add(horizontalLayoutCity);
div.add(searchBox);
return div;
}