-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
66e65c5
commit 0465495
Showing
14 changed files
with
264 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,3 +16,6 @@ | |
/src/WeChat/**/*.aar | ||
/src/DialogX/**/*.aar | ||
/src/PhotoEditor/**/*.aar | ||
/src/Intercom/**/*.aar | ||
.idea/ | ||
**/.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
src/Intercom/Android/IntercomSdk/Additions/AboutAdditions.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
Additions allow you to add arbitrary C# to the generated classes | ||
before they are compiled. This can be helpful for providing convenience | ||
methods or adding pure C# classes. | ||
|
||
== Adding Methods to Generated Classes == | ||
|
||
Let's say the library being bound has a Rectangle class with a constructor | ||
that takes an x and y position, and a width and length size. It will look like | ||
this: | ||
|
||
public partial class Rectangle | ||
{ | ||
public Rectangle (int x, int y, int width, int height) | ||
{ | ||
// JNI bindings | ||
} | ||
} | ||
|
||
Imagine we want to add a constructor to this class that takes a Point and | ||
Size structure instead of 4 ints. We can add a new file called Rectangle.cs | ||
with a partial class containing our new method: | ||
|
||
public partial class Rectangle | ||
{ | ||
public Rectangle (Point location, Size size) : | ||
this (location.X, location.Y, size.Width, size.Height) | ||
{ | ||
} | ||
} | ||
|
||
At compile time, the additions class will be added to the generated class | ||
and the final assembly will a Rectangle class with both constructors. | ||
|
||
|
||
== Adding C# Classes == | ||
|
||
Another thing that can be done is adding fully C# managed classes to the | ||
generated library. In the above example, let's assume that there isn't a | ||
Point class available in Java or our library. The one we create doesn't need | ||
to interact with Java, so we'll create it like a normal class in C#. | ||
|
||
By adding a Point.cs file with this class, it will end up in the binding library: | ||
|
||
public class Point | ||
{ | ||
public int X { get; set; } | ||
public int Y { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<TargetFramework>net7.0-android</TargetFramework> | ||
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion> | ||
<Nullable>enable</Nullable> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup> | ||
<Version>14.2.0</Version> | ||
<Description>Maui binding library for Intercom Sdk.</Description> | ||
<PackageId>$(PackageIdPrefix).Android.IntercomSdk</PackageId> | ||
<Title>$(PackageIdPrefix).Android.IntercomSdk</Title> | ||
<AssemblyName>$(PackageIdPrefix).Android.$(MSBuildProjectName)</AssemblyName> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Xamarin.Firebase.Messaging" Version="123.1.1.1" /> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
https://repo1.maven.org/maven2/io/intercom/android/intercom-sdk/14.2.0/intercom-sdk-14.2.0.aar | ||
intercom-sdk.aar |
14 changes: 14 additions & 0 deletions
14
src/Intercom/Android/IntercomSdk/Transforms/EnumFields.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<enum-field-mappings> | ||
<!-- | ||
This example converts the constants Fragment_id, Fragment_name, | ||
and Fragment_tag from android.support.v4.app.FragmentActivity.FragmentTag | ||
to an enum called Android.Support.V4.App.FragmentTagType with values | ||
Id, Name, and Tag. | ||
<mapping jni-class="android/support/v4/app/FragmentActivity$FragmentTag" clr-enum-type="Android.Support.V4.App.FragmentTagType"> | ||
<field jni-name="Fragment_name" clr-name="Name" value="0" /> | ||
<field jni-name="Fragment_id" clr-name="Id" value="1" /> | ||
<field jni-name="Fragment_tag" clr-name="Tag" value="2" /> | ||
</mapping> | ||
--> | ||
</enum-field-mappings> |
13 changes: 13 additions & 0 deletions
13
src/Intercom/Android/IntercomSdk/Transforms/EnumMethods.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<enum-method-mappings> | ||
<!-- | ||
This example changes the Java method: | ||
android.support.v4.app.Fragment.SavedState.writeToParcel (int flags) | ||
to be: | ||
android.support.v4.app.Fragment.SavedState.writeToParcel (Android.OS.ParcelableWriteFlags flags) | ||
when bound in C#. | ||
<mapping jni-class="android/support/v4/app/Fragment.SavedState"> | ||
<method jni-name="writeToParcel" parameter="flags" clr-enum-type="Android.OS.ParcelableWriteFlags" /> | ||
</mapping> | ||
--> | ||
</enum-method-mappings> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<metadata> | ||
<!-- | ||
This sample removes the class: android.support.v4.content.AsyncTaskLoader.LoadTask: | ||
<remove-node path="/api/package[@name='android.support.v4.content']/class[@name='AsyncTaskLoader.LoadTask']" /> | ||
This sample removes the method: android.support.v4.content.CursorLoader.loadInBackground: | ||
<remove-node path="/api/package[@name='android.support.v4.content']/class[@name='CursorLoader']/method[@name='loadInBackground']" /> | ||
--> | ||
</metadata> |
48 changes: 48 additions & 0 deletions
48
src/Intercom/Android/IntercomSdkBase/Additions/AboutAdditions.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
Additions allow you to add arbitrary C# to the generated classes | ||
before they are compiled. This can be helpful for providing convenience | ||
methods or adding pure C# classes. | ||
|
||
== Adding Methods to Generated Classes == | ||
|
||
Let's say the library being bound has a Rectangle class with a constructor | ||
that takes an x and y position, and a width and length size. It will look like | ||
this: | ||
|
||
public partial class Rectangle | ||
{ | ||
public Rectangle (int x, int y, int width, int height) | ||
{ | ||
// JNI bindings | ||
} | ||
} | ||
|
||
Imagine we want to add a constructor to this class that takes a Point and | ||
Size structure instead of 4 ints. We can add a new file called Rectangle.cs | ||
with a partial class containing our new method: | ||
|
||
public partial class Rectangle | ||
{ | ||
public Rectangle (Point location, Size size) : | ||
this (location.X, location.Y, size.Width, size.Height) | ||
{ | ||
} | ||
} | ||
|
||
At compile time, the additions class will be added to the generated class | ||
and the final assembly will a Rectangle class with both constructors. | ||
|
||
|
||
== Adding C# Classes == | ||
|
||
Another thing that can be done is adding fully C# managed classes to the | ||
generated library. In the above example, let's assume that there isn't a | ||
Point class available in Java or our library. The one we create doesn't need | ||
to interact with Java, so we'll create it like a normal class in C#. | ||
|
||
By adding a Point.cs file with this class, it will end up in the binding library: | ||
|
||
public class Point | ||
{ | ||
public int X { get; set; } | ||
public int Y { get; set; } | ||
} |
17 changes: 17 additions & 0 deletions
17
src/Intercom/Android/IntercomSdkBase/IntercomSdkBase.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<TargetFramework>net7.0-android</TargetFramework> | ||
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion> | ||
<Nullable>enable</Nullable> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup> | ||
<Version>14.2.0</Version> | ||
<Description>Maui binding library for Intercom Sdk Base.</Description> | ||
<PackageId>$(PackageIdPrefix).Android.IntercomSdkBase</PackageId> | ||
<Title>$(PackageIdPrefix).Android.IntercomSdkBase</Title> | ||
<AssemblyName>$(PackageIdPrefix).Android.$(MSBuildProjectName)</AssemblyName> | ||
</PropertyGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
https://repo1.maven.org/maven2/io/intercom/android/intercom-sdk-base/14.2.0/intercom-sdk-base-14.2.0.aar | ||
intercom-sdk-base.aar |
14 changes: 14 additions & 0 deletions
14
src/Intercom/Android/IntercomSdkBase/Transforms/EnumFields.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<enum-field-mappings> | ||
<!-- | ||
This example converts the constants Fragment_id, Fragment_name, | ||
and Fragment_tag from android.support.v4.app.FragmentActivity.FragmentTag | ||
to an enum called Android.Support.V4.App.FragmentTagType with values | ||
Id, Name, and Tag. | ||
<mapping jni-class="android/support/v4/app/FragmentActivity$FragmentTag" clr-enum-type="Android.Support.V4.App.FragmentTagType"> | ||
<field jni-name="Fragment_name" clr-name="Name" value="0" /> | ||
<field jni-name="Fragment_id" clr-name="Id" value="1" /> | ||
<field jni-name="Fragment_tag" clr-name="Tag" value="2" /> | ||
</mapping> | ||
--> | ||
</enum-field-mappings> |
13 changes: 13 additions & 0 deletions
13
src/Intercom/Android/IntercomSdkBase/Transforms/EnumMethods.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<enum-method-mappings> | ||
<!-- | ||
This example changes the Java method: | ||
android.support.v4.app.Fragment.SavedState.writeToParcel (int flags) | ||
to be: | ||
android.support.v4.app.Fragment.SavedState.writeToParcel (Android.OS.ParcelableWriteFlags flags) | ||
when bound in C#. | ||
<mapping jni-class="android/support/v4/app/Fragment.SavedState"> | ||
<method jni-name="writeToParcel" parameter="flags" clr-enum-type="Android.OS.ParcelableWriteFlags" /> | ||
</mapping> | ||
--> | ||
</enum-method-mappings> |
41 changes: 41 additions & 0 deletions
41
src/Intercom/Android/IntercomSdkBase/Transforms/Metadata.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<metadata> | ||
<!-- | ||
This sample removes the class: android.support.v4.content.AsyncTaskLoader.LoadTask: | ||
<remove-node path="/api/package[@name='android.support.v4.content']/class[@name='AsyncTaskLoader.LoadTask']" /> | ||
This sample removes the method: android.support.v4.content.CursorLoader.loadInBackground: | ||
<remove-node path="/api/package[@name='android.support.v4.content']/class[@name='CursorLoader']/method[@name='loadInBackground']" /> | ||
--> | ||
<remove-node path="/api/package[starts-with(@name, 'io.intercom.android.sdk.actions')]" /> | ||
<remove-node path="/api/package[starts-with(@name, 'io.intercom.android.sdk.activities')]" /> | ||
<remove-node path="/api/package[starts-with(@name, 'io.intercom.android.sdk.annotations')]" /> | ||
<remove-node path="/api/package[starts-with(@name, 'io.intercom.android.sdk.api')]" /> | ||
<remove-node path="/api/package[starts-with(@name, 'io.intercom.android.sdk.blocks')]" /> | ||
<remove-node path="/api/package[starts-with(@name, 'io.intercom.android.sdk.conversation')]" /> | ||
<remove-node path="/api/package[starts-with(@name, 'io.intercom.android.sdk.exceptions')]" /> | ||
<remove-node path="/api/package[starts-with(@name, 'io.intercom.android.sdk.inbox')]" /> | ||
<remove-node path="/api/package[starts-with(@name, 'io.intercom.android.sdk.lightbox')]" /> | ||
<remove-node path="/api/package[starts-with(@name, 'io.intercom.android.sdk.logger')]" /> | ||
<remove-node path="/api/package[starts-with(@name, 'io.intercom.android.sdk.metrics')]" /> | ||
<remove-node path="/api/package[starts-with(@name, 'io.intercom.android.sdk.middleware')]" /> | ||
<remove-node path="/api/package[starts-with(@name, 'io.intercom.android.sdk.models')]" /> | ||
<remove-node path="/api/package[starts-with(@name, 'io.intercom.android.sdk.operator')]" /> | ||
<remove-node path="/api/package[starts-with(@name, 'io.intercom.android.sdk.overlay')]" /> | ||
<remove-node path="/api/package[starts-with(@name, 'io.intercom.android.sdk.persistence')]" /> | ||
<remove-node path="/api/package[starts-with(@name, 'io.intercom.android.sdk.spans')]" /> | ||
<remove-node path="/api/package[starts-with(@name, 'io.intercom.android.sdk.state')]" /> | ||
<remove-node path="/api/package[starts-with(@name, 'io.intercom.android.sdk.store')]" /> | ||
<remove-node path="/api/package[starts-with(@name, 'io.intercom.android.sdk.transforms')]" /> | ||
<remove-node path="/api/package[starts-with(@name, 'io.intercom.android.sdk.user')]" /> | ||
<remove-node path="/api/package[starts-with(@name, 'io.intercom.android.sdk.utilities')]" /> | ||
<remove-node path="/api/package[starts-with(@name, 'io.intercom.android.sdk.views')]" /> | ||
<remove-node path="/api/package[@name='io.intercom.android.sdk.identity']/*[starts-with(@name, 'AppConfig')]" /> | ||
<remove-node path="/api/package[@name='io.intercom.android.sdk.identity']/class[@name='AppIdentity']" /> | ||
<remove-node path="/api/package[@name='io.intercom.android.sdk.identity']/class[@name='UserIdentity']" /> | ||
<remove-node path="/api/package[@name='io.intercom.android.sdk']/class[@name='Injector']" /> | ||
<remove-node path="/api/package[@name='io.intercom.android.sdk']/class[starts-with(@name, 'IntercomPushManager')]" /> | ||
<remove-node path="//*[@deprecated='deprecated']" /> | ||
<attr path="/api/package[@name='io.intercom.android.sdk']" name="managedName">Xamarin.Android.Intercom</attr> | ||
<attr path="/api/package[@name='io.intercom.android.sdk.identity']" name="managedName">Xamarin.Android.Intercom.Identity</attr> | ||
<attr path="/api/package[@name='io.intercom.android.sdk.push']" name="managedName">Xamarin.Android.Intercom.Push</attr> | ||
</metadata> |