Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
<AccelerateBuildsInVisualStudio>true</AccelerateBuildsInVisualStudio>
<GenerateErrorForMissingTargetingPacks>false</GenerateErrorForMissingTargetingPacks>

<!--Uncomment the line below if you need to debug code generated by Source Generators
If you see any LongPath issue on Windows, check this doc
https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=cmd#enable-long-paths-in-windows-10-version-1607-and-later-->
<!--<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles> -->

<!-- Prevent NuGet Package Vulnerabilities -->
<NuGetAudit>enable</NuGetAudit>
<NuGetAuditMode>all</NuGetAuditMode>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,6 @@
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
<ApplicationVersion>1</ApplicationVersion>

<!--
Uncomment the lines below if you need to debug the SG code
If you see any LongPath issue on Windows, check this doc
https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=cmd#enable-long-paths-in-windows-10-version-1607-and-later
-->
<!--<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
<CompilerGeneratedFilesOutputPath>$(BaseIntermediateOutputPath)\GeneratedFiles</CompilerGeneratedFilesOutputPath> -->

<AllowUnsafeBlocks>true</AllowUnsafeBlocks>

<NoWarn>IL2026</NoWarn>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

<PropertyGroup>
<TargetFramework>$(NetVersion)</TargetFramework>
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
<CompilerGeneratedFilesOutputPath>$(BaseIntermediateOutputPath)\GF</CompilerGeneratedFilesOutputPath>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@
<None Include="ReadMe.txt" pack="true" PackagePath="." />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\CommunityToolkit.Maui.SourceGenerators.Internal\CommunityToolkit.Maui.SourceGenerators.Internal.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
</ItemGroup>

<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">
<!-- Required NuGet Packages -->
<PackageReference Include="Xamarin.AndroidX.Camera.Camera2" Version="1.4.2.3" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public interface ICameraView : IView
Size ImageCaptureResolution { get; }

/// <summary>
/// Gets a value indicating whether the torch is on.
/// Gets a value indicating whether the torch (flash) is on.
/// </summary>
bool IsTorchOn { get; }

Expand All @@ -39,12 +39,12 @@ public interface ICameraView : IView
float ZoomFactor { get; internal set; }

/// <summary>
/// Gets whether the implementation is available.
/// Gets a value indicating whether the camera feature is available on the current device.
/// </summary>
bool IsAvailable { get; internal set; }

/// <summary>
/// Gets whether the implementation is busy.
/// Gets a value indicating whether the camera is currently busy.
/// </summary>
bool IsBusy { get; internal set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace CommunityToolkit.Maui.Core;

/// <summary>Default Values for <see cref="ICameraView"/></summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public static class CameraViewDefaults
static class CameraViewDefaults
{
/// <summary>
/// Default value for <see cref="ICameraView.IsAvailable"/>
Expand Down Expand Up @@ -38,34 +38,4 @@ public static class CameraViewDefaults
/// Default value for <see cref="ICameraView.CameraFlashMode"/>
/// </summary>
public static CameraFlashMode CameraFlashMode { get; } = CameraFlashMode.Off;

internal static Command<CancellationToken> CreateCaptureImageCommand(BindableObject bindable)
{
var cameraView = (CameraView)bindable;
return new(async token => await cameraView.CaptureImage(token).ConfigureAwait(false));
}

internal static Command<CancellationToken> CreateStartCameraPreviewCommand(BindableObject bindable)
{
var cameraView = (CameraView)bindable;
return new(async token => await cameraView.StartCameraPreview(token).ConfigureAwait(false));
}

internal static ICommand CreateStopCameraPreviewCommand(BindableObject bindable)
{
var cameraView = (CameraView)bindable;
return new Command(_ => cameraView.StopCameraPreview());
}

internal static Command<Stream> CreateStartVideoRecordingCommand(BindableObject bindable)
{
var cameraView = (CameraView)bindable;
return new Command<Stream>(async stream => await cameraView.StartVideoRecording(stream).ConfigureAwait(false));
}

internal static Command<CancellationToken> CreateStopVideoRecordingCommand(BindableObject bindable)
{
var cameraView = (CameraView)bindable;
return new Command<CancellationToken>(async token => await cameraView.StopVideoRecording(token).ConfigureAwait(false));
}
}
Loading
Loading