Screen Size

Hello,

In Vaadin 10 - how can I get either the current screen or viewport size in pixels?

In previous version it was possible to call either ScreenSize.getScreenSize() or Page.getCurrent().getBrowserWindowWidth() but neither seem to be available now.

Thanks,
P

UI.getCurrent().getSession().getBrowser().getScreenWidth();

At what point should those values be populated?

I have tried calling during the Component’s constructor, @PostContructor annotated method and the overriden onAttach(AttachEvent attachEvent) method and for all the values are -1.

Sorry, I coded this in my migrated application but this part was not tested yet. I am also getting -1.
I am calling this from the protected void init(VaadinRequest request) method of my extended UI class.

I think, we will have to wait for the response from any Vaadin team member on this.