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 ACTIVE: ExerciseState

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_PAUSED: ExerciseState

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

Used only in the manually started exercise.

AUTO_PAUSING

val AUTO_PAUSING: ExerciseState

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

Used only in the manually started exercise.

AUTO_RESUMING

val AUTO_RESUMING: ExerciseState

The session is being automatically resumed.

Used only in the manually started exercise.

ENDED

val ENDED: ExerciseState

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

ENDING

val ENDING: ExerciseState

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

PREPARING

val PREPARING: ExerciseState

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

USER_PAUSED

val USER_PAUSED: ExerciseState

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

Used only in the manually started exercise.

USER_PAUSING

val USER_PAUSING: ExerciseState

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

Used only in the manually started exercise.

USER_RESUMING

val USER_RESUMING: ExerciseState

The session is being resumed by the user.

Used only in the manually started exercise.

USER_STARTING

val USER_STARTING: ExerciseState

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 id: Int

isEnded

Added in 1.0.0
val isEnded: Boolean

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 isEnding: Boolean

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 isPaused: Boolean

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 isResuming: Boolean

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 name: String