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<*>>
)

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

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.

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()
)

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 batchingModeOverridesSet<BatchingMode>

BatchingMode overrides for this exercise

dataTypes

Added in 1.0.0
val dataTypesSet<DataType<*, *>>

DataType which will be tracked for this exercise

exerciseEventTypes

Added in 1.1.0-alpha02
val exerciseEventTypesSet<ExerciseEventType<*>>

ExerciseEventTypes which should be tracked for this exercise

exerciseGoals

Added in 1.0.0
val exerciseGoalsList<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 exerciseParamsBundle

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 exerciseTypeExerciseType

ExerciseType user is performing for this exercise

exerciseTypeConfig

Added in 1.0.0
val exerciseTypeConfigExerciseTypeConfig?

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

isAutoPauseAndResumeEnabled

Added in 1.0.0
val isAutoPauseAndResumeEnabledBoolean

whether auto-pause/resume is enabled for this exercise

isGpsEnabled

Added in 1.0.0
val isGpsEnabledBoolean

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 swimmingPoolLengthMetersFloat

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