@HtmlImport(value="frontend://webapi/screen.html") @Tag(value="rap-screen") public class Screen extends JavascriptTemplate<Screen.ScreenTemplateModel>
| Modifier and Type | Class and Description |
|---|---|
static class |
Screen.LockOrientation |
static interface |
Screen.ScreenTemplateModel |
| Constructor and Description |
|---|
Screen(com.vaadin.flow.component.HasElement target) |
| Modifier and Type | Method and Description |
|---|---|
com.vaadin.flow.shared.Registration |
addFullscreenErrorListener(com.vaadin.flow.function.SerializableConsumer<FullscreenError> listener)
This listener is triggered when a call to
#requestFullscreen(Element, FullscreenOptions) returned an
error. |
com.vaadin.flow.shared.Registration |
addFullscreenExitErrorListener(com.vaadin.flow.function.SerializableConsumer<FullscreenExitError> listener)
This listener is triggered when a call to
exitFullscreen() returned an error. |
com.vaadin.flow.shared.Registration |
addScreenOrientationListener(com.vaadin.flow.function.SerializableConsumer<ScreenOrientation> listener)
Register a callback that is triggered everytime the devices screen orientation has changed.
|
void |
exitFullscreen()
This method can be called to exit a previously fullscreened element.
|
static void |
fullscreenEnabled(com.vaadin.flow.function.SerializableConsumer<Boolean> callback)
Asks the device if fullscreening is available.
|
static void |
getScreenOrientation(Consumer<ScreenOrientation> callback)
Ask the device in which screen orientation it currently is.
|
static void |
lockScreenOrientation(Screen.LockOrientation orientation)
Lock the current screen orientation.
|
void |
requestFullscreen(FullscreenOptions options)
Asks the user agent to place the target element (and, by extension, its descendants) into full-screen mode.
|
static void |
unlockScreenOrientation()
Unlock the screen orientation.
|
void |
unregisterAllScreenOrientationListeners()
Unregister all previously registered listeners.
|
clearConsumers, notifyConsumers, registerConsumer, registerConsumer, unregisterAllConsumers, unregisterAllConsumersgetModel, getModelType, getModelType, getStateNode, initModel, isSupportedClassaddListener, fireEvent, from, get, getElement, getEventBus, getId, getLocale, getParent, getTranslation, getTranslation, getUI, hasListener, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, set, setElement, setId, setVisiblepublic com.vaadin.flow.shared.Registration addScreenOrientationListener(com.vaadin.flow.function.SerializableConsumer<ScreenOrientation> listener)
listener - The listener triggered when the screen orientation is received from the client. It will consume the
current screen orientation.public com.vaadin.flow.shared.Registration addFullscreenErrorListener(com.vaadin.flow.function.SerializableConsumer<FullscreenError> listener)
#requestFullscreen(Element, FullscreenOptions) returned an
error. The consumer can be removed with the returned Registration.public com.vaadin.flow.shared.Registration addFullscreenExitErrorListener(com.vaadin.flow.function.SerializableConsumer<FullscreenExitError> listener)
exitFullscreen() returned an error. The consumer can be
removed with the returned Registration.public static void fullscreenEnabled(com.vaadin.flow.function.SerializableConsumer<Boolean> callback)
callback - The callback triggered when the result is returned to the server. It consumes the Boolean indicating
if the device supports fullscreening or not.public void requestFullscreen(FullscreenOptions options)
addFullscreenErrorListener(SerializableConsumer) method are
triggered. Fullscreen can be exited with the #exitFullscreen(Consumer) method.options - Currently only contains the option if the navigation ui of the browser should be shown or not.public void exitFullscreen()
addFullscreenExitErrorListener(SerializableConsumer)
method are triggered. To fullscreen an element the
requestFullscreen(FullscreenOptions) method can be called.public static void getScreenOrientation(Consumer<ScreenOrientation> callback)
callback - The callback triggered when the screen orientation is received. It will consume the current screen
orientation.public void unregisterAllScreenOrientationListeners()
public static void lockScreenOrientation(Screen.LockOrientation orientation)
exitFullscreen() method or by unlocking the current screen orientation with the
unlockScreenOrientation() method#requestFullscreen(Element, FullscreenOptions) method.orientation - The orientation the screen should be locked in.public static void unlockScreenOrientation()
lockScreenOrientation(LockOrientation) method.Copyright © 2020 XDEV Software Corp.. All rights reserved.