Module com.gluonhq.attach.battery
Package com.gluonhq.attach.battery.impl
Class AndroidBatteryService
java.lang.Object
com.gluonhq.attach.battery.impl.AndroidBatteryService
- All Implemented Interfaces:
BatteryService
-
Property Summary
TypePropertyDescriptionjavafx.beans.property.ReadOnlyFloatProperty
Returns a property that will be frequently updated to reflect the current battery level.javafx.beans.property.ReadOnlyBooleanProperty
Returns a property that will be updated to reflect whether the device is plugged in to an external power source or not. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionjavafx.beans.property.ReadOnlyFloatProperty
Returns a property that will be frequently updated to reflect the current battery level.float
Gets the value of the property batteryLevel.boolean
Gets the value of the property pluggedIn.javafx.beans.property.ReadOnlyBooleanProperty
Returns a property that will be updated to reflect whether the device is plugged in to an external power source or not.
-
Property Details
-
batteryLevel
public javafx.beans.property.ReadOnlyFloatProperty batteryLevelProperty- Specified by:
batteryLevelProperty
in interfaceBatteryService
- Returns:
- A property containing the current battery level.
- See Also:
-
pluggedIn
public javafx.beans.property.ReadOnlyBooleanProperty pluggedInProperty- Specified by:
pluggedInProperty
in interfaceBatteryService
- Returns:
- A property containing the plugged-in status of the device.
- See Also:
-
-
Constructor Details
-
AndroidBatteryService
public AndroidBatteryService()
-
-
Method Details
-
getBatteryLevel
public float getBatteryLevel()Gets the value of the property batteryLevel.- Specified by:
getBatteryLevel
in interfaceBatteryService
- Property description:
- Returns:
- A float value between 0 and 1 to indicate battery charge levels.
-
batteryLevelProperty
public javafx.beans.property.ReadOnlyFloatProperty batteryLevelProperty()Description copied from interface:BatteryService
Returns a property that will be frequently updated to reflect the current battery level.- Specified by:
batteryLevelProperty
in interfaceBatteryService
- Returns:
- A property containing the current battery level.
- See Also:
-
isPluggedIn
public boolean isPluggedIn()Gets the value of the property pluggedIn.- Specified by:
isPluggedIn
in interfaceBatteryService
- Property description:
- Returns:
- Returns true to indicate power is coming from an external source, and false to indicate that the battery is powering the device.
-
pluggedInProperty
public javafx.beans.property.ReadOnlyBooleanProperty pluggedInProperty()Description copied from interface:BatteryService
Returns a property that will be updated to reflect whether the device is plugged in to an external power source or not.- Specified by:
pluggedInProperty
in interfaceBatteryService
- Returns:
- A property containing the plugged-in status of the device.
- See Also:
-