Skip to content

Commit

Permalink
Remove DisableAutoCancel to fix Android auto focus (#2169)
Browse files Browse the repository at this point in the history
Remove DisableAutoCancel to fix android auto focus
  • Loading branch information
Jake-Derrick authored Sep 3, 2024
1 parent 803b07b commit 3da6d2e
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/CommunityToolkit.Maui.Camera/CameraManager.android.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Buffers;
using System.Runtime.Versioning;
using System.Runtime.Versioning;
using Android.Content;
using AndroidX.Camera.Core;
using AndroidX.Camera.Core.Impl.Utils.Futures;
Expand Down Expand Up @@ -220,9 +219,7 @@ protected virtual async partial Task PlatformStartCameraPreview(CancellationToke

//start the camera with AutoFocus
MeteringPoint point = previewView.MeteringPointFactory.CreatePoint(previewView.Width / 2.0f, previewView.Height / 2.0f, 0.1f);
FocusMeteringAction action = new FocusMeteringAction.Builder(point)
.DisableAutoCancel()
.Build();
FocusMeteringAction action = new FocusMeteringAction.Builder(point).Build();
camera.CameraControl.StartFocusAndMetering(action);

IsInitialized = true;
Expand Down

0 comments on commit 3da6d2e

Please sign in to comment.