{"action":"created","issue":{"url":"https://api.github.com/repos/codenameone/CodenameOne/issues/1638","labels_url":"https://api.github.com/repos/codenameone/CodenameOne/issues/1638/labels{/name}","comments_url":"https://api.github.com/repos/codenameone/CodenameOne/issues/1638/comments","events_url":"https://api.github.com/repos/codenameone/CodenameOne/issues/1638/events","html_url":"https://github.com/codenameone/CodenameOne/issues/1638","id":126911776,"number":1638,"title":"Android dialogs broken in latest build","user":{"login":"mwarnett","id":14006739,"avatar_url":"https://avatars.githubusercontent.com/u/14006739?v=3","gravatar_id":"","url":"https://api.github.com/users/mwarnett","html_url":"https://github.com/mwarnett","followers_url":"https://api.github.com/users/mwarnett/followers","following_url":"https://api.github.com/users/mwarnett/following{/other_user}","gists_url":"https://api.github.com/users/mwarnett/gists{/gist_id}","starred_url":"https://api.github.com/users/mwarnett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwarnett/subscriptions","organizations_url":"https://api.github.com/users/mwarnett/orgs","repos_url":"https://api.github.com/users/mwarnett/repos","events_url":"https://api.github.com/users/mwarnett/events{/privacy}","received_events_url":"https://api.github.com/users/mwarnett/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-01-15T16:54:43Z","updated_at":"2016-01-15T17:15:46Z","closed_at":null,"body":"![screenshot_2016-01-13-14-13-30](https://cloud.githubusercontent.com/assets/14006739/12358893/5935132a-bb64-11e5-9719-d118a4d3f463.png)\r\n![screenshot_2016-01-13-14-12-55](https://cloud.githubusercontent.com/assets/14006739/12358902/67cb647a-bb64-11e5-8ea0-bfedcedef2ea.png)\r\n\r\nThe first screenshot, the books screen shot, shows one of my dialogs as it has always looked.\r\n\r\nThe second screenshot, the music screenshot, displays the same dialog in a new build. The dialog is not opaque, the background form is partially visible. The titlebar and many fields now have a gray background.\r\n\r\nSame code for both dialogs.\r\n\r\nI have tried to come up with a test case to reproduce this. The following code does exhibit many of the same problems but for some unknown reason the background color is a much lighter gray. You have to move the screen around to see that many fields do have a background color. Hopefully if you can fix this it will fix the problems in my shipping app too.\r\n\r\npackage com.readerware.xware.test;\r\n\r\n\r\nimport com.codename1.components.InfiniteProgress;\r\nimport com.codename1.io.Log;\r\nimport com.codename1.ui.Button;\r\nimport com.codename1.ui.Command;\r\nimport com.codename1.ui.Component;\r\nimport com.codename1.ui.Container;\r\nimport com.codename1.ui.Dialog;\r\nimport com.codename1.ui.Display;\r\nimport com.codename1.ui.Form;\r\nimport com.codename1.ui.Label;\r\nimport com.codename1.ui.events.ActionEvent;\r\nimport com.codename1.ui.events.ActionListener;\r\nimport com.codename1.ui.layouts.BorderLayout;\r\nimport com.codename1.ui.List;\r\nimport com.codename1.ui.layouts.GridBagConstraints;\r\nimport com.codename1.ui.layouts.GridBagLayout;\r\nimport com.codename1.ui.layouts.Insets;\r\nimport com.codename1.ui.list.DefaultListModel;\r\nimport com.codename1.ui.list.ListModel;\r\nimport com.codename1.ui.plaf.Style;\r\nimport com.codename1.ui.plaf.UIManager;\r\nimport com.codename1.ui.TextArea;\r\nimport com.codename1.ui.TextField;\r\nimport com.codename1.ui.Toolbar;\r\nimport com.codename1.ui.animations.CommonTransitions;\r\nimport com.codename1.ui.layouts.FlowLayout;\r\nimport com.codename1.ui.util.Resources;\r\nimport java.io.IOException;\r\n\r\npublic class TWMain {\r\n\r\n    private Form current;\r\n    private Form form;\r\n    protected Toolbar _myToolbar;\r\n\r\n    public void init(Object context) {\r\n        try {\r\n            Resources theme = Resources.openLayered(\"/theme\");\r\n            UIManager.getInstance().setThemeProps(theme.getTheme(theme.getThemeResourceNames()[0]));\r\n        } catch(IOException e){\r\n            e.printStackTrace();\r\n        }\r\n        // Pro users - uncomment this code to get crash reports sent to you automatically\r\n        Display.getInstance().addEdtErrorHandler(new ActionListener() {\r\n            public void actionPerformed(ActionEvent evt) {\r\n                evt.consume();\r\n                Log.p(\"Exception in AppName version \" + Display.getInstance().getProperty(\"AppVersion\", \"Unknown\"));\r\n                Log.p(\"OS \" + Display.getInstance().getPlatformName());\r\n                Log.p(\"Error \" + evt.getSource());\r\n                Log.p(\"Current Form \" + Display.getInstance().getCurrent().getName());\r\n                Log.e((Throwable)evt.getSource());\r\n                Log.sendLog();\r\n            }\r\n        });\r\n    }\r\n\r\n    public void start() {\r\n        if(current != null){\r\n            current.show();\r\n            return;\r\n        }\r\n\r\n        form = new MyForm();\r\n\r\n        form.show();\r\n    }\r\n\r\n    public void stop() {\r\n        current = Display.getInstance().getCurrent();\r\n    }\r\n\r\n    public void destroy() {\r\n    }\r\n\r\n\r\n    private class MyForm    extends     Form\r\n                            implements  ActionListener {\r\n        public MyForm() {\r\n            super(\"CodenameOne Test\");\r\n            getContentPane().setLayout(new BorderLayout());\r\n\r\n            setTintColor(0x80808080);\r\n\r\n            Command backCommand = new Command(\"Home\", 1);\r\n            setBackCommand(backCommand);\r\n\r\n            _myToolbar = new Toolbar();\r\n            setToolBar(_myToolbar);\r\n            _myToolbar.setTitle(\"My Test App\");\r\n\r\n            Command command1 = new Command(\"Menu 1\", 2);\r\n            _myToolbar.addCommandToOverflowMenu(command1);\r\n\r\n            Command command2 = new Command(\"Menu 2\", 3);\r\n            _myToolbar.addCommandToOverflowMenu(command2);\r\n\r\n            Command command3 = new Command(\"Menu 3\", 4);\r\n            _myToolbar.addCommandToOverflowMenu(command3);\r\n\r\n            Command command4 = new Command(\"Menu 4\", 5);\r\n            _myToolbar.addCommandToOverflowMenu(command4);\r\n\r\n            Command command5 = new Command(\"Menu 5\", 6);\r\n            _myToolbar.addCommandToOverflowMenu(command5);\r\n\r\n            addCommandListener(this);\r\n\r\n            setLayout(new BorderLayout());\r\n            setScrollable(false);\r\n\r\n            ListModel listModel = new DefaultListModel();\r\n\r\n            for (int i=0; i<100; i++) {\r\n                listModel.addItem(\"Line \" + (i + 1));\r\n            }\r\n\r\n            List list = new List();\r\n            list.setScrollVisible(false);\r\n            list.setModel(listModel);\r\n            addComponent(BorderLayout.CENTER, list);\r\n        }\r\n\r\n\r\n        public void actionPerformed(ActionEvent actionEvent) {\r\n            Command command = actionEvent.getCommand();\r\n\r\n            if (command != null) {\r\n                int cmd = command.getId();\r\n\r\n                switch (cmd) {\r\n                  case 1:\r\n                    stop();\r\n                    Display.getInstance().exitApplication();\r\n                    return;\r\n\r\n                  case 2:\r\n                    ConnectForm connectForm = new ConnectForm();\r\n                    connectForm.show();\r\n                    break;\r\n\r\n                  default:\r\n                    break;\r\n                }\r\n            }\r\n        }\r\n    }\r\n\r\n\r\n    private class ConnectForm   extends    Dialog {\r\n\r\n        private Command                         _backCommand;\r\n        private TextField                       _hostField;\r\n        private TextField                       _portField;\r\n        private InfiniteProgress                _progress;\r\n        private Label                           _statusMessage;\r\n        private Label                           _completeMessage;\r\n        private Command                         _connectCommand;\r\n        private Button                          _connectButton;\r\n        private Command                         _cancelCommand;\r\n        private Button                          _cancelButton;\r\n        private Command                         _doneCommand;\r\n\r\n        /**\r\n          *  Display a connection dialog and then process the request.\r\n          */\r\n        public ConnectForm() {\r\n            super(\"Connect to Readerware\");\r\n            setName(\"ConnectForm\");\r\n            setAutoDispose(false);\r\n\r\n            _backCommand = new Command(\"List\");\r\n            setBackCommand(_backCommand);\r\n\r\n            GridBagLayout gbl = new GridBagLayout();\r\n            GridBagConstraints gbc = new GridBagConstraints();\r\n            setLayout(gbl);\r\n\r\n            int y = 0;\r\n            int x = 0;\r\n            TextArea intro = new TextArea(\"To connect to Readerware 3 (Music) enter the host name OR the IP address of your computer. The default port is 9030.\");\r\n            intro.setUIID(\"Label\");\r\n            intro.setEditable(false);\r\n            intro.setRows(3);\r\n            intro.setGrowByContent(false);\r\n            intro.setScrollVisible(false);\r\n            gbc.anchor        = GridBagConstraints.NORTHWEST;\r\n            gbc.gridx         = x;\r\n            gbc.gridy         = y;\r\n            gbc.gridwidth     = GridBagConstraints.REMAINDER;\r\n            gbc.gridheight    = 1;\r\n            gbc.fill          = GridBagConstraints.BOTH;\r\n            gbc.weightx       = 0.0;\r\n            gbc.weighty       = 0.0;\r\n            gbc.insets        = new Insets(5, 10, 0, 10);\r\n            gbl.setConstraints(intro, gbc);\r\n            addComponent(intro);\r\n\r\n            y++;\r\n            x = 0;\r\n\r\n            Label host = new Label(\"Host ir IP:\");\r\n            gbc.anchor        = GridBagConstraints.NORTHWEST;\r\n            gbc.gridx         = x;\r\n            gbc.gridy         = y;\r\n            gbc.gridwidth     = 1;\r\n            gbc.gridheight    = 1;\r\n            gbc.fill          = GridBagConstraints.BOTH;\r\n            gbc.weightx       = 0.0;\r\n            gbc.weighty       = 0.0;\r\n            gbc.insets        = new Insets(0, 10, 10, 0);\r\n            gbl.setConstraints(host, gbc);\r\n            addComponent(host);\r\n            x++;\r\n\r\n            _hostField = new TextField();\r\n            _hostField.setHint(\"Host name or IP address\");\r\n            gbc.anchor        = GridBagConstraints.NORTHWEST;\r\n            gbc.gridx         = x;\r\n            gbc.gridy         = y;\r\n            gbc.gridwidth     = GridBagConstraints.REMAINDER;\r\n            gbc.gridheight    = 1;\r\n            gbc.fill          = GridBagConstraints.HORIZONTAL;\r\n            gbc.weightx       = 0.1;\r\n            gbc.weighty       = 0.0;\r\n            gbc.insets        = new Insets(0, 10, 10, 10);\r\n            gbl.setConstraints(_hostField, gbc);\r\n            addComponent(_hostField);\r\n\r\n            y++;\r\n            x = 0;\r\n\r\n            Label port = new Label(\"Port:\");\r\n            gbc.anchor        = GridBagConstraints.NORTHWEST;\r\n            gbc.gridx         = x;\r\n            gbc.gridy         = y;\r\n            gbc.gridwidth     = 1;\r\n            gbc.gridheight    = 1;\r\n            gbc.fill          = GridBagConstraints.BOTH;\r\n            gbc.weightx       = 0.0;\r\n            gbc.weighty       = 0.0;\r\n            gbc.insets        = new Insets(0, 10, 0, 0);\r\n            gbl.setConstraints(port, gbc);\r\n            addComponent(port);\r\n            x++;\r\n\r\n            _portField = new TextField();\r\n            _portField.setHint(\"Port number\");\r\n            _portField.setInputMode(\"123\");\r\n            _portField.setConstraint(TextArea.NUMERIC);\r\n            gbc.anchor        = GridBagConstraints.NORTHWEST;\r\n            gbc.gridx         = x;\r\n            gbc.gridy         = y;\r\n            gbc.gridwidth     = GridBagConstraints.REMAINDER;\r\n            gbc.gridheight    = 1;\r\n            gbc.fill          = GridBagConstraints.HORIZONTAL;\r\n            gbc.weightx       = 0.1;\r\n            gbc.weighty       = 0.0;\r\n            gbc.insets        = new Insets(0, 10, 0, 10);\r\n            gbl.setConstraints(_portField, gbc);\r\n            addComponent(_portField);\r\n\r\n            y++;\r\n            x = 0;\r\n            _progress = new InfiniteProgress();\r\n            _progress.setVisible(false);\r\n\r\n            /*\r\n             * Put in container, we want this component to be invisible initially.\r\n             * If we add it directly when it is hidden, no space is allocated\r\n             * and it is never shown.\r\n             */\r\n            Container progress = new Container(new FlowLayout());\r\n            progress.addComponent(_progress);\r\n            gbc.anchor        = GridBagConstraints.NORTH;\r\n            gbc.gridx         = x;\r\n            gbc.gridy         = y;\r\n            gbc.gridwidth     = GridBagConstraints.REMAINDER;\r\n            gbc.gridheight    = 1;\r\n            gbc.fill          = GridBagConstraints.NONE;\r\n            gbc.weightx       = 0.0;\r\n            gbc.weighty       = 0.0;\r\n            gbc.insets        = new Insets(0, 10, 0, 10);\r\n            gbl.setConstraints(progress, gbc);\r\n            addComponent(progress);\r\n\r\n            y++;\r\n            x = 0;\r\n            _statusMessage = new Label(\" \");\r\n            _statusMessage.setPreferredW(500);\r\n            gbc.anchor        = GridBagConstraints.NORTHWEST;\r\n            gbc.gridx         = x;\r\n            gbc.gridy         = y;\r\n            gbc.gridwidth     = GridBagConstraints.REMAINDER;\r\n            gbc.gridheight    = 1;\r\n            gbc.fill          = GridBagConstraints.HORIZONTAL;\r\n            gbc.weightx       = 0.0;\r\n            gbc.weighty       = 0.0;\r\n            gbc.insets        = new Insets(0, 10, 0, 10);\r\n            gbl.setConstraints(_statusMessage, gbc);\r\n            addComponent(_statusMessage);\r\n\r\n            y++;\r\n            x = 0;\r\n            _completeMessage = new Label(\" \");\r\n            _completeMessage.setPreferredW(500);\r\n\r\n            gbc.anchor        = GridBagConstraints.NORTHWEST;\r\n            gbc.gridx         = x;\r\n            gbc.gridy         = y;\r\n            gbc.gridwidth     = GridBagConstraints.REMAINDER;\r\n            gbc.gridheight    = 1;\r\n            gbc.fill          = GridBagConstraints.HORIZONTAL;\r\n            gbc.weightx       = 0.0;\r\n            gbc.weighty       = 0.0;\r\n            gbc.insets        = new Insets(0, 10, 0, 10);\r\n            gbl.setConstraints(_completeMessage, gbc);\r\n            addComponent(_completeMessage);\r\n\r\n            y++;\r\n            x = 0;\r\n            Container buttons = new Container();\r\n            buttons.setLayout(new FlowLayout(Component.CENTER));\r\n            _cancelCommand = new Command(\"Cancel\");\r\n            _cancelButton = new Button(_cancelCommand);\r\n            buttons.addComponent(_cancelButton);\r\n            _connectCommand = new Command(\"Connect\");\r\n            _doneCommand = new Command(\"Done\");\r\n            _connectButton = new Button(_connectCommand);\r\n            buttons.addComponent(_connectButton);\r\n\r\n            gbc.anchor        = GridBagConstraints.NORTHWEST;\r\n            gbc.gridx         = x;\r\n            gbc.gridy         = y;\r\n            gbc.gridwidth     = GridBagConstraints.REMAINDER;\r\n            gbc.gridheight    = 1;\r\n            gbc.fill          = GridBagConstraints.HORIZONTAL;\r\n            gbc.weightx       = 0.0;\r\n            gbc.weighty       = 0.0;\r\n            gbc.insets        = new Insets(0, 10, 10, 10);\r\n            gbl.setConstraints(buttons, gbc);\r\n            addComponent(buttons);\r\n        }\r\n\r\n\r\n        public void actionCommand(Command command) {\r\n            if (command == _backCommand) {\r\n                dispose();\r\n                return;\r\n            }\r\n        }\r\n    }\r\n}\r\n"},"comment":{"url":"https://api.github.com/repos/codenameone/CodenameOne/issues/comments/172020192","html_url":"https://github.com/codenameone/CodenameOne/issues/1638#issuecomment-172020192","issue_url":"https://api.github.com/repos/codenameone/CodenameOne/issues/1638","id":172020192,"user":{"login":"mwarnett","id":14006739,"avatar_url":"https://avatars.githubusercontent.com/u/14006739?v=3","gravatar_id":"","url":"https://api.github.com/users/mwarnett","html_url":"https://github.com/mwarnett","followers_url":"https://api.github.com/users/mwarnett/followers","following_url":"https://api.github.com/users/mwarnett/following{/other_user}","gists_url":"https://api.github.com/users/mwarnett/gists{/gist_id}","starred_url":"https://api.github.com/users/mwarnett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwarnett/subscriptions","organizations_url":"https://api.github.com/users/mwarnett/orgs","repos_url":"https://api.github.com/users/mwarnett/repos","events_url":"https://api.github.com/users/mwarnett/events{/privacy}","received_events_url":"https://api.github.com/users/mwarnett/received_events","type":"User","site_admin":false},"created_at":"2016-01-15T17:15:46Z","updated_at":"2016-01-15T17:15:46Z","body":"Forget to mention when running the test app, select the first system menu item to display the dialog."}}