@capgo/capacitor-health 8.3.0 → 8.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -9
- package/android/src/main/java/app/capgo/plugin/health/WorkoutType.kt +117 -115
- package/dist/docs.json +261 -73
- package/dist/esm/definitions.d.ts +3 -2
- package/dist/esm/definitions.js.map +1 -1
- package/ios/Sources/HealthPlugin/Health.swift +300 -219
- package/ios/Sources/HealthPlugin/HealthPlugin.swift +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -610,14 +610,14 @@ Supported on iOS (HealthKit) and Android (Health Connect).
|
|
|
610
610
|
|
|
611
611
|
#### QueryWorkoutsOptions
|
|
612
612
|
|
|
613
|
-
| Prop | Type | Description
|
|
614
|
-
| ----------------- | --------------------------------------------------- |
|
|
615
|
-
| **`workoutType`** | <code><a href="#workouttype">WorkoutType</a></code> | Optional workout type filter. If omitted, all workout types are returned.
|
|
616
|
-
| **`startDate`** | <code>string</code> | Inclusive ISO 8601 start date (defaults to now - 1 day).
|
|
617
|
-
| **`endDate`** | <code>string</code> | Exclusive ISO 8601 end date (defaults to now).
|
|
618
|
-
| **`limit`** | <code>number</code> | Maximum number of workouts to return (defaults to 100).
|
|
619
|
-
| **`ascending`** | <code>boolean</code> | Return results sorted ascending by start date (defaults to false).
|
|
620
|
-
| **`anchor`** | <code>string</code> | Anchor for pagination. Use the anchor returned from a previous query to continue from that point. On iOS, this
|
|
613
|
+
| Prop | Type | Description |
|
|
614
|
+
| ----------------- | --------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
615
|
+
| **`workoutType`** | <code><a href="#workouttype">WorkoutType</a></code> | Optional workout type filter. If omitted, all workout types are returned. |
|
|
616
|
+
| **`startDate`** | <code>string</code> | Inclusive ISO 8601 start date (defaults to now - 1 day). |
|
|
617
|
+
| **`endDate`** | <code>string</code> | Exclusive ISO 8601 end date (defaults to now). |
|
|
618
|
+
| **`limit`** | <code>number</code> | Maximum number of workouts to return (defaults to 100). |
|
|
619
|
+
| **`ascending`** | <code>boolean</code> | Return results sorted ascending by start date (defaults to false). |
|
|
620
|
+
| **`anchor`** | <code>string</code> | Anchor for pagination. Use the anchor returned from a previous query to continue from that point. On iOS, this is the ISO 8601 cursor returned by the previous query. On Android, this uses Health Connect's pageToken. Omit this parameter to start from the beginning. |
|
|
621
621
|
|
|
622
622
|
|
|
623
623
|
#### QueryAggregatedResult
|
|
@@ -675,7 +675,7 @@ Construct a type with a set of properties K of type T
|
|
|
675
675
|
|
|
676
676
|
#### WorkoutType
|
|
677
677
|
|
|
678
|
-
<code>'
|
|
678
|
+
<code>'americanFootball' | 'australianFootball' | 'badminton' | 'baseball' | 'basketball' | 'bowling' | 'boxing' | 'climbing' | 'cricket' | 'crossTraining' | 'curling' | 'cycling' | 'dance' | 'elliptical' | 'fencing' | 'functionalStrengthTraining' | 'golf' | 'gymnastics' | 'handball' | 'hiking' | 'hockey' | 'jumpRope' | 'kickboxing' | 'lacrosse' | 'martialArts' | 'pilates' | 'racquetball' | 'rowing' | 'rugby' | 'running' | 'sailing' | 'skatingSports' | 'skiing' | 'snowboarding' | 'soccer' | 'softball' | 'squash' | 'stairClimbing' | 'strengthTraining' | 'surfing' | 'swimming' | 'swimmingPool' | 'swimmingOpenWater' | 'tableTennis' | 'tennis' | 'trackAndField' | 'traditionalStrengthTraining' | 'volleyball' | 'walking' | 'waterFitness' | 'waterPolo' | 'waterSports' | 'weightlifting' | 'wheelchair' | 'yoga' | 'archery' | 'barre' | 'cooldown' | 'coreTraining' | 'crossCountrySkiing' | 'discSports' | 'downhillSkiing' | 'equestrianSports' | 'fishing' | 'fitnessGaming' | 'flexibility' | 'handCycling' | 'highIntensityIntervalTraining' | 'hunting' | 'mindAndBody' | 'mixedCardio' | 'paddleSports' | 'pickleball' | 'play' | 'preparationAndRecovery' | 'snowSports' | 'stairs' | 'stepTraining' | 'surfingSports' | 'taiChi' | 'transition' | 'underwaterDiving' | 'wheelchairRunPace' | 'wheelchairWalkPace' | 'wrestling' | 'cardioDance' | 'socialDance' | 'backExtension' | 'barbellShoulderPress' | 'benchPress' | 'benchSitUp' | 'bikingStationary' | 'bootCamp' | 'burpee' | 'calisthenics' | 'crunch' | 'dancing' | 'deadlift' | 'dumbbellCurlLeftArm' | 'dumbbellCurlRightArm' | 'dumbbellFrontRaise' | 'dumbbellLateralRaise' | 'dumbbellTricepsExtensionLeftArm' | 'dumbbellTricepsExtensionRightArm' | 'dumbbellTricepsExtensionTwoArm' | 'exerciseClass' | 'forwardTwist' | 'frisbeedisc' | 'guidedBreathing' | 'iceHockey' | 'iceSkating' | 'jumpingJack' | 'latPullDown' | 'lunge' | 'meditation' | 'paddling' | 'paraGliding' | 'plank' | 'rockClimbing' | 'rollerHockey' | 'rowingMachine' | 'runningTreadmill' | 'scubaDiving' | 'skating' | 'snowshoeing' | 'stairClimbingMachine' | 'stretching' | 'upperTwist' | 'other'</code>
|
|
679
679
|
|
|
680
680
|
|
|
681
681
|
#### BucketType
|
|
@@ -3,114 +3,112 @@ package app.capgo.plugin.health
|
|
|
3
3
|
import androidx.health.connect.client.records.ExerciseSessionRecord
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* workout type to maintain backward compatibility:
|
|
11
|
-
*
|
|
12
|
-
* - highIntensityIntervalTraining, mixedCardio, crossTraining → reads as "crossTraining"
|
|
13
|
-
* - kickboxing, martialArts, wrestling → reads as "wrestling"
|
|
14
|
-
* - wheelchairRunPace, wheelchairWalkPace → reads as "wheelchairWalkPace"
|
|
15
|
-
* - stairs, stairClimbing → reads as "stairClimbing"
|
|
16
|
-
* - barre, pilates → reads as "pilates"
|
|
17
|
-
* - cooldown, flexibility, preparationAndRecovery → reads as "flexibility"
|
|
18
|
-
* - coreTraining, functionalStrengthTraining, strengthTraining, traditionalStrengthTraining → reads as "strengthTraining"
|
|
19
|
-
* - mindAndBody, taiChi, yoga → reads as "yoga"
|
|
20
|
-
* - trackAndField, running → reads as "running"
|
|
21
|
-
* - cardioDance, socialDance, dance → reads as "dance"
|
|
22
|
-
* - crossCountrySkiing, downhillSkiing → reads as "downhillSkiing"
|
|
23
|
-
*
|
|
24
|
-
* This asymmetric mapping is intentional to support the full iOS workout type set while
|
|
25
|
-
* maintaining compatibility with Android's more limited exercise type taxonomy.
|
|
6
|
+
* Maps plugin workout strings to Android Health Connect exercise types.
|
|
7
|
+
*
|
|
8
|
+
* Several plugin workout types intentionally share the same Android exercise type. The plugin
|
|
9
|
+
* accepts both cross-platform names and platform-specific aliases when filtering workouts.
|
|
26
10
|
*/
|
|
27
11
|
object WorkoutType {
|
|
28
12
|
fun fromString(type: String?): Int? {
|
|
29
13
|
if (type.isNullOrBlank()) return null
|
|
30
|
-
|
|
14
|
+
|
|
31
15
|
return when (type) {
|
|
32
|
-
"running" -> ExerciseSessionRecord.EXERCISE_TYPE_RUNNING
|
|
33
|
-
"cycling" -> ExerciseSessionRecord.EXERCISE_TYPE_BIKING
|
|
34
|
-
"walking" -> ExerciseSessionRecord.EXERCISE_TYPE_WALKING
|
|
35
|
-
"swimming" -> ExerciseSessionRecord.EXERCISE_TYPE_SWIMMING_POOL
|
|
36
|
-
"yoga" -> ExerciseSessionRecord.EXERCISE_TYPE_YOGA
|
|
37
|
-
"strengthTraining" -> ExerciseSessionRecord.EXERCISE_TYPE_STRENGTH_TRAINING
|
|
38
|
-
"hiking" -> ExerciseSessionRecord.EXERCISE_TYPE_HIKING
|
|
39
|
-
"tennis" -> ExerciseSessionRecord.EXERCISE_TYPE_TENNIS
|
|
40
|
-
"basketball" -> ExerciseSessionRecord.EXERCISE_TYPE_BASKETBALL
|
|
41
|
-
"soccer" -> ExerciseSessionRecord.EXERCISE_TYPE_SOCCER
|
|
42
16
|
"americanFootball" -> ExerciseSessionRecord.EXERCISE_TYPE_FOOTBALL_AMERICAN
|
|
43
|
-
"baseball" -> ExerciseSessionRecord.EXERCISE_TYPE_BASEBALL
|
|
44
|
-
"crossTraining" -> ExerciseSessionRecord.EXERCISE_TYPE_HIGH_INTENSITY_INTERVAL_TRAINING
|
|
45
|
-
"elliptical" -> ExerciseSessionRecord.EXERCISE_TYPE_ELLIPTICAL
|
|
46
|
-
"rowing" -> ExerciseSessionRecord.EXERCISE_TYPE_ROWING
|
|
47
|
-
"stairClimbing" -> ExerciseSessionRecord.EXERCISE_TYPE_STAIR_CLIMBING
|
|
48
|
-
"traditionalStrengthTraining" -> ExerciseSessionRecord.EXERCISE_TYPE_STRENGTH_TRAINING
|
|
49
|
-
"waterFitness" -> ExerciseSessionRecord.EXERCISE_TYPE_SWIMMING_POOL
|
|
50
|
-
"waterPolo" -> ExerciseSessionRecord.EXERCISE_TYPE_WATER_POLO
|
|
51
|
-
"waterSports" -> ExerciseSessionRecord.EXERCISE_TYPE_SWIMMING_OPEN_WATER
|
|
52
|
-
"wrestling" -> ExerciseSessionRecord.EXERCISE_TYPE_MARTIAL_ARTS
|
|
53
|
-
// New comprehensive workout type mappings
|
|
54
|
-
"archery" -> ExerciseSessionRecord.EXERCISE_TYPE_OTHER_WORKOUT
|
|
55
17
|
"australianFootball" -> ExerciseSessionRecord.EXERCISE_TYPE_FOOTBALL_AUSTRALIAN
|
|
56
18
|
"badminton" -> ExerciseSessionRecord.EXERCISE_TYPE_BADMINTON
|
|
57
|
-
"
|
|
19
|
+
"baseball" -> ExerciseSessionRecord.EXERCISE_TYPE_BASEBALL
|
|
20
|
+
"basketball" -> ExerciseSessionRecord.EXERCISE_TYPE_BASKETBALL
|
|
58
21
|
"bowling" -> ExerciseSessionRecord.EXERCISE_TYPE_OTHER_WORKOUT
|
|
59
22
|
"boxing" -> ExerciseSessionRecord.EXERCISE_TYPE_BOXING
|
|
60
|
-
"climbing" -> ExerciseSessionRecord.EXERCISE_TYPE_ROCK_CLIMBING
|
|
61
|
-
"cooldown" -> ExerciseSessionRecord.EXERCISE_TYPE_STRETCHING
|
|
62
|
-
"coreTraining" -> ExerciseSessionRecord.EXERCISE_TYPE_STRENGTH_TRAINING
|
|
23
|
+
"climbing", "rockClimbing" -> ExerciseSessionRecord.EXERCISE_TYPE_ROCK_CLIMBING
|
|
63
24
|
"cricket" -> ExerciseSessionRecord.EXERCISE_TYPE_CRICKET
|
|
64
|
-
"
|
|
25
|
+
"crossTraining", "highIntensityIntervalTraining" -> ExerciseSessionRecord.EXERCISE_TYPE_HIGH_INTENSITY_INTERVAL_TRAINING
|
|
65
26
|
"curling" -> ExerciseSessionRecord.EXERCISE_TYPE_OTHER_WORKOUT
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"equestrianSports" -> ExerciseSessionRecord.EXERCISE_TYPE_OTHER_WORKOUT
|
|
27
|
+
"cycling" -> ExerciseSessionRecord.EXERCISE_TYPE_BIKING
|
|
28
|
+
"dancing", "dance", "cardioDance", "socialDance" -> ExerciseSessionRecord.EXERCISE_TYPE_DANCING
|
|
29
|
+
"elliptical" -> ExerciseSessionRecord.EXERCISE_TYPE_ELLIPTICAL
|
|
70
30
|
"fencing" -> ExerciseSessionRecord.EXERCISE_TYPE_FENCING
|
|
71
|
-
"
|
|
72
|
-
"fitnessGaming" -> ExerciseSessionRecord.EXERCISE_TYPE_OTHER_WORKOUT
|
|
73
|
-
"flexibility" -> ExerciseSessionRecord.EXERCISE_TYPE_STRETCHING
|
|
74
|
-
"functionalStrengthTraining" -> ExerciseSessionRecord.EXERCISE_TYPE_STRENGTH_TRAINING
|
|
31
|
+
"functionalStrengthTraining", "strengthTraining", "traditionalStrengthTraining", "coreTraining" -> ExerciseSessionRecord.EXERCISE_TYPE_STRENGTH_TRAINING
|
|
75
32
|
"golf" -> ExerciseSessionRecord.EXERCISE_TYPE_GOLF
|
|
76
33
|
"gymnastics" -> ExerciseSessionRecord.EXERCISE_TYPE_GYMNASTICS
|
|
77
34
|
"handball" -> ExerciseSessionRecord.EXERCISE_TYPE_HANDBALL
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"hockey" -> ExerciseSessionRecord.EXERCISE_TYPE_ICE_HOCKEY
|
|
81
|
-
"hunting" -> ExerciseSessionRecord.EXERCISE_TYPE_OTHER_WORKOUT
|
|
35
|
+
"hiking" -> ExerciseSessionRecord.EXERCISE_TYPE_HIKING
|
|
36
|
+
"hockey", "iceHockey" -> ExerciseSessionRecord.EXERCISE_TYPE_ICE_HOCKEY
|
|
82
37
|
"jumpRope" -> ExerciseSessionRecord.EXERCISE_TYPE_OTHER_WORKOUT
|
|
83
|
-
"kickboxing" -> ExerciseSessionRecord.EXERCISE_TYPE_MARTIAL_ARTS
|
|
38
|
+
"kickboxing", "martialArts", "taiChi", "wrestling" -> ExerciseSessionRecord.EXERCISE_TYPE_MARTIAL_ARTS
|
|
84
39
|
"lacrosse" -> ExerciseSessionRecord.EXERCISE_TYPE_OTHER_WORKOUT
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
"paddleSports" -> ExerciseSessionRecord.EXERCISE_TYPE_PADDLING
|
|
40
|
+
"mindAndBody", "meditation" -> ExerciseSessionRecord.EXERCISE_TYPE_YOGA
|
|
41
|
+
"mixedCardio", "calisthenics" -> ExerciseSessionRecord.EXERCISE_TYPE_CALISTHENICS
|
|
42
|
+
"paddleSports", "paddling" -> ExerciseSessionRecord.EXERCISE_TYPE_PADDLING
|
|
89
43
|
"pickleball" -> ExerciseSessionRecord.EXERCISE_TYPE_OTHER_WORKOUT
|
|
90
44
|
"pilates" -> ExerciseSessionRecord.EXERCISE_TYPE_PILATES
|
|
91
45
|
"play" -> ExerciseSessionRecord.EXERCISE_TYPE_OTHER_WORKOUT
|
|
92
|
-
"preparationAndRecovery" -> ExerciseSessionRecord.EXERCISE_TYPE_STRETCHING
|
|
46
|
+
"preparationAndRecovery", "flexibility", "stretching" -> ExerciseSessionRecord.EXERCISE_TYPE_STRETCHING
|
|
93
47
|
"racquetball" -> ExerciseSessionRecord.EXERCISE_TYPE_RACQUETBALL
|
|
48
|
+
"rowing" -> ExerciseSessionRecord.EXERCISE_TYPE_ROWING
|
|
49
|
+
"rowingMachine" -> ExerciseSessionRecord.EXERCISE_TYPE_ROWING_MACHINE
|
|
94
50
|
"rugby" -> ExerciseSessionRecord.EXERCISE_TYPE_RUGBY
|
|
51
|
+
"running" -> ExerciseSessionRecord.EXERCISE_TYPE_RUNNING
|
|
52
|
+
"runningTreadmill" -> ExerciseSessionRecord.EXERCISE_TYPE_RUNNING_TREADMILL
|
|
95
53
|
"sailing" -> ExerciseSessionRecord.EXERCISE_TYPE_SAILING
|
|
96
54
|
"skatingSports" -> ExerciseSessionRecord.EXERCISE_TYPE_SKATING
|
|
55
|
+
"skating" -> ExerciseSessionRecord.EXERCISE_TYPE_SKATING
|
|
56
|
+
"skiing", "crossCountrySkiing", "downhillSkiing" -> ExerciseSessionRecord.EXERCISE_TYPE_SKIING
|
|
97
57
|
"snowboarding" -> ExerciseSessionRecord.EXERCISE_TYPE_SNOWBOARDING
|
|
98
|
-
"snowSports" -> ExerciseSessionRecord.EXERCISE_TYPE_SNOWSHOEING
|
|
58
|
+
"snowSports", "snowshoeing" -> ExerciseSessionRecord.EXERCISE_TYPE_SNOWSHOEING
|
|
59
|
+
"soccer" -> ExerciseSessionRecord.EXERCISE_TYPE_SOCCER
|
|
99
60
|
"softball" -> ExerciseSessionRecord.EXERCISE_TYPE_SOFTBALL
|
|
100
61
|
"squash" -> ExerciseSessionRecord.EXERCISE_TYPE_SQUASH
|
|
101
|
-
"stairs" -> ExerciseSessionRecord.EXERCISE_TYPE_STAIR_CLIMBING
|
|
102
|
-
"stepTraining" -> ExerciseSessionRecord.EXERCISE_TYPE_STAIR_CLIMBING_MACHINE
|
|
103
|
-
"surfingSports" -> ExerciseSessionRecord.EXERCISE_TYPE_SURFING
|
|
62
|
+
"stairClimbing", "stairs" -> ExerciseSessionRecord.EXERCISE_TYPE_STAIR_CLIMBING
|
|
63
|
+
"stepTraining", "stairClimbingMachine" -> ExerciseSessionRecord.EXERCISE_TYPE_STAIR_CLIMBING_MACHINE
|
|
64
|
+
"surfing", "surfingSports" -> ExerciseSessionRecord.EXERCISE_TYPE_SURFING
|
|
65
|
+
"swimming", "swimmingPool", "waterFitness" -> ExerciseSessionRecord.EXERCISE_TYPE_SWIMMING_POOL
|
|
66
|
+
"swimmingOpenWater", "waterSports" -> ExerciseSessionRecord.EXERCISE_TYPE_SWIMMING_OPEN_WATER
|
|
104
67
|
"tableTennis" -> ExerciseSessionRecord.EXERCISE_TYPE_TABLE_TENNIS
|
|
105
|
-
"
|
|
106
|
-
"trackAndField" -> ExerciseSessionRecord.
|
|
107
|
-
"
|
|
108
|
-
"underwaterDiving" -> ExerciseSessionRecord.EXERCISE_TYPE_SCUBA_DIVING
|
|
68
|
+
"tennis" -> ExerciseSessionRecord.EXERCISE_TYPE_TENNIS
|
|
69
|
+
"trackAndField" -> ExerciseSessionRecord.EXERCISE_TYPE_OTHER_WORKOUT
|
|
70
|
+
"underwaterDiving", "scubaDiving" -> ExerciseSessionRecord.EXERCISE_TYPE_SCUBA_DIVING
|
|
109
71
|
"volleyball" -> ExerciseSessionRecord.EXERCISE_TYPE_VOLLEYBALL
|
|
110
|
-
"
|
|
111
|
-
"
|
|
112
|
-
"
|
|
113
|
-
"
|
|
72
|
+
"walking" -> ExerciseSessionRecord.EXERCISE_TYPE_WALKING
|
|
73
|
+
"waterPolo" -> ExerciseSessionRecord.EXERCISE_TYPE_WATER_POLO
|
|
74
|
+
"weightlifting" -> ExerciseSessionRecord.EXERCISE_TYPE_WEIGHTLIFTING
|
|
75
|
+
"wheelchair", "wheelchairRunPace", "wheelchairWalkPace", "handCycling" -> ExerciseSessionRecord.EXERCISE_TYPE_WHEELCHAIR
|
|
76
|
+
"yoga" -> ExerciseSessionRecord.EXERCISE_TYPE_YOGA
|
|
77
|
+
"archery" -> ExerciseSessionRecord.EXERCISE_TYPE_OTHER_WORKOUT
|
|
78
|
+
"barre" -> ExerciseSessionRecord.EXERCISE_TYPE_OTHER_WORKOUT
|
|
79
|
+
"cooldown" -> ExerciseSessionRecord.EXERCISE_TYPE_OTHER_WORKOUT
|
|
80
|
+
"discSports", "frisbeedisc" -> ExerciseSessionRecord.EXERCISE_TYPE_FRISBEE_DISC
|
|
81
|
+
"equestrianSports" -> ExerciseSessionRecord.EXERCISE_TYPE_OTHER_WORKOUT
|
|
82
|
+
"fishing" -> ExerciseSessionRecord.EXERCISE_TYPE_OTHER_WORKOUT
|
|
83
|
+
"fitnessGaming" -> ExerciseSessionRecord.EXERCISE_TYPE_OTHER_WORKOUT
|
|
84
|
+
"hunting" -> ExerciseSessionRecord.EXERCISE_TYPE_OTHER_WORKOUT
|
|
85
|
+
"transition" -> ExerciseSessionRecord.EXERCISE_TYPE_OTHER_WORKOUT
|
|
86
|
+
"backExtension",
|
|
87
|
+
"barbellShoulderPress",
|
|
88
|
+
"benchPress",
|
|
89
|
+
"benchSitUp",
|
|
90
|
+
"crunch",
|
|
91
|
+
"deadlift",
|
|
92
|
+
"dumbbellCurlLeftArm",
|
|
93
|
+
"dumbbellCurlRightArm",
|
|
94
|
+
"dumbbellFrontRaise",
|
|
95
|
+
"dumbbellLateralRaise",
|
|
96
|
+
"dumbbellTricepsExtensionLeftArm",
|
|
97
|
+
"dumbbellTricepsExtensionRightArm",
|
|
98
|
+
"dumbbellTricepsExtensionTwoArm",
|
|
99
|
+
"forwardTwist",
|
|
100
|
+
"latPullDown",
|
|
101
|
+
"lunge",
|
|
102
|
+
"plank",
|
|
103
|
+
"upperTwist" -> ExerciseSessionRecord.EXERCISE_TYPE_STRENGTH_TRAINING
|
|
104
|
+
"bikingStationary" -> ExerciseSessionRecord.EXERCISE_TYPE_BIKING_STATIONARY
|
|
105
|
+
"bootCamp" -> ExerciseSessionRecord.EXERCISE_TYPE_BOOT_CAMP
|
|
106
|
+
"burpee", "jumpingJack" -> ExerciseSessionRecord.EXERCISE_TYPE_CALISTHENICS
|
|
107
|
+
"exerciseClass" -> ExerciseSessionRecord.EXERCISE_TYPE_EXERCISE_CLASS
|
|
108
|
+
"guidedBreathing" -> ExerciseSessionRecord.EXERCISE_TYPE_GUIDED_BREATHING
|
|
109
|
+
"iceSkating" -> ExerciseSessionRecord.EXERCISE_TYPE_ICE_SKATING
|
|
110
|
+
"paraGliding" -> ExerciseSessionRecord.EXERCISE_TYPE_OTHER_WORKOUT
|
|
111
|
+
"rollerHockey" -> ExerciseSessionRecord.EXERCISE_TYPE_ROLLER_HOCKEY
|
|
114
112
|
"other" -> ExerciseSessionRecord.EXERCISE_TYPE_OTHER_WORKOUT
|
|
115
113
|
else -> null
|
|
116
114
|
}
|
|
@@ -118,61 +116,65 @@ object WorkoutType {
|
|
|
118
116
|
|
|
119
117
|
fun toWorkoutTypeString(exerciseType: Int): String {
|
|
120
118
|
return when (exerciseType) {
|
|
121
|
-
ExerciseSessionRecord.EXERCISE_TYPE_RUNNING -> "running"
|
|
122
|
-
ExerciseSessionRecord.EXERCISE_TYPE_BIKING -> "cycling"
|
|
123
|
-
ExerciseSessionRecord.EXERCISE_TYPE_BIKING_STATIONARY -> "cycling"
|
|
124
|
-
ExerciseSessionRecord.EXERCISE_TYPE_WALKING -> "walking"
|
|
125
|
-
ExerciseSessionRecord.EXERCISE_TYPE_SWIMMING_POOL -> "swimming"
|
|
126
|
-
ExerciseSessionRecord.EXERCISE_TYPE_SWIMMING_OPEN_WATER -> "swimming"
|
|
127
|
-
ExerciseSessionRecord.EXERCISE_TYPE_YOGA -> "yoga"
|
|
128
|
-
ExerciseSessionRecord.EXERCISE_TYPE_STRENGTH_TRAINING -> "strengthTraining"
|
|
129
|
-
ExerciseSessionRecord.EXERCISE_TYPE_HIKING -> "hiking"
|
|
130
|
-
ExerciseSessionRecord.EXERCISE_TYPE_TENNIS -> "tennis"
|
|
131
|
-
ExerciseSessionRecord.EXERCISE_TYPE_BASKETBALL -> "basketball"
|
|
132
|
-
ExerciseSessionRecord.EXERCISE_TYPE_SOCCER -> "soccer"
|
|
133
119
|
ExerciseSessionRecord.EXERCISE_TYPE_FOOTBALL_AMERICAN -> "americanFootball"
|
|
134
|
-
ExerciseSessionRecord.EXERCISE_TYPE_BASEBALL -> "baseball"
|
|
135
|
-
// Keep backward compatible mapping for existing types
|
|
136
|
-
ExerciseSessionRecord.EXERCISE_TYPE_HIGH_INTENSITY_INTERVAL_TRAINING -> "crossTraining"
|
|
137
|
-
ExerciseSessionRecord.EXERCISE_TYPE_ELLIPTICAL -> "elliptical"
|
|
138
|
-
ExerciseSessionRecord.EXERCISE_TYPE_ROWING -> "rowing"
|
|
139
|
-
ExerciseSessionRecord.EXERCISE_TYPE_ROWING_MACHINE -> "rowing"
|
|
140
|
-
// Keep stairClimbing as primary mapping for backward compatibility
|
|
141
|
-
ExerciseSessionRecord.EXERCISE_TYPE_STAIR_CLIMBING -> "stairClimbing"
|
|
142
|
-
ExerciseSessionRecord.EXERCISE_TYPE_STAIR_CLIMBING_MACHINE -> "stepTraining"
|
|
143
|
-
ExerciseSessionRecord.EXERCISE_TYPE_WATER_POLO -> "waterPolo"
|
|
144
|
-
// Keep wrestling as primary mapping for backward compatibility
|
|
145
|
-
ExerciseSessionRecord.EXERCISE_TYPE_MARTIAL_ARTS -> "wrestling"
|
|
146
|
-
// Comprehensive Android to TypeScript workout type mappings
|
|
147
120
|
ExerciseSessionRecord.EXERCISE_TYPE_FOOTBALL_AUSTRALIAN -> "australianFootball"
|
|
148
121
|
ExerciseSessionRecord.EXERCISE_TYPE_BADMINTON -> "badminton"
|
|
149
|
-
ExerciseSessionRecord.
|
|
122
|
+
ExerciseSessionRecord.EXERCISE_TYPE_BASEBALL -> "baseball"
|
|
123
|
+
ExerciseSessionRecord.EXERCISE_TYPE_BASKETBALL -> "basketball"
|
|
150
124
|
ExerciseSessionRecord.EXERCISE_TYPE_BOXING -> "boxing"
|
|
151
125
|
ExerciseSessionRecord.EXERCISE_TYPE_ROCK_CLIMBING -> "climbing"
|
|
152
|
-
ExerciseSessionRecord.EXERCISE_TYPE_STRETCHING -> "flexibility"
|
|
153
126
|
ExerciseSessionRecord.EXERCISE_TYPE_CRICKET -> "cricket"
|
|
154
|
-
ExerciseSessionRecord.
|
|
155
|
-
ExerciseSessionRecord.
|
|
156
|
-
ExerciseSessionRecord.
|
|
127
|
+
ExerciseSessionRecord.EXERCISE_TYPE_HIGH_INTENSITY_INTERVAL_TRAINING -> "crossTraining"
|
|
128
|
+
ExerciseSessionRecord.EXERCISE_TYPE_BIKING -> "cycling"
|
|
129
|
+
ExerciseSessionRecord.EXERCISE_TYPE_BIKING_STATIONARY -> "bikingStationary"
|
|
130
|
+
ExerciseSessionRecord.EXERCISE_TYPE_DANCING -> "dancing"
|
|
131
|
+
ExerciseSessionRecord.EXERCISE_TYPE_ELLIPTICAL -> "elliptical"
|
|
157
132
|
ExerciseSessionRecord.EXERCISE_TYPE_FENCING -> "fencing"
|
|
158
133
|
ExerciseSessionRecord.EXERCISE_TYPE_GOLF -> "golf"
|
|
159
134
|
ExerciseSessionRecord.EXERCISE_TYPE_GYMNASTICS -> "gymnastics"
|
|
160
135
|
ExerciseSessionRecord.EXERCISE_TYPE_HANDBALL -> "handball"
|
|
161
|
-
ExerciseSessionRecord.
|
|
162
|
-
ExerciseSessionRecord.EXERCISE_TYPE_ICE_HOCKEY -> "
|
|
163
|
-
ExerciseSessionRecord.
|
|
136
|
+
ExerciseSessionRecord.EXERCISE_TYPE_HIKING -> "hiking"
|
|
137
|
+
ExerciseSessionRecord.EXERCISE_TYPE_ICE_HOCKEY -> "iceHockey"
|
|
138
|
+
ExerciseSessionRecord.EXERCISE_TYPE_ICE_SKATING -> "iceSkating"
|
|
139
|
+
ExerciseSessionRecord.EXERCISE_TYPE_MARTIAL_ARTS -> "martialArts"
|
|
140
|
+
ExerciseSessionRecord.EXERCISE_TYPE_PILATES -> "pilates"
|
|
164
141
|
ExerciseSessionRecord.EXERCISE_TYPE_RACQUETBALL -> "racquetball"
|
|
142
|
+
ExerciseSessionRecord.EXERCISE_TYPE_ROWING -> "rowing"
|
|
143
|
+
ExerciseSessionRecord.EXERCISE_TYPE_ROWING_MACHINE -> "rowingMachine"
|
|
165
144
|
ExerciseSessionRecord.EXERCISE_TYPE_RUGBY -> "rugby"
|
|
145
|
+
ExerciseSessionRecord.EXERCISE_TYPE_RUNNING -> "running"
|
|
146
|
+
ExerciseSessionRecord.EXERCISE_TYPE_RUNNING_TREADMILL -> "runningTreadmill"
|
|
166
147
|
ExerciseSessionRecord.EXERCISE_TYPE_SAILING -> "sailing"
|
|
167
|
-
ExerciseSessionRecord.EXERCISE_TYPE_SKATING -> "
|
|
148
|
+
ExerciseSessionRecord.EXERCISE_TYPE_SKATING -> "skating"
|
|
149
|
+
ExerciseSessionRecord.EXERCISE_TYPE_SKIING -> "skiing"
|
|
168
150
|
ExerciseSessionRecord.EXERCISE_TYPE_SNOWBOARDING -> "snowboarding"
|
|
169
|
-
ExerciseSessionRecord.EXERCISE_TYPE_SNOWSHOEING -> "
|
|
151
|
+
ExerciseSessionRecord.EXERCISE_TYPE_SNOWSHOEING -> "snowshoeing"
|
|
152
|
+
ExerciseSessionRecord.EXERCISE_TYPE_SOCCER -> "soccer"
|
|
170
153
|
ExerciseSessionRecord.EXERCISE_TYPE_SOFTBALL -> "softball"
|
|
171
154
|
ExerciseSessionRecord.EXERCISE_TYPE_SQUASH -> "squash"
|
|
172
|
-
ExerciseSessionRecord.
|
|
155
|
+
ExerciseSessionRecord.EXERCISE_TYPE_STAIR_CLIMBING -> "stairClimbing"
|
|
156
|
+
ExerciseSessionRecord.EXERCISE_TYPE_STAIR_CLIMBING_MACHINE -> "stairClimbingMachine"
|
|
157
|
+
ExerciseSessionRecord.EXERCISE_TYPE_STRENGTH_TRAINING -> "strengthTraining"
|
|
158
|
+
ExerciseSessionRecord.EXERCISE_TYPE_STRETCHING -> "stretching"
|
|
159
|
+
ExerciseSessionRecord.EXERCISE_TYPE_SURFING -> "surfing"
|
|
160
|
+
ExerciseSessionRecord.EXERCISE_TYPE_SWIMMING_POOL -> "swimmingPool"
|
|
161
|
+
ExerciseSessionRecord.EXERCISE_TYPE_SWIMMING_OPEN_WATER -> "swimmingOpenWater"
|
|
173
162
|
ExerciseSessionRecord.EXERCISE_TYPE_TABLE_TENNIS -> "tableTennis"
|
|
174
|
-
ExerciseSessionRecord.
|
|
163
|
+
ExerciseSessionRecord.EXERCISE_TYPE_TENNIS -> "tennis"
|
|
175
164
|
ExerciseSessionRecord.EXERCISE_TYPE_VOLLEYBALL -> "volleyball"
|
|
165
|
+
ExerciseSessionRecord.EXERCISE_TYPE_WALKING -> "walking"
|
|
166
|
+
ExerciseSessionRecord.EXERCISE_TYPE_WATER_POLO -> "waterPolo"
|
|
167
|
+
ExerciseSessionRecord.EXERCISE_TYPE_WEIGHTLIFTING -> "weightlifting"
|
|
168
|
+
ExerciseSessionRecord.EXERCISE_TYPE_WHEELCHAIR -> "wheelchair"
|
|
169
|
+
ExerciseSessionRecord.EXERCISE_TYPE_YOGA -> "yoga"
|
|
170
|
+
ExerciseSessionRecord.EXERCISE_TYPE_BOOT_CAMP -> "bootCamp"
|
|
171
|
+
ExerciseSessionRecord.EXERCISE_TYPE_CALISTHENICS -> "calisthenics"
|
|
172
|
+
ExerciseSessionRecord.EXERCISE_TYPE_EXERCISE_CLASS -> "exerciseClass"
|
|
173
|
+
ExerciseSessionRecord.EXERCISE_TYPE_FRISBEE_DISC -> "frisbeedisc"
|
|
174
|
+
ExerciseSessionRecord.EXERCISE_TYPE_GUIDED_BREATHING -> "guidedBreathing"
|
|
175
|
+
ExerciseSessionRecord.EXERCISE_TYPE_PADDLING -> "paddling"
|
|
176
|
+
ExerciseSessionRecord.EXERCISE_TYPE_ROLLER_HOCKEY -> "rollerHockey"
|
|
177
|
+
ExerciseSessionRecord.EXERCISE_TYPE_SCUBA_DIVING -> "scubaDiving"
|
|
176
178
|
ExerciseSessionRecord.EXERCISE_TYPE_OTHER_WORKOUT -> "other"
|
|
177
179
|
else -> "other"
|
|
178
180
|
}
|