mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-29 05:16:51 +01:00
Add climbing activity & Add seperate res for hiking and climbing
This commit is contained in:
parent
d17ca3f4e9
commit
c62a418961
@ -181,7 +181,7 @@ public class HuamiActivitySummaryParser implements ActivitySummaryParser {
|
||||
averageStride = buffer.getShort();
|
||||
maxHR = buffer.getShort();
|
||||
|
||||
if (activityKind == ActivityKind.TYPE_CYCLING || activityKind == ActivityKind.TYPE_RUNNING || activityKind == ActivityKind.TYPE_HIKING) {
|
||||
if (activityKind == ActivityKind.TYPE_CYCLING || activityKind == ActivityKind.TYPE_RUNNING || activityKind == ActivityKind.TYPE_HIKING || activityKind == ActivityKind.TYPE_CLIMBING) {
|
||||
// this had nonsense data with treadmill on bip s, need to test it with running
|
||||
// for cycling it seems to work... hmm...
|
||||
// 28 bytes
|
||||
|
@ -52,8 +52,9 @@ public class ActivityKind {
|
||||
public static final int TYPE_BADMINTON = 0x00100000;
|
||||
public static final int TYPE_STRENGTH_TRAINING = 0x00200000;
|
||||
public static final int TYPE_HIKING = 0x00400000;
|
||||
public static final int TYPE_CLIMBING = 0x00800000;
|
||||
|
||||
private static final int TYPES_COUNT = 25;
|
||||
private static final int TYPES_COUNT = 26;
|
||||
|
||||
public static final int TYPE_SLEEP = TYPE_LIGHT_SLEEP | TYPE_DEEP_SLEEP;
|
||||
public static final int TYPE_ALL = TYPE_ACTIVITY | TYPE_SLEEP | TYPE_NOT_WORN;
|
||||
@ -82,6 +83,9 @@ public class ActivityKind {
|
||||
if ((types & ActivityKind.TYPE_HIKING) != 0) {
|
||||
result[i++] = provider.toRawActivityKind(TYPE_HIKING);
|
||||
}
|
||||
if ((types & ActivityKind.TYPE_CLIMBING) != 0) {
|
||||
result[i++] = provider.toRawActivityKind(TYPE_CLIMBING);
|
||||
}
|
||||
if ((types & ActivityKind.TYPE_SWIMMING) != 0) {
|
||||
result[i++] = provider.toRawActivityKind(TYPE_SWIMMING);
|
||||
}
|
||||
@ -149,6 +153,8 @@ public class ActivityKind {
|
||||
return context.getString(R.string.activity_type_walking);
|
||||
case TYPE_HIKING:
|
||||
return context.getString(R.string.activity_type_hiking);
|
||||
case TYPE_CLIMBING:
|
||||
return context.getString(R.string.activity_type_climbing);
|
||||
case TYPE_SWIMMING:
|
||||
return context.getString(R.string.activity_type_swimming);
|
||||
case TYPE_CYCLING:
|
||||
@ -199,8 +205,11 @@ public class ActivityKind {
|
||||
case TYPE_RUNNING:
|
||||
return R.drawable.ic_activity_running;
|
||||
case TYPE_WALKING:
|
||||
case TYPE_HIKING:
|
||||
return R.drawable.ic_activity_walking;
|
||||
case TYPE_HIKING:
|
||||
return R.drawable.ic_activity_hiking;
|
||||
case TYPE_CLIMBING:
|
||||
return R.drawable.ic_activity_climbing;
|
||||
case TYPE_CYCLING:
|
||||
return R.drawable.ic_activity_biking;
|
||||
case TYPE_TREADMILL:
|
||||
|
@ -29,6 +29,7 @@ public enum HuamiSportsActivityType {
|
||||
IndoorCycling(8),
|
||||
EllipticalTrainer(9),
|
||||
OutdoorHiking(15),
|
||||
Climbing(10),
|
||||
Soccer(0x12),
|
||||
JumpRope(0x15),
|
||||
RowingMachine(0x17),
|
||||
@ -52,6 +53,8 @@ public enum HuamiSportsActivityType {
|
||||
return ActivityKind.TYPE_RUNNING;
|
||||
case OutdoorHiking:
|
||||
return ActivityKind.TYPE_HIKING;
|
||||
case Climbing:
|
||||
return ActivityKind.TYPE_CLIMBING;
|
||||
case Treadmill:
|
||||
return ActivityKind.TYPE_TREADMILL;
|
||||
case Cycling:
|
||||
@ -105,6 +108,8 @@ public enum HuamiSportsActivityType {
|
||||
return OutdoorRunning;
|
||||
case ActivityKind.TYPE_HIKING:
|
||||
return OutdoorHiking;
|
||||
case ActivityKind.TYPE_CLIMBING:
|
||||
return Climbing;
|
||||
case ActivityKind.TYPE_TREADMILL:
|
||||
return Treadmill;
|
||||
case ActivityKind.TYPE_CYCLING:
|
||||
|
@ -105,6 +105,9 @@ public class FetchSportsDetailsOperation extends AbstractFetchOperation {
|
||||
case ActivityKind.TYPE_HIKING:
|
||||
trackType = getContext().getString(R.string.activity_type_hiking);
|
||||
break;
|
||||
case ActivityKind.TYPE_CLIMBING:
|
||||
trackType = getContext().getString(R.string.activity_type_climbing);
|
||||
break;
|
||||
case ActivityKind.TYPE_SWIMMING:
|
||||
trackType = getContext().getString(R.string.activity_type_swimming);
|
||||
break;
|
||||
|
10
app/src/main/res/drawable/ic_activity_climbing.xml
Normal file
10
app/src/main/res/drawable/ic_activity_climbing.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="45sp"
|
||||
android:height="45sp"
|
||||
android:tint="#7E7E7E"
|
||||
android:viewportWidth="45"
|
||||
android:viewportHeight="45">
|
||||
<path
|
||||
android:fillColor="#000000"
|
||||
android:pathData="m21.9184,3.7795c-1.7312,0 -3.1175,1.3863 -3.1175,3.1175 0,1.7312 1.3863,3.1175 3.1175,3.1175 1.7312,0 3.1175,-1.3863 3.1175,-3.1175 0,-1.7312 -1.3863,-3.1175 -3.1175,-3.1175zM11.3487,9.7812C10.5363,9.8097 9.8221,10.1506 9.5939,10.9207L6.5508,21.9333c-0.613,2.3209 4.2012,3.7931 4.9501,1.4641L14.3851,12.2833C14.8084,10.8183 12.8998,9.7267 11.3487,9.7812ZM18.3174,10.4101c-0.3116,0 -0.5886,0.0521 -0.8656,0.1386 -1.82,0.2388 -2.6137,4.4328 -2.6137,4.4328L8.069,41.5207h3.1175l4.967,-14.0388 4.6627,0.8622 1.7075,7.8072 2.9518,-0.6221 -1.5452,-9.6263 -4.9366,-3.3373 1.2612,-4.9704 1.8698,3.1513 6.6948,-2.0761 3.415,15.1411 0.7134,-0.1454 -3.5165,-15.1851 0.4666,-0.1454 -0.6695,-2.8774 -0.4632,0.142 -0.186,-0.798 -0.6019,0.142 0.1893,0.8419 -4.1285,1.2713 -3.1919,-5.1936c-0.5194,-0.8656 -1.4558,-1.4539 -2.5292,-1.4539zM38.8583,29.9603 L33.5194,34.5419 21.462,37.0981 15.8931,41.5748 38.8583,41.5207z" />
|
||||
</vector>
|
10
app/src/main/res/drawable/ic_activity_hiking.xml
Normal file
10
app/src/main/res/drawable/ic_activity_hiking.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="45sp"
|
||||
android:height="45sp"
|
||||
android:tint="#7E7E7E"
|
||||
android:viewportWidth="45"
|
||||
android:viewportHeight="45">
|
||||
<path
|
||||
android:fillColor="#000000"
|
||||
android:pathData="m26.0655,3.7795c-1.7337,0 -3.122,1.3883 -3.122,3.122 0,1.7337 1.3883,3.122 3.122,3.122 1.7337,0 3.122,-1.3883 3.122,-3.122 0,-1.7337 -1.3883,-3.122 -3.122,-3.122zM15.4773,9.7018c-0.8139,0.0286 -1.5288,0.3697 -1.7574,1.1411l-3.0475,11.0318c-0.6141,2.3249 4.207,3.7992 4.9572,1.4662l2.8917,-11.1334C18.9051,10.7288 17.0311,9.6472 15.4773,9.7018ZM22.4594,10.4196c-0.3121,0 -0.5894,0.0521 -0.8668,0.1388 -1.7216,0.3323 -2.6174,4.4391 -2.6174,4.4391l-6.7789,26.5772h3.122l4.9741,-14.0589 4.0396,5.3906v8.6683h3.122L27.4538,30.4617l-4.3172,-7.8692 1.263,-4.9775 1.8725,3.1558h7.1886v20.804h0.6535L34.1142,20.7708h0.6197v-3.122h-0.6197v-1.0124h-0.6535v1.0124h-5.0012l-3.4673,-5.7732c-0.5201,-0.8668 -1.4579,-1.456 -2.5328,-1.456z" />
|
||||
</vector>
|
@ -827,6 +827,7 @@
|
||||
<string name="activity_type_running">Running</string>
|
||||
<string name="activity_type_walking">Walking</string>
|
||||
<string name="activity_type_hiking">Hiking</string>
|
||||
<string name="activity_type_climbing">Climbing</string>
|
||||
<string name="activity_type_swimming">Swimming</string>
|
||||
<string name="activity_type_swimming_openwater">Swimming (Open water)</string>
|
||||
<string name="activity_type_indoor_cycling">Indoor Cycling</string>
|
||||
|
Loading…
Reference in New Issue
Block a user