0

I've recently upgrade Gluon from 3.0.0 to 4.0.1. This code now refuses to compile:

    addViewFactory(SECONDARY_VIEW, () -> {
        FloatingActionButton fab = new FloatingActionButton(MaterialDesignIcon.CLOSE.text, e -> {
            ViewTest.getInstance().switchView(ViewTest.PRIMARY_VIEW);
        });

        final Button button = new Button("Click");
        button.setOnAction(e -> fab.setFloatingActionButtonHandler(FloatingActionButton.BOTTOM_LEFT));
        View view = new View("Name") {
            {
                getLayers().add(fab);
            }

            @Override
            protected void updateAppBar(AppBar appBar) {
                appBar.setTitleText("FloatingActionButton");
            }
        };
        return view;
    });

The JavaDoc doesn't seem to have changed, but building with 4.0.1 yields this error for getLayers().add(fab):

"The method add(Layer) in the type List is not applicable for the arguments (FloatingActionButton)"

I created two separate projects to test using 3.0.0 and 4.0.1 to verify. I can't really go back to 3.0.0 at this point.

Thanks.

Eric Forte
  • 11
  • 1
  • You are right, the JavaDoc is not up to the date. You have to use now: `getLayers().add(fab.getLayer());`. I've filed an issue on this to fix it. – José Pereda Nov 02 '16 at 18:07
  • Thanks, José! Makes sense. – Eric Forte Nov 02 '16 at 18:13
  • The new IDE plugins (2.4.0) already include this change, among others, in case you create a new project, but updating old projects to Gluon Charm 4+ will fail to compile and require manual update, as you have just found out. – José Pereda Nov 02 '16 at 18:15

0 Answers0