-
public final class WearDataLayerAppHelper extends DataLayerAppHelperSubclass of DataLayerAppHelper for use on Wear devices.
Parameter appStoreUri should be provided when using functions like installOnNode with an iOS device.
-
-
Field Summary
Fields Modifier and Type Field Description private final Flow<SurfacesInfo>surfacesInfoprivate final Flow<Set<Node>>connectedAndInstalledNodes
-
Constructor Summary
Constructors Constructor Description WearDataLayerAppHelper(Context context, WearDataLayerRegistry registry, CoroutineScope scope, String appStoreUri)
-
Method Summary
Modifier and Type Method Description final Flow<SurfacesInfo>getSurfacesInfo()Return the SurfacesInfo of this node. Flow<Set<Node>>getConnectedAndInstalledNodes()AppHelperResultCodeinstallOnNode(String nodeId)AppHelperResultCodestartCompanion(String nodeId)final UnitmarkTileAsInstalled(String tileName)Marks a tile as installed. final UnitmarkActivityLaunchedOnce()Marks that the main activity has been launched at least once. final UnitmarkSetupComplete()Marks that the necessary setup steps have been completed in the app such that it is ready for use. final UnitmarkSetupNoLongerComplete()Marks that the app is no longer considered in a fully setup state. final UnitmarkTileAsRemoved(String tileName)Marks a tile as removed. final UnitmarkComplicationAsActivated(String complicationName, Integer complicationInstanceId, ComplicationType complicationType)Marks a complication as activated. final UnitmarkComplicationAsDeactivated(String complicationName, Integer complicationInstanceId, ComplicationType complicationType)Marks a complication as deactivated. -
Methods inherited from class com.google.android.horologist.datalayer.watch.WearDataLayerAppHelper
connectedNodes, isAvailable, startRemoteActivity, startRemoteOwnApp -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getSurfacesInfo
final Flow<SurfacesInfo> getSurfacesInfo()
Return the SurfacesInfo of this node.
-
getConnectedAndInstalledNodes
Flow<Set<Node>> getConnectedAndInstalledNodes()
-
installOnNode
AppHelperResultCode installOnNode(String nodeId)
-
startCompanion
@CheckResult() AppHelperResultCode startCompanion(String nodeId)
-
markTileAsInstalled
final Unit markTileAsInstalled(String tileName)
Marks a tile as installed. Call this in TileService#onTileAddEvent. Supplying a name is mandatory to disambiguate from the installation or removal of other tiles your app may have.
- Parameters:
tileName- The name of the tile.
-
markActivityLaunchedOnce
final Unit markActivityLaunchedOnce()
Marks that the main activity has been launched at least once.
-
markSetupComplete
final Unit markSetupComplete()
Marks that the necessary setup steps have been completed in the app such that it is ready for use. Typically this should be called when any pairing/login has been completed.
-
markSetupNoLongerComplete
final Unit markSetupNoLongerComplete()
Marks that the app is no longer considered in a fully setup state. For example, the user has logged out. This will roll the state back to the app having been used once - if the setup had previously been completed, but will have no effect if this is not the case.
-
markTileAsRemoved
final Unit markTileAsRemoved(String tileName)
Marks a tile as removed. Call this in TileService#onTileRemoveEvent. Supplying a name is mandatory to disambiguate from the installation or removal of other tiles your app may have.
- Parameters:
tileName- The name of the tile.
-
markComplicationAsActivated
final Unit markComplicationAsActivated(String complicationName, Integer complicationInstanceId, ComplicationType complicationType)
Marks a complication as activated. Call this in ComplicationDataSourceService.onComplicationActivated.
- Parameters:
complicationName- The name of the complication, to disambiguate from others.complicationInstanceId- Passed from ComplicationDataSourceService.onComplicationActivatedcomplicationType- Passed from ComplicationDataSourceService.onComplicationActivated
-
markComplicationAsDeactivated
final Unit markComplicationAsDeactivated(String complicationName, Integer complicationInstanceId, ComplicationType complicationType)
Marks a complication as deactivated. Call this in ComplicationDataSourceService.onComplicationDeactivated.
- Parameters:
complicationName- The name of the complication, to disambiguate from others.complicationInstanceId- Passed from ComplicationDataSourceService.onComplicationDeactivatedcomplicationType- Passed from ComplicationDataSourceService.onComplicationDeactivated
-
-
-
-