Class FullScreen
Note that the browsers require user interaction to enter full screen mode, so this API should be called in response to a user action, like a button click or a similar event. Requesting full screen mode in a constructor of a view or using server push will likely not work as expected.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic com.vaadin.flow.shared.Registration
addFullscreenChangeListener
(com.vaadin.flow.component.ComponentEventListener<FullscreenChangeEvent> listener) static void
static CompletableFuture
<Boolean> Checks if the full screen mode is currently available.static CompletableFuture
<Boolean> Checks if the current UI is in full screen mode.static void
static void
requestFullscreen
(com.vaadin.flow.component.Component component) Requests full screen mode for the given component.static void
requestFullscreenRaw
(com.vaadin.flow.component.Component component) Deprecated.static void
requestFullscreenRaw
(com.vaadin.flow.dom.Element el) Deprecated.Requesting full screen for a specific element may have limitations in the current Vaadin version.
-
Constructor Details
-
FullScreen
public FullScreen()
-
-
Method Details
-
requestFullscreen
public static void requestFullscreen() -
requestFullscreen
public static void requestFullscreen(com.vaadin.flow.component.Component component) Requests full screen mode for the given component.Note that on the client side, fullscreen mode is technically requested for the html element and the rest of the view is hidden during the full screen mode. This is to work around current limitation in "overlay components" (like Notification, ComboBox popup, etc.) and theme. Thus, if you have some elements in the "index.html" that are not part of the Vaadin Flow view, they may not be visible in full screen mode. Same if you are using embedding. In these cases you might try using
requestFullscreenRaw(Component)
method instead.- Parameters:
component
- the component for which to request full screen mode- See Also:
-
requestFullscreenRaw
@Deprecated(forRemoval=false) public static void requestFullscreenRaw(com.vaadin.flow.dom.Element el) Deprecated.Requesting full screen for a specific element may have limitations in the current Vaadin version. Consider usingrequestFullscreen(Component)
instead.Requests full screen mode for the given element.- Parameters:
el
- the element for which to request full screen mode
-
requestFullscreenRaw
@Deprecated(forRemoval=false) public static void requestFullscreenRaw(com.vaadin.flow.component.Component component) Deprecated.Consider usingrequestFullscreen(Component)
instead. See implementation notes inrequestFullscreen(Component)
for more information.Requests full screen mode for the given component's element.- Parameters:
component
- the component for which to request full screen mode
-
exitFullscreen
public static void exitFullscreen() -
isFullscreen
Checks if the current UI is in full screen mode.- Returns:
- a CompletableFuture that resolves to true if the UI is in full screen mode, false otherwise
-
fullScreenAvailable
Checks if the full screen mode is currently available.- Returns:
- a CompletableFuture that resolves to true if full screen mode is available, false otherwise
-
addFullscreenChangeListener
public static com.vaadin.flow.shared.Registration addFullscreenChangeListener(com.vaadin.flow.component.ComponentEventListener<FullscreenChangeEvent> listener)
-
requestFullscreen(Component)
instead.