ExerciseState


public final class ExerciseState


The state of an exercise.

Summary

Public fields

static final @NonNull ExerciseState

The exercise is actively in-progress.

static final @NonNull ExerciseState

The session has been automatically paused.

static final @NonNull ExerciseState

The session is being paused by auto-pause.

static final @NonNull ExerciseState

The session is being automatically resumed.

static final @NonNull ExerciseState

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

static final @NonNull ExerciseState

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

static final @NonNull ExerciseState

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

static final @NonNull ExerciseState

The session has been paused by the user.

static final @NonNull ExerciseState

The session is being paused by the user.

static final @NonNull ExerciseState

The session is being resumed by the user.

static final @NonNull ExerciseState

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

Public methods

boolean
equals(Object other)
static final ExerciseState
fromId(int id)

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

final int
final @NonNull String
int
final boolean

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

final boolean

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

final boolean

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

final boolean

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

@NonNull String

Public fields

ACTIVE

public static final @NonNull ExerciseState ACTIVE

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

public static final @NonNull ExerciseState AUTO_PAUSED

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

Used only in the manually started exercise.

AUTO_PAUSING

public static final @NonNull ExerciseState AUTO_PAUSING

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

Used only in the manually started exercise.

AUTO_RESUMING

public static final @NonNull ExerciseState AUTO_RESUMING

The session is being automatically resumed.

Used only in the manually started exercise.

ENDED

public static final @NonNull ExerciseState ENDED

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

ENDING

public static final @NonNull ExerciseState ENDING

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

PREPARING

public static final @NonNull ExerciseState PREPARING

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

USER_PAUSED

public static final @NonNull ExerciseState USER_PAUSED

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

Used only in the manually started exercise.

USER_PAUSING

public static final @NonNull ExerciseState USER_PAUSING

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

Used only in the manually started exercise.

USER_RESUMING

public static final @NonNull ExerciseState USER_RESUMING

The session is being resumed by the user.

Used only in the manually started exercise.

USER_STARTING

public static final @NonNull ExerciseState USER_STARTING

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 methods

equals

public boolean equals(Object other)

fromId

Added in 1.0.0
public static final ExerciseState fromId(int id)

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

Parameters
int id

the ExerciseState.id to match against

getId

Added in 1.0.0
public final int getId()

getName

Added in 1.0.0
public final @NonNull String getName()

hashCode

public int hashCode()

isEnded

Added in 1.0.0
public final boolean isEnded()

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
public final boolean isEnding()

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
public final boolean isPaused()

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
public final boolean isResuming()

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.

toString

public @NonNull String toString()