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 |
static final @NonNull ExerciseState |
The exercise is currently ending, with the reason specified by |
static final @NonNull ExerciseState |
The exercise is being prepared, GPS and HeartRate sensors will be turned on if requested in the |
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 |
|
static final ExerciseState |
fromId(int id)Returns the |
final int |
getId() |
final @NonNull String |
getName() |
int |
hashCode() |
final boolean |
isEnded()Returns true if this |
final boolean |
isEnding()Returns true if this |
final boolean |
isPaused()Returns true if this |
final boolean |
Returns true if this |
@NonNull String |
toString() |
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
fromId
public static final ExerciseState fromId(int id)
Returns the ExerciseState object corresponding to id or null if none match.
| Parameters | |
|---|---|
int id |
the |
isEnded
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
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
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
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.