Module com.gluonhq.attach.display
Package com.gluonhq.attach.display.impl
Class DesktopDisplayService
java.lang.Object
com.gluonhq.attach.display.impl.DesktopDisplayService
- All Implemented Interfaces:
DisplayService
-
Property Summary
PropertiesTypePropertyDescriptionjavafx.beans.property.ReadOnlyObjectProperty<DisplayService.Notch>Property that contains the position of the notch, if any, and can be used to track changes in its location.javafx.beans.property.ReadOnlyObjectProperty<javafx.geometry.Insets>Property that contains the insets of the system bars (typically the status bar at the top and the navigation bar at the bottom). -
Nested Class Summary
Nested classes/interfaces inherited from interface com.gluonhq.attach.display.DisplayService
DisplayService.Notch -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjavafx.geometry.Dimension2DReturns the default screen dimensions of a mobile device, in density independent pixel units.javafx.geometry.Dimension2DRetrieve the dimension of the primary screen based on its boundsfloatReturns the screen scale of the primary screenbooleanhasNotch()Indicates if the device has a notch that modifies the display or not.booleanReturns true if the device is considered a desktop / laptop.booleanisPhone()Returns true if the device is considered a phone.booleanReturns true if the device has a round screenbooleanisTablet()Returns true if the device is considered a tablet.javafx.beans.property.ReadOnlyObjectProperty<DisplayService.Notch>Property that contains the position of the notch, if any, and can be used to track changes in its location.javafx.beans.property.ReadOnlyObjectProperty<javafx.geometry.Insets>Property that contains the insets of the system bars (typically the status bar at the top and the navigation bar at the bottom).
-
Property Details
-
notch
- Specified by:
notchPropertyin interfaceDisplayService- Returns:
- A read only property with the position of the notch if present
-
systemBarsInsets
public javafx.beans.property.ReadOnlyObjectProperty<javafx.geometry.Insets> systemBarsInsetsProperty- Specified by:
systemBarsInsetsPropertyin interfaceDisplayService- Returns:
- A read only property with the insets of the system bars
-
-
Constructor Details
-
DesktopDisplayService
public DesktopDisplayService()
-
-
Method Details
-
isPhone
public boolean isPhone()Description copied from interface:DisplayServiceReturns true if the device is considered a phone.- Specified by:
isPhonein interfaceDisplayService- Returns:
- True if the device is considered a phone.
-
isTablet
public boolean isTablet()Description copied from interface:DisplayServiceReturns true if the device is considered a tablet.- Specified by:
isTabletin interfaceDisplayService- Returns:
- True if the device is considered a tablet.
Running on Desktop, if the property
charm-desktop-formis set totablet, it will return true. False otherwise
-
isDesktop
public boolean isDesktop()Description copied from interface:DisplayServiceReturns true if the device is considered a desktop / laptop.- Specified by:
isDesktopin interfaceDisplayService- Returns:
- True if the device is considered a desktop / laptop.
-
getScreenResolution
public javafx.geometry.Dimension2D getScreenResolution()Retrieve the dimension of the primary screen based on its bounds- Specified by:
getScreenResolutionin interfaceDisplayService- Returns:
- Dimension of the Screen
-
getDefaultDimensions
public javafx.geometry.Dimension2D getDefaultDimensions()Description copied from interface:DisplayServiceReturns the default screen dimensions of a mobile device, in density independent pixel units. In case of desktop, it gives the form factor of either a phone or a tablet.- Specified by:
getDefaultDimensionsin interfaceDisplayService- Returns:
- The screen dimensions of a mobile device, in dp units.
-
getScreenScale
public float getScreenScale()Returns the screen scale of the primary screen- Specified by:
getScreenScalein interfaceDisplayService- Returns:
- the screen scale
-
isScreenRound
public boolean isScreenRound()Description copied from interface:DisplayServiceReturns true if the device has a round screen- Specified by:
isScreenRoundin interfaceDisplayService- Returns:
- true if the device has a round screen
-
hasNotch
public boolean hasNotch()Description copied from interface:DisplayServiceIndicates if the device has a notch that modifies the display or not.- Specified by:
hasNotchin interfaceDisplayService- Returns:
- true if the device has a notch, false otherwise
-
notchProperty
Description copied from interface:DisplayServiceProperty that contains the position of the notch, if any, and can be used to track changes in its location.- Specified by:
notchPropertyin interfaceDisplayService- Returns:
- A read only property with the position of the notch if present
-
systemBarsInsetsProperty
public javafx.beans.property.ReadOnlyObjectProperty<javafx.geometry.Insets> systemBarsInsetsProperty()Description copied from interface:DisplayServiceProperty that contains the insets of the system bars (typically the status bar at the top and the navigation bar at the bottom). These insets can be used to add the necessary padding so the application doesn't get underneath the content shown at the system bars.- Specified by:
systemBarsInsetsPropertyin interfaceDisplayService- Returns:
- A read only property with the insets of the system bars
-