CodenameOne
CodenameOne copied to clipboard
BrowserComponent paints its own container bg white (ios) or gray/black/white (and) during form transition
As discussed here (video inside) https://stackoverflow.com/questions/63221810/is-there-a-way-to-get-rid-of-brief-browsercomponent-white-flash-during-form-in-o/63223272#63223272
Here is some sample test code (a button with an action that shows a black-bg form with black-bg browser). What should be a completely black background briefly flashes a white one during form in/out transitions
Button showBrowserBtn = new Button("Show browser");
showBrowserBtn.addActionListener(l->{
Form currentForm = com.codename1.ui.CN.getCurrentForm();
Form coloredForm = new Form("Browser test", new BorderLayout());
coloredForm.getAllStyles().setBgColor(0x000000);
coloredForm.getToolbar().addMaterialCommandToLeftBar("", FontImage.MATERIAL_ARROW_BACK, ee -> {
currentForm.showBack();
});
BrowserComponent bc = new BrowserComponent();
coloredForm.add(BorderLayout.CENTER,bc);
String html = "<!DOCTYPE html><html><body style='background-color: #000000'></body></html>";
bc.setPage(html,null);
coloredForm.show();
});
It would be great if this one could be fixed. Showing a black bg when device is in dark mode, and a white one when not should do the trick (and, ios)