ExerciseConfig


class ExerciseConfig


Defines configuration for an exercise tracked using Health Services.

Summary

Nested types

Builder for ExerciseConfig instances.

Constants

const Float

Public companion functions

ExerciseConfig.Builder
builder(exerciseType: ExerciseType)

Returns a fresh new Builder.

Public constructors

ExerciseConfig(
    exerciseType: ExerciseType,
    dataTypes: Set<DataType<*, *>>,
    isAutoPauseAndResumeEnabled: Boolean,
    isGpsEnabled: Boolean,
    exerciseGoals: List<ExerciseGoal<*>>,
    exerciseParams: Bundle,
    swimmingPoolLengthMeters: @FloatRange(from = 0.0) Float,
    exerciseTypeConfig: ExerciseTypeConfig?,
    batchingModeOverrides: Set<BatchingMode>,
    exerciseEventTypes: Set<ExerciseEventType<*>>,
    debouncedGoals: List<DebouncedGoal<*>>
)

Creates a new ExerciseConfig for an exercise tracked using Health Services

Public functions

open String

Public properties

Set<BatchingMode>

BatchingMode overrides for this exercise

Set<DataType<*, *>>

DataType which will be tracked for this exercise

List<DebouncedGoal<*>>

DebouncedGoals for this exercise.

Set<ExerciseEventType<*>>

ExerciseEventTypes which should be tracked for this exercise

List<ExerciseGoal<*>>

ExerciseGoals for this exercise.

Bundle

Bundle bundle for specifying exercise presets, the values of an on-going exercise which can be used to pre-populate a new exercise.

ExerciseType

ExerciseType user is performing for this exercise

ExerciseTypeConfig?

ExerciseTypeConfig containing attributes which may be modified after the exercise has started

Boolean

whether auto-pause/resume is enabled for this exercise

Boolean

whether GPS is enabled for this exercise.

@FloatRange(from = 0.0) Float

length (in meters) of the swimming pool, or 0 if not relevant to this exercise

Constants

SWIMMING_POOL_LENGTH_UNSPECIFIED

const val SWIMMING_POOL_LENGTH_UNSPECIFIED = 0.0f: Float

Public companion functions

builder

Added in 1.0.0
fun builder(exerciseType: ExerciseType): ExerciseConfig.Builder

Returns a fresh new Builder.

Parameters
exerciseType: ExerciseType

the ExerciseType representing this exercise

Public constructors

ExerciseConfig

ExerciseConfig(
    exerciseType: ExerciseType,
    dataTypes: Set<DataType<*, *>>,
    isAutoPauseAndResumeEnabled: Boolean,
    isGpsEnabled: Boolean,
    exerciseGoals: List<ExerciseGoal<*>> = listOf(),
    exerciseParams: Bundle = Bundle(),
    swimmingPoolLengthMeters: @FloatRange(from = 0.0) Float = SWIMMING_POOL_LENGTH_UNSPECIFIED,
    exerciseTypeConfig: ExerciseTypeConfig? = null,
    batchingModeOverrides: Set<BatchingMode> = emptySet(),
    exerciseEventTypes: Set<ExerciseEventType<*>> = emptySet(),
    debouncedGoals: List<DebouncedGoal<*>> = emptyList()
)

Creates a new ExerciseConfig for an exercise tracked using Health Services

Public functions

toString

open fun toString(): String

Public properties

batchingModeOverrides

Added in 1.0.0
val batchingModeOverrides: Set<BatchingMode>

BatchingMode overrides for this exercise

dataTypes

Added in 1.0.0
val dataTypes: Set<DataType<*, *>>

DataType which will be tracked for this exercise

debouncedGoals

Added in 1.1.0
val debouncedGoals: List<DebouncedGoal<*>>

DebouncedGoals for this exercise. DataTypes in DebouncedGoals must also be tracked.

exerciseEventTypes

Added in 1.1.0
val exerciseEventTypes: Set<ExerciseEventType<*>>

ExerciseEventTypes which should be tracked for this exercise

exerciseGoals

Added in 1.0.0
val exerciseGoals: List<ExerciseGoal<*>>

ExerciseGoals for this exercise. DataTypes in ExerciseGoals must also be tracked (i.e. contained in dataTypes) in some form. For example, an ExerciseGoal for DataType.STEPS_TOTAL requires that dataTypes contains either or both of DataType.STEPS_TOTAL / DataType.STEPS.

exerciseParams

Added in 1.0.0
val exerciseParams: Bundle

Bundle bundle for specifying exercise presets, the values of an on-going exercise which can be used to pre-populate a new exercise.

exerciseType

Added in 1.0.0
val exerciseType: ExerciseType

ExerciseType user is performing for this exercise

exerciseTypeConfig

Added in 1.0.0
val exerciseTypeConfig: ExerciseTypeConfig?

ExerciseTypeConfig containing attributes which may be modified after the exercise has started

isAutoPauseAndResumeEnabled

Added in 1.0.0
val isAutoPauseAndResumeEnabled: Boolean

whether auto-pause/resume is enabled for this exercise

isGpsEnabled

Added in 1.0.0
val isGpsEnabled: Boolean

whether GPS is enabled for this exercise. Must be set to true when DataType.LOCATION is present in dataTypes.

swimmingPoolLengthMeters

Added in 1.0.0
val swimmingPoolLengthMeters: @FloatRange(from = 0.0) Float

length (in meters) of the swimming pool, or 0 if not relevant to this exercise