Skip to content

Commit

Permalink
Merge pull request #29 from ai-ro-bo/dev
Browse files Browse the repository at this point in the history
5.0.0-pre3 release
  • Loading branch information
Pit Bob authored Jul 22, 2021
2 parents 1a68514 + 87b836b commit 16cd643
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 16 deletions.
12 changes: 6 additions & 6 deletions nuget/Rox.Control.Camera.Xamarin.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@
<metadata>
<id>Rox.Xamarin.Camera</id>
<title>Rox Camera Control for Xamarin.Forms</title>
<version>5.0.0-pre2</version>
<version>5.0.0-pre3</version>
<repository type="git" url="https://github.com/ai-ro-bo/Rox.Control.Camera.Xamarin.git" branch="rel" />
<authors>https://airobo.software/</authors>
<license type="expression">MIT</license>
<projectUrl>https://rox.tools/control-camera</projectUrl>
<projectUrl>https://rox.tools/control/camera</projectUrl>
<icon>res\Rox.Control.Camera.Xamarin.Logo.png</icon>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<description>Acquire images with the device camera in Xamarin.Forms with the Rox Camera Control. Supports Android, iOS, and UWP.</description>
<readme>res\Rox.Control.Camera.Xamarin.Readme.md</readme>
<releaseNotes>
# 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.
Expand All @@ -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
</releaseNotes>
<copyright>©2021 AiRoBo Software</copyright>
Expand Down
47 changes: 47 additions & 0 deletions res/Rox.Control.Camera.Xamarin.Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
## 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) |

---

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.

---

### 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
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
global::Rox.Camera.Init();

global::Xamarin.Forms.Forms.Init();

LoadApplication(new MyCameraApplication());
```

---

The Rox Camera Control has the following methods:

```csharp
Task<ImageSource> AcquirePicture(); //Take a picture with the device camera
```

---
13 changes: 6 additions & 7 deletions src/Control/Android/Rox.Control.Camera.Xamarin.Android.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
<Deterministic>True</Deterministic>
<AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
<AndroidUseLatestPlatformSdk>false</AndroidUseLatestPlatformSdk>
<TargetFrameworkVersion>v11.0</TargetFrameworkVersion>
<AndroidUseAapt2>true</AndroidUseAapt2>
</PropertyGroup>
Expand Down Expand Up @@ -78,11 +77,11 @@
<AndroidResource Include="Resources\xml\rox_fileprovider_file_paths.xml" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
4 changes: 2 additions & 2 deletions src/Control/Apple/CameraController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,18 @@ public override void Canceled(UIImagePickerController cameraPicker)

public static void TakePicture(UIViewController parent, Action<NSDictionary> cameraCallback)
{
CameraPicker.SourceType = UIImagePickerControllerSourceType.Camera;
CameraPicker.CameraCaptureMode = UIImagePickerControllerCameraCaptureMode.Photo;
try
{
CameraPicker.SourceType = UIImagePickerControllerSourceType.Camera;
CameraPicker.CameraCaptureMode = UIImagePickerControllerCameraCaptureMode.Photo;
}
catch
{
//Note: Allow Simulator to use PictureLibrary when Camera is not available

CameraPicker.SourceType = UIImagePickerControllerSourceType.PhotoLibrary;
}

CameraCallback = cameraCallback;
parent.PresentViewController(CameraPicker, true, null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
<AndroidUseLatestPlatformSdk>false</AndroidUseLatestPlatformSdk>
<TargetFrameworkVersion>v11.0</TargetFrameworkVersion>
<AndroidEnableSGenConcurrent>true</AndroidEnableSGenConcurrent>
<AndroidUseAapt2>true</AndroidUseAapt2>
Expand Down
3 changes: 3 additions & 0 deletions src/Harness/Apple/Rox.Harness.Camera.Xamarin.Apple.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@
<CodesignKey>iPhone Developer</CodesignKey>
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
</PropertyGroup>
<PropertyGroup Condition=" '$(RunConfiguration)' == 'Default' ">
<AppExtensionDebugBundleId />
</PropertyGroup>
<ItemGroup>
<Compile Include="..\..\Shared\AssemblySolution.cs">
<Link>Properties\AssemblySolution.cs</Link>
Expand Down

0 comments on commit 16cd643

Please sign in to comment.