-
Notifications
You must be signed in to change notification settings - Fork 426
Description
Describe the bug
Affecting Android (Samsung) devices that use virtual buttons in the Navigation bar. setSafeArea(true) is not applying correctly to containers which causes the Navigation bar to overlay the container. If .setSafeArea(true) is applied to the whole form then this doesn't happen
To Reproduce
Scrollable form with enough content to scroll.
Applying safe area to just containers causes the issue
Test Case
Form form = new Form("Blank Page", new BorderLayout());
Container northcnt = new Container(new BoxLayout(BoxLayout.Y_AXIS));
Container centercnt = new Container(new BoxLayout(BoxLayout.Y_AXIS));
centercnt.setScrollableY(true);
Button b_north = new Button("North");
FloatingActionButton fab = FloatingActionButton.createFAB(FontImage.MATERIAL_ADD);
fab.addActionListener(e -> {
});
fab.bindFabToContainer(form.getContentPane(), Component.RIGHT, Component.BOTTOM);
northcnt.add(b_north);
// Add 50 test buttons
for (int i = 1; i <= 50; i++) {
Button b_test = new Button("Test Button " + i);
centercnt.add(b_test);
}
northcnt.setSafeArea(true);
centercnt.setSafeArea(true);
form.add(BorderLayout.NORTH, northcnt).add(BorderLayout.CENTER, centercnt);
form.show();
Expected behaviour
For the navigation bar not o to overlap containers and FAB when the setSafeArea(true) is applied.
Screenshots
Safe Area applied to Containers
Smartphone (please complete the following information):
- Device: Galaxy Samsung S21 Ultra & Galaxy Samsung S24
- OS: Andoroid 15
Additional context
Applying safe area to the form causes issues with space around the iPhone's notch/display cut out for the camera, so I'd rather avoid doing that.