Skip to content

Commit f131f47

Browse files
Add partial fixes for AndroidX Health Connect Client binding errors - IComparable implementations and activity contract fixes
Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
1 parent 314710d commit f131f47

15 files changed

+216
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using Android.Content;
2+
using AndroidX.Activity.Result.Contract;
3+
4+
namespace AndroidX.Health.Connect.Client.Contracts
5+
{
6+
public partial class ExerciseRouteRequestContract
7+
{
8+
public override Intent CreateIntent(Context context, Java.Lang.Object? input)
9+
{
10+
return CreateIntent(context, input?.ToString());
11+
}
12+
13+
public override Java.Lang.Object? ParseResult(int resultCode, Intent? intent)
14+
{
15+
return ParseResult(resultCode, intent);
16+
}
17+
}
18+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
using Android.Content;
2+
using AndroidX.Activity.Result.Contract;
3+
4+
namespace AndroidX.Health.Connect.Client.Contracts
5+
{
6+
public partial class HealthPermissionsRequestContract
7+
{
8+
public override Intent CreateIntent(Context context, Java.Lang.Object? input)
9+
{
10+
var typedInput = input as Java.Util.ISet;
11+
return CreateIntent(context, typedInput);
12+
}
13+
14+
public override Java.Lang.Object? ParseResult(int resultCode, Intent? intent)
15+
{
16+
return ParseResult(resultCode, intent);
17+
}
18+
}
19+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using System;
2+
3+
namespace AndroidX.Health.Connect.Client.Records
4+
{
5+
public partial class FhirVersion
6+
{
7+
public int CompareTo(object? obj)
8+
{
9+
if (obj is FhirVersion other)
10+
return CompareTo(other);
11+
throw new ArgumentException("Object must be of type FhirVersion");
12+
}
13+
}
14+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using System;
2+
3+
namespace AndroidX.Health.Connect.Client.Units
4+
{
5+
public partial class BloodGlucose
6+
{
7+
public int CompareTo(object? obj)
8+
{
9+
if (obj is BloodGlucose other)
10+
return CompareTo(other);
11+
throw new ArgumentException("Object must be of type BloodGlucose");
12+
}
13+
}
14+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using System;
2+
3+
namespace AndroidX.Health.Connect.Client.Units
4+
{
5+
public partial class Energy
6+
{
7+
public int CompareTo(object? obj)
8+
{
9+
if (obj is Energy other)
10+
return CompareTo(other);
11+
throw new ArgumentException("Object must be of type Energy");
12+
}
13+
}
14+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using System;
2+
3+
namespace AndroidX.Health.Connect.Client.Units
4+
{
5+
public partial class Length
6+
{
7+
public int CompareTo(object? obj)
8+
{
9+
if (obj is Length other)
10+
return CompareTo(other);
11+
throw new ArgumentException("Object must be of type Length");
12+
}
13+
}
14+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using System;
2+
3+
namespace AndroidX.Health.Connect.Client.Units
4+
{
5+
public partial class Mass
6+
{
7+
public int CompareTo(object? obj)
8+
{
9+
if (obj is Mass other)
10+
return CompareTo(other);
11+
throw new ArgumentException("Object must be of type Mass");
12+
}
13+
}
14+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using System;
2+
3+
namespace AndroidX.Health.Connect.Client.Units
4+
{
5+
public partial class Percentage
6+
{
7+
public int CompareTo(object? obj)
8+
{
9+
if (obj is Percentage other)
10+
return CompareTo(other);
11+
throw new ArgumentException("Object must be of type Percentage");
12+
}
13+
}
14+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using System;
2+
3+
namespace AndroidX.Health.Connect.Client.Units
4+
{
5+
public partial class Power
6+
{
7+
public int CompareTo(object? obj)
8+
{
9+
if (obj is Power other)
10+
return CompareTo(other);
11+
throw new ArgumentException("Object must be of type Power");
12+
}
13+
}
14+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using System;
2+
3+
namespace AndroidX.Health.Connect.Client.Units
4+
{
5+
public partial class Pressure
6+
{
7+
public int CompareTo(object? obj)
8+
{
9+
if (obj is Pressure other)
10+
return CompareTo(other);
11+
throw new ArgumentException("Object must be of type Pressure");
12+
}
13+
}
14+
}

0 commit comments

Comments
 (0)