From 8b37614e5488f113c0131883327e79663826a3b0 Mon Sep 17 00:00:00 2001 From: "rodp.dev" Date: Thu, 22 Jul 2021 01:21:59 +1000 Subject: [PATCH 1/3] Change version to v5.0.0-pre3 --- nuget/Rox.Control.Camera.Xamarin.nuspec | 8 ++--- res/Rox.Control.Camera.Xamarin.Readme.md | 40 ++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 4 deletions(-) create mode 100644 res/Rox.Control.Camera.Xamarin.Readme.md diff --git a/nuget/Rox.Control.Camera.Xamarin.nuspec b/nuget/Rox.Control.Camera.Xamarin.nuspec index 24b8108..bc0fa0f 100644 --- a/nuget/Rox.Control.Camera.Xamarin.nuspec +++ b/nuget/Rox.Control.Camera.Xamarin.nuspec @@ -3,7 +3,7 @@ Rox.Xamarin.Camera Rox Camera Control for Xamarin.Forms - 5.0.0-pre2 + 5.0.0-pre3 https://airobo.software/ MIT @@ -13,11 +13,11 @@ Acquire images with the device camera in Xamarin.Forms with the Rox Camera Control. Supports Android, iOS, and UWP. res\Rox.Control.Camera.Xamarin.Readme.md -# Version 5.0.0-pre2 +# Version 5.0.0-pre3 -* Created new solution and projects and reimplemented component. +* Created new solution and projects and reimplemented components on all platforms. +* Removed security requirements from Android and Windows. * Implemented custom FileProvider for Android. -* Changed the capture window shape in UWP. * Moved Sample to Harness. * Changed licensed to MIT. * Provided source code in git repository. diff --git a/res/Rox.Control.Camera.Xamarin.Readme.md b/res/Rox.Control.Camera.Xamarin.Readme.md new file mode 100644 index 0000000..c0b3203 --- /dev/null +++ b/res/Rox.Control.Camera.Xamarin.Readme.md @@ -0,0 +1,40 @@ +### Rox Camera Control for Xamarin.Forms + +--- + +Acquire images with the device camera in Xamarin.Forms with the Rox Camera Control. Supports Android, iOS, and UWP. + +The CameraProvider component uses native platform components. + +--- + +In your Android project "MainActivity" code file, you must call "CameraControlAndroid.Initialise(Activity)" before "Xamarin.Forms.Forms.Init()". It should look something like: + +```csharp + CameraControlAndroid.Initialise(this); + + global::Xamarin.Forms.Forms.Init(); + + LoadApplication(new MyCameraApplication()); +``` + +In your iOS project "AppDelegate" code file, you must call "CameraControlApple.Initialise()" before "Xamarin.Forms.Forms.Init()". It should look something like: + +```csharp + CameraControlApple.Initialise(); + + global::Xamarin.Forms.Forms.Init(); + + LoadApplication(new MyCameraApplication()); +``` + +--- + +The Rox Camera Control has the following methods: + +```csharp + Task AcquirePicture(); //Take a picture with the device camera +``` + +--- +Source code and test harness are available at: https://github.com/ai-ro-bo/Rox.Control.Camera.Xamarin From dfbd4eb62c8242a9f497b804e00bbd7e4ac9c7c2 Mon Sep 17 00:00:00 2001 From: "rodp.dev" Date: Thu, 22 Jul 2021 11:14:06 +1000 Subject: [PATCH 2/3] apple-simulator-library Use Library on iOS simulator if no camera available --- nuget/Rox.Control.Camera.Xamarin.nuspec | 4 ++-- res/Rox.Control.Camera.Xamarin.Readme.md | 17 ++++++++++++----- src/Control/Apple/CameraController.cs | 4 ++-- .../Rox.Harness.Camera.Xamarin.Apple.csproj | 3 +++ 4 files changed, 19 insertions(+), 9 deletions(-) diff --git a/nuget/Rox.Control.Camera.Xamarin.nuspec b/nuget/Rox.Control.Camera.Xamarin.nuspec index bc0fa0f..afac566 100644 --- a/nuget/Rox.Control.Camera.Xamarin.nuspec +++ b/nuget/Rox.Control.Camera.Xamarin.nuspec @@ -7,7 +7,7 @@ https://airobo.software/ MIT - https://rox.tools/control-camera + https://rox.tools/control/camera res\Rox.Control.Camera.Xamarin.Logo.png true Acquire images with the device camera in Xamarin.Forms with the Rox Camera Control. Supports Android, iOS, and UWP. @@ -30,7 +30,7 @@ [Build Configuration] * Windows : 10.19043.1110 -* macOS : Big Sur 11.3.1 +* macOS : Big Sur 11.5 * Xamarin.Forms : 5.0.0.2083 ©2021 AiRoBo Software diff --git a/res/Rox.Control.Camera.Xamarin.Readme.md b/res/Rox.Control.Camera.Xamarin.Readme.md index c0b3203..bdc7532 100644 --- a/res/Rox.Control.Camera.Xamarin.Readme.md +++ b/res/Rox.Control.Camera.Xamarin.Readme.md @@ -1,4 +1,8 @@ -### Rox Camera Control for Xamarin.Forms +## Rox Camera Control for Xamarin.Forms + +| Site | [rox.tools/control/camera](https://rox.tools/control/camera/) | +| NuGet | [nuget.org/packages/Rox.Xamarin.Camera](https://www.nuget.org/packages/Rox.Xamarin.Camera/) | +| Source | [github.com/ai-ro-bo/Rox.Control.Camera.Xamarin](https://github.com/ai-ro-bo/Rox.Control.Camera.Xamarin) | --- @@ -8,20 +12,24 @@ The CameraProvider component uses native platform components. --- -In your Android project "MainActivity" code file, you must call "CameraControlAndroid.Initialise(Activity)" before "Xamarin.Forms.Forms.Init()". It should look something like: +### Android + +In your Android project "MainActivity" code file, you must call "Rox.Camera.Init(Activity)" before "Xamarin.Forms.Forms.Init()". It should look something like: ```csharp - CameraControlAndroid.Initialise(this); + global::Rox.Camera.Init(this); global::Xamarin.Forms.Forms.Init(); LoadApplication(new MyCameraApplication()); ``` +### iOS + In your iOS project "AppDelegate" code file, you must call "CameraControlApple.Initialise()" before "Xamarin.Forms.Forms.Init()". It should look something like: ```csharp - CameraControlApple.Initialise(); + global::Rox.Camera.Init(); global::Xamarin.Forms.Forms.Init(); @@ -37,4 +45,3 @@ The Rox Camera Control has the following methods: ``` --- -Source code and test harness are available at: https://github.com/ai-ro-bo/Rox.Control.Camera.Xamarin diff --git a/src/Control/Apple/CameraController.cs b/src/Control/Apple/CameraController.cs index 2784a8d..ad68d2a 100644 --- a/src/Control/Apple/CameraController.cs +++ b/src/Control/Apple/CameraController.cs @@ -41,11 +41,10 @@ public override void Canceled(UIImagePickerController cameraPicker) public static void TakePicture(UIViewController parent, Action cameraCallback) { - CameraPicker.SourceType = UIImagePickerControllerSourceType.Camera; - CameraPicker.CameraCaptureMode = UIImagePickerControllerCameraCaptureMode.Photo; try { CameraPicker.SourceType = UIImagePickerControllerSourceType.Camera; + CameraPicker.CameraCaptureMode = UIImagePickerControllerCameraCaptureMode.Photo; } catch { @@ -53,6 +52,7 @@ public static void TakePicture(UIViewController parent, Action cam CameraPicker.SourceType = UIImagePickerControllerSourceType.PhotoLibrary; } + CameraCallback = cameraCallback; parent.PresentViewController(CameraPicker, true, null); } diff --git a/src/Harness/Apple/Rox.Harness.Camera.Xamarin.Apple.csproj b/src/Harness/Apple/Rox.Harness.Camera.Xamarin.Apple.csproj index c10de29..2a66d52 100644 --- a/src/Harness/Apple/Rox.Harness.Camera.Xamarin.Apple.csproj +++ b/src/Harness/Apple/Rox.Harness.Camera.Xamarin.Apple.csproj @@ -62,6 +62,9 @@ iPhone Developer Entitlements.plist + + + Properties\AssemblySolution.cs From 4e49037f49d481eb8be3e853945c8a0598bdd527 Mon Sep 17 00:00:00 2001 From: Rod Date: Thu, 22 Jul 2021 14:39:36 +1000 Subject: [PATCH 3/3] nuget-configure Android latest SDK to false --- .../Rox.Control.Camera.Xamarin.Android.csproj | 13 ++++++------- .../Rox.Harness.Camera.Xamarin.Android.csproj | 1 - 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/Control/Android/Rox.Control.Camera.Xamarin.Android.csproj b/src/Control/Android/Rox.Control.Camera.Xamarin.Android.csproj index 4158204..c24c360 100644 --- a/src/Control/Android/Rox.Control.Camera.Xamarin.Android.csproj +++ b/src/Control/Android/Rox.Control.Camera.Xamarin.Android.csproj @@ -16,7 +16,6 @@ True Resources\Resource.designer.cs Off - false v11.0 true @@ -78,11 +77,11 @@ - \ No newline at end of file diff --git a/src/Harness/Android/Rox.Harness.Camera.Xamarin.Android.csproj b/src/Harness/Android/Rox.Harness.Camera.Xamarin.Android.csproj index 6eb0df2..cb81996 100644 --- a/src/Harness/Android/Rox.Harness.Camera.Xamarin.Android.csproj +++ b/src/Harness/Android/Rox.Harness.Camera.Xamarin.Android.csproj @@ -16,7 +16,6 @@ Properties\AndroidManifest.xml Resources Assets - false v11.0 true true