From 449804f4d21f7232633d4538e2647fde39efdc65 Mon Sep 17 00:00:00 2001 From: Vladislav Antonyuk Date: Tue, 11 Jun 2024 18:25:15 +0300 Subject: [PATCH] Balloon --- .../Balloon/Additions/AboutAdditions.txt | 48 ++ .../Balloon/Balloon.csproj | 45 ++ .../Balloon/BalloonLayoutBodyBinding.cs | 24 + .../Balloon/BalloonLayoutOverlayBinding.cs | 24 + AndroidBindableLibraries/Balloon/ReadMe.md | 3 + .../Balloon/Transforms/EnumFields.xml | 14 + .../Balloon/Transforms/EnumMethods.xml | 13 + .../Balloon/Transforms/Metadata.xml | 17 + AndroidBindableLibraries/Sample/App.xaml | 14 + AndroidBindableLibraries/Sample/App.xaml.cs | 12 + AndroidBindableLibraries/Sample/AppShell.xaml | 15 + .../Sample/AppShell.xaml.cs | 10 + .../Sample/BallonContent.xaml | 23 + .../Sample/BallonContent.xaml.cs | 16 + .../Calendar/CalendarMaterialHandler.cs | 100 ++++ .../Sample/Calendar/CalendarView.cs | 51 +++ .../Calendar/DateTimeOffsetStringConverter.cs | 17 + .../Sample/Calendar/ICalendarView.cs | 10 + .../Calendar/SelectedDateChangedEventArgs.cs | 6 + AndroidBindableLibraries/Sample/MainPage.xaml | 37 ++ .../Sample/MainPage.xaml.cs | 52 +++ .../Sample/MauiProgram.cs | 26 ++ .../Platforms/Android/AndroidManifest.xml | 6 + .../Sample/Platforms/Android/MainActivity.cs | 11 + .../Platforms/Android/MainApplication.cs | 16 + .../Android/Resources/values/colors.xml | 6 + .../Sample/Properties/launchSettings.json | 8 + .../Sample/Resources/AppIcon/appicon.svg | 4 + .../Sample/Resources/AppIcon/appiconfg.svg | 8 + .../Resources/Fonts/OpenSans-Regular.ttf | Bin 0 -> 107168 bytes .../Resources/Fonts/OpenSans-Semibold.ttf | Bin 0 -> 111072 bytes .../Sample/Resources/Images/dotnet_bot.png | Bin 0 -> 69811 bytes .../Sample/Resources/Raw/AboutAssets.txt | 15 + .../Sample/Resources/Splash/splash.svg | 8 + .../Sample/Resources/Styles/Colors.xaml | 45 ++ .../Sample/Resources/Styles/Styles.xaml | 426 ++++++++++++++++++ AndroidBindableLibraries/Sample/Sample.csproj | 50 ++ .../VladislavAntonyuk.Balloon.1.6.4.nupkg | Bin 0 -> 291489 bytes MauiSamples.sln | 16 + MauiStaggeredCollectionView/README.md | 8 +- 40 files changed, 1203 insertions(+), 1 deletion(-) create mode 100644 AndroidBindableLibraries/Balloon/Additions/AboutAdditions.txt create mode 100644 AndroidBindableLibraries/Balloon/Balloon.csproj create mode 100644 AndroidBindableLibraries/Balloon/BalloonLayoutBodyBinding.cs create mode 100644 AndroidBindableLibraries/Balloon/BalloonLayoutOverlayBinding.cs create mode 100644 AndroidBindableLibraries/Balloon/ReadMe.md create mode 100644 AndroidBindableLibraries/Balloon/Transforms/EnumFields.xml create mode 100644 AndroidBindableLibraries/Balloon/Transforms/EnumMethods.xml create mode 100644 AndroidBindableLibraries/Balloon/Transforms/Metadata.xml create mode 100644 AndroidBindableLibraries/Sample/App.xaml create mode 100644 AndroidBindableLibraries/Sample/App.xaml.cs create mode 100644 AndroidBindableLibraries/Sample/AppShell.xaml create mode 100644 AndroidBindableLibraries/Sample/AppShell.xaml.cs create mode 100644 AndroidBindableLibraries/Sample/BallonContent.xaml create mode 100644 AndroidBindableLibraries/Sample/BallonContent.xaml.cs create mode 100644 AndroidBindableLibraries/Sample/Calendar/CalendarMaterialHandler.cs create mode 100644 AndroidBindableLibraries/Sample/Calendar/CalendarView.cs create mode 100644 AndroidBindableLibraries/Sample/Calendar/DateTimeOffsetStringConverter.cs create mode 100644 AndroidBindableLibraries/Sample/Calendar/ICalendarView.cs create mode 100644 AndroidBindableLibraries/Sample/Calendar/SelectedDateChangedEventArgs.cs create mode 100644 AndroidBindableLibraries/Sample/MainPage.xaml create mode 100644 AndroidBindableLibraries/Sample/MainPage.xaml.cs create mode 100644 AndroidBindableLibraries/Sample/MauiProgram.cs create mode 100644 AndroidBindableLibraries/Sample/Platforms/Android/AndroidManifest.xml create mode 100644 AndroidBindableLibraries/Sample/Platforms/Android/MainActivity.cs create mode 100644 AndroidBindableLibraries/Sample/Platforms/Android/MainApplication.cs create mode 100644 AndroidBindableLibraries/Sample/Platforms/Android/Resources/values/colors.xml create mode 100644 AndroidBindableLibraries/Sample/Properties/launchSettings.json create mode 100644 AndroidBindableLibraries/Sample/Resources/AppIcon/appicon.svg create mode 100644 AndroidBindableLibraries/Sample/Resources/AppIcon/appiconfg.svg create mode 100644 AndroidBindableLibraries/Sample/Resources/Fonts/OpenSans-Regular.ttf create mode 100644 AndroidBindableLibraries/Sample/Resources/Fonts/OpenSans-Semibold.ttf create mode 100644 AndroidBindableLibraries/Sample/Resources/Images/dotnet_bot.png create mode 100644 AndroidBindableLibraries/Sample/Resources/Raw/AboutAssets.txt create mode 100644 AndroidBindableLibraries/Sample/Resources/Splash/splash.svg create mode 100644 AndroidBindableLibraries/Sample/Resources/Styles/Colors.xaml create mode 100644 AndroidBindableLibraries/Sample/Resources/Styles/Styles.xaml create mode 100644 AndroidBindableLibraries/Sample/Sample.csproj create mode 100644 LocalPackages/VladislavAntonyuk.Balloon.1.6.4.nupkg diff --git a/AndroidBindableLibraries/Balloon/Additions/AboutAdditions.txt b/AndroidBindableLibraries/Balloon/Additions/AboutAdditions.txt new file mode 100644 index 00000000..2775bd36 --- /dev/null +++ b/AndroidBindableLibraries/Balloon/Additions/AboutAdditions.txt @@ -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; } +} \ No newline at end of file diff --git a/AndroidBindableLibraries/Balloon/Balloon.csproj b/AndroidBindableLibraries/Balloon/Balloon.csproj new file mode 100644 index 00000000..b7a9814d --- /dev/null +++ b/AndroidBindableLibraries/Balloon/Balloon.csproj @@ -0,0 +1,45 @@ + + + 23 + VladislavAntonyuk.$(AssemblyName) + 1.6.4 + ReadMe.md + ..\..\LocalPackages\ + + + + + + + + + + + 8.4.0 + + + 2.7.0.2 + + + 1.7.1.2 + + + 1.9.23.1 + + + 1.6.1.8 + + + 1.13.1 + + + 1.7.0 + + + + + True + \ + + + \ No newline at end of file diff --git a/AndroidBindableLibraries/Balloon/BalloonLayoutBodyBinding.cs b/AndroidBindableLibraries/Balloon/BalloonLayoutBodyBinding.cs new file mode 100644 index 00000000..a65c5001 --- /dev/null +++ b/AndroidBindableLibraries/Balloon/BalloonLayoutBodyBinding.cs @@ -0,0 +1,24 @@ +namespace Com.Skydoves.Balloon.Databinding; + +using Android.Runtime; + +public sealed partial class BalloonLayoutBodyBinding : global::Java.Lang.Object, global::AndroidX.ViewBinding.IViewBinding +{ + public unsafe global::Android.Views.View Root + { + // Metadata.xml XPath method reference: path="/api/package[@name='com.skydoves.balloon.databinding']/class[@name='BalloonLayoutOverlayBinding']/method[@name='getRoot' and count(parameter)=0]" + [Register("getRoot", "()Lcom/skydoves/balloon/overlay/BalloonAnchorOverlayView;", "")] + get + { + const string __id = "getRoot.()Lcom/skydoves/balloon/overlay/BalloonAnchorOverlayView;"; + try + { + var __rm = _members.InstanceMethods.InvokeAbstractObjectMethod(__id, this, null); + return global::Java.Lang.Object.GetObject(__rm.Handle, JniHandleOwnership.TransferLocalRef)!; + } + finally + { + } + } + } +} \ No newline at end of file diff --git a/AndroidBindableLibraries/Balloon/BalloonLayoutOverlayBinding.cs b/AndroidBindableLibraries/Balloon/BalloonLayoutOverlayBinding.cs new file mode 100644 index 00000000..2f87bf62 --- /dev/null +++ b/AndroidBindableLibraries/Balloon/BalloonLayoutOverlayBinding.cs @@ -0,0 +1,24 @@ +namespace Com.Skydoves.Balloon.Databinding; + +using Android.Runtime; + +public sealed partial class BalloonLayoutOverlayBinding : global::Java.Lang.Object, global::AndroidX.ViewBinding.IViewBinding +{ + public unsafe global::Android.Views.View Root + { + // Metadata.xml XPath method reference: path="/api/package[@name='com.skydoves.balloon.databinding']/class[@name='BalloonLayoutOverlayBinding']/method[@name='getRoot' and count(parameter)=0]" + [Register("getRoot", "()Lcom/skydoves/balloon/overlay/BalloonAnchorOverlayView;", "")] + get + { + const string __id = "getRoot.()Lcom/skydoves/balloon/overlay/BalloonAnchorOverlayView;"; + try + { + var __rm = _members.InstanceMethods.InvokeAbstractObjectMethod(__id, this, null); + return global::Java.Lang.Object.GetObject(__rm.Handle, JniHandleOwnership.TransferLocalRef)!; + } + finally + { + } + } + } +} \ No newline at end of file diff --git a/AndroidBindableLibraries/Balloon/ReadMe.md b/AndroidBindableLibraries/Balloon/ReadMe.md new file mode 100644 index 00000000..e8ba739f --- /dev/null +++ b/AndroidBindableLibraries/Balloon/ReadMe.md @@ -0,0 +1,3 @@ +# Android Balloon + +Android Java Library Binding for [Balloon](https://github.com/skydoves/Balloon) \ No newline at end of file diff --git a/AndroidBindableLibraries/Balloon/Transforms/EnumFields.xml b/AndroidBindableLibraries/Balloon/Transforms/EnumFields.xml new file mode 100644 index 00000000..22959957 --- /dev/null +++ b/AndroidBindableLibraries/Balloon/Transforms/EnumFields.xml @@ -0,0 +1,14 @@ + + + \ No newline at end of file diff --git a/AndroidBindableLibraries/Balloon/Transforms/EnumMethods.xml b/AndroidBindableLibraries/Balloon/Transforms/EnumMethods.xml new file mode 100644 index 00000000..49216c61 --- /dev/null +++ b/AndroidBindableLibraries/Balloon/Transforms/EnumMethods.xml @@ -0,0 +1,13 @@ + + + \ No newline at end of file diff --git a/AndroidBindableLibraries/Balloon/Transforms/Metadata.xml b/AndroidBindableLibraries/Balloon/Transforms/Metadata.xml new file mode 100644 index 00000000..e23cf28f --- /dev/null +++ b/AndroidBindableLibraries/Balloon/Transforms/Metadata.xml @@ -0,0 +1,17 @@ + + + + + + diff --git a/AndroidBindableLibraries/Sample/App.xaml b/AndroidBindableLibraries/Sample/App.xaml new file mode 100644 index 00000000..44de3734 --- /dev/null +++ b/AndroidBindableLibraries/Sample/App.xaml @@ -0,0 +1,14 @@ + + + + + + + + + + + diff --git a/AndroidBindableLibraries/Sample/App.xaml.cs b/AndroidBindableLibraries/Sample/App.xaml.cs new file mode 100644 index 00000000..0d0f7b65 --- /dev/null +++ b/AndroidBindableLibraries/Sample/App.xaml.cs @@ -0,0 +1,12 @@ +namespace Sample +{ + public partial class App : Application + { + public App() + { + InitializeComponent(); + + MainPage = new AppShell(); + } + } +} diff --git a/AndroidBindableLibraries/Sample/AppShell.xaml b/AndroidBindableLibraries/Sample/AppShell.xaml new file mode 100644 index 00000000..a2993df7 --- /dev/null +++ b/AndroidBindableLibraries/Sample/AppShell.xaml @@ -0,0 +1,15 @@ + + + + + + diff --git a/AndroidBindableLibraries/Sample/AppShell.xaml.cs b/AndroidBindableLibraries/Sample/AppShell.xaml.cs new file mode 100644 index 00000000..a3797080 --- /dev/null +++ b/AndroidBindableLibraries/Sample/AppShell.xaml.cs @@ -0,0 +1,10 @@ +namespace Sample +{ + public partial class AppShell : Shell + { + public AppShell() + { + InitializeComponent(); + } + } +} diff --git a/AndroidBindableLibraries/Sample/BallonContent.xaml b/AndroidBindableLibraries/Sample/BallonContent.xaml new file mode 100644 index 00000000..c60ac9e4 --- /dev/null +++ b/AndroidBindableLibraries/Sample/BallonContent.xaml @@ -0,0 +1,23 @@ + + + + + + + + +