ExerciseState

class ExerciseState


The state of an exercise.

Summary

Public companion functions

ExerciseState?
fromId(id: Int)

Returns the ExerciseState object corresponding to id or null if none match.

Public companion properties

ExerciseState

The exercise is actively in-progress.

ExerciseState

The session has been automatically paused.

ExerciseState

The session is being paused by auto-pause.

ExerciseState

The session is being automatically resumed.

ExerciseState

The exercise has been ended, with the reason specified by ExerciseStateInfo.endReason.

ExerciseState

The exercise is currently ending, with the reason specified by ExerciseStateInfo.endReason.

ExerciseState

The exercise is being prepared, GPS and HeartRate sensors will be turned on if requested in the WarmUpConfig.

ExerciseState

The session has been paused by the user.

ExerciseState

The session is being paused by the user.

ExerciseState

The session is being resumed by the user.

ExerciseState

The exercise is actively being started, but we don't yet have sensor stability or GPS fix.

Public functions

open operator Boolean
equals(other: Any?)
open Int
open String

Public properties

Int
Boolean

Returns true if this ExerciseState corresponds to one of the ended states and false otherwise.

Boolean

Returns true if this ExerciseState corresponds to one of the ending states and false otherwise.

Boolean

Returns true if this ExerciseState corresponds to one of the paused states and false otherwise.

Boolean

Returns true if this ExerciseState corresponds to one of the resuming states and false otherwise.

String

Public companion functions

fromId

Added in 1.0.0
fun fromId(id: Int): ExerciseState?

Returns the ExerciseState object corresponding to id or null if none match.

Parameters
id: Int

the ExerciseState.id to match against

Public companion properties

ACTIVE

val ACTIVEExerciseState

The exercise is actively in-progress.

Used in both of the manually started exercise and the automatic exercise detection. It's also the state when the automatic exercise detection has detected an exercise and the exercise is actively in-progress.

AUTO_PAUSED

val AUTO_PAUSEDExerciseState

The session has been automatically paused. Sensors have completed flushing.

Used only in the manually started exercise.

AUTO_PAUSING

val AUTO_PAUSINGExerciseState

The session is being paused by auto-pause. Sensors are actively being flushed.

Used only in the manually started exercise.

AUTO_RESUMING

val AUTO_RESUMINGExerciseState

The session is being automatically resumed.

Used only in the manually started exercise.

ENDED

val ENDEDExerciseState

The exercise has been ended, with the reason specified by ExerciseStateInfo.endReason.

ENDING

val ENDINGExerciseState

The exercise is currently ending, with the reason specified by ExerciseStateInfo.endReason.

PREPARING

val PREPARINGExerciseState

The exercise is being prepared, GPS and HeartRate sensors will be turned on if requested in the WarmUpConfig.

USER_PAUSED

val USER_PAUSEDExerciseState

The session has been paused by the user. Sensors have completed flushing.

Used only in the manually started exercise.

USER_PAUSING

val USER_PAUSINGExerciseState

The session is being paused by the user. Sensors are actively being flushed.

Used only in the manually started exercise.

USER_RESUMING

val USER_RESUMINGExerciseState

The session is being resumed by the user.

Used only in the manually started exercise.

USER_STARTING

val USER_STARTINGExerciseState

The exercise is actively being started, but we don't yet have sensor stability or GPS fix.

Used only in the manually started exercise.

Public functions

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

toString

open fun toString(): String

Public properties

id

Added in 1.0.0
val idInt

isEnded

Added in 1.0.0
val isEndedBoolean

Returns true if this ExerciseState corresponds to one of the ended states and false otherwise. This method returns false if the exercise has been paused, to check whether it is currently paused call isPaused.

isEnding

Added in 1.0.0
val isEndingBoolean

Returns true if this ExerciseState corresponds to one of the ending states and false otherwise. This method returns false if the exercise has ended, to check whether it has ended call isEnded.

isPaused

Added in 1.0.0
val isPausedBoolean

Returns true if this ExerciseState corresponds to one of the paused states and false otherwise. This method returns false if the exercise has ended, to check whether it has ended call isEnded.

isResuming

Added in 1.0.0
val isResumingBoolean

Returns true if this ExerciseState corresponds to one of the resuming states and false otherwise. This method returns false if the exercise has ended, to check whether it has ended call isEnded.

name

Added in 1.0.0
val nameString