CodenameOne icon indicating copy to clipboard operation
CodenameOne copied to clipboard

BrowserComponent paints its own container bg white (ios) or gray/black/white (and) during form transition

Open javieranton-zz opened this issue 5 years ago • 2 comments

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

javieranton-zz avatar Aug 03 '20 07:08 javieranton-zz

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();
            });

javieranton-zz avatar Aug 03 '20 15:08 javieranton-zz

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)

javieranton-zz avatar May 12 '21 10:05 javieranton-zz