public interface DisplayService
Example
Services.get(DisplayService.class).ifPresent(service -> {
\u3000\u3000 Dimension2D resolution = service.getScreenResolution();
System.out.printf("Screen resolution: %.0fx%.0f", resolution.getWidth(), resolution.getHeight());
});
Android Configuration: none
iOS Configuration: none
| Modifier and Type | Method | Description |
|---|---|---|
javafx.geometry.Dimension2D |
getScreenResolution() |
Returns the screen resolution of the device.
|
float |
getScreenScale() |
Returns the logical density of the display
|
boolean |
isDesktop() |
Returns true if the device is considered a desktop / laptop.
|
boolean |
isPhone() |
Returns true if the device is considered a phone.
|
boolean |
isScreenRound() |
Returns true if the device has a round screen
|
boolean |
isTablet() |
Returns true if the device is considered a tablet.
|
boolean isPhone()
boolean isTablet()
charm-desktop-form
is set to tablet, it will return true. False otherwiseboolean isDesktop()
javafx.geometry.Dimension2D getScreenResolution()
float getScreenScale()
boolean isScreenRound()