Bip: new activity type mapping
This commit is contained in:
parent
8b66d0f0f7
commit
d9de8e0cab
|
@ -68,6 +68,9 @@ public class ActivityKind {
|
|||
if ((types & ActivityKind.TYPE_CYCLING) != 0) {
|
||||
result[i++] = provider.toRawActivityKind(TYPE_CYCLING);
|
||||
}
|
||||
if ((types & ActivityKind.TYPE_TREADMILL) != 0) {
|
||||
result[i++] = provider.toRawActivityKind(TYPE_TREADMILL);
|
||||
}
|
||||
return Arrays.copyOf(result, i);
|
||||
}
|
||||
|
||||
|
@ -91,6 +94,8 @@ public class ActivityKind {
|
|||
return context.getString(R.string.activity_type_swimming);
|
||||
case TYPE_CYCLING:
|
||||
return context.getString(R.string.activity_type_biking);
|
||||
case TYPE_TREADMILL:
|
||||
return context.getString(R.string.activity_type_treadmill);
|
||||
case TYPE_UNKNOWN:
|
||||
default:
|
||||
return context.getString(R.string.activity_type_unknown);
|
||||
|
@ -112,6 +117,8 @@ public class ActivityKind {
|
|||
return R.drawable.ic_activity_walking;
|
||||
case TYPE_CYCLING:
|
||||
return R.drawable.ic_activity_biking;
|
||||
case TYPE_TREADMILL:
|
||||
return R.drawable.ic_activity_walking;
|
||||
case TYPE_SWIMMING: // fall through
|
||||
case TYPE_NOT_WORN: // fall through
|
||||
case TYPE_ACTIVITY: // fall through
|
||||
|
|
|
@ -3,10 +3,10 @@ package nodomain.freeyourgadget.gadgetbridge.service.devices.amazfitbip;
|
|||
import nodomain.freeyourgadget.gadgetbridge.model.ActivityKind;
|
||||
|
||||
public enum BipActivityType {
|
||||
Outdoor(1),
|
||||
Outdoor(4),
|
||||
Treadmill(2),
|
||||
Cycling(3), // should be Walking
|
||||
Walking(4); // should be cycling
|
||||
Cycling(1),
|
||||
Walking(3);
|
||||
|
||||
private final int code;
|
||||
|
||||
|
|
|
@ -496,4 +496,5 @@
|
|||
<string name="activity_type_unknown">Unknown activity</string>
|
||||
<string name="activity_summaries">Activities</string>
|
||||
<string name="activity_type_biking">Biking</string>
|
||||
<string name="activity_type_treadmill">Treadmill</string>
|
||||
</resources>
|
||||
|
|
Loading…
Reference in New Issue