Skip to content

Camera Zoom Fixes#850

Open
Vetle444 wants to merge 3 commits intomainfrom
vefi/cameraZoomFixes
Open

Camera Zoom Fixes#850
Vetle444 wants to merge 3 commits intomainfrom
vefi/cameraZoomFixes

Conversation

@Vetle444
Copy link
Copy Markdown
Contributor

Description of Change

Fixes three related camera issues affecting barcode scanning and image capture:

1. iOS: Focus locks on startup and never re-adjusts

  • Camera was not explicitly setting continuous autofocus mode, causing iOS to lock focus at whatever distance happened to be in the camera's field of view when opened.
  • Added SetContinuousAutoFocus() that enables ContinuousAutoFocus + ContinuousAutoExposure on the capture device after session configuration.

2. iOS: Tap-to-focus permanently locks focus

  • SetFocusPoint() set AVCaptureFocusMode.AutoFocus (one-shot) and never returned to continuous mode.
  • Now observes the adjustingFocus KVO property and restores ContinuousAutoFocus once the one-shot focus completes.

3. Zoom does not trigger refocus (both platforms)

  • Neither iOS pinch-to-zoom/slider nor Android pinch-to-zoom triggered any focus re-evaluation after changing zoom level.
  • iOS: Re-engages ContinuousAutoFocus on pinch gesture end and after slider zoom changes.
  • Android: Triggers a center-point FocusMeteringAction after pinch-to-zoom to re-engage autofocus.

4. Android: Tap-to-focus indicator appears at wrong position

  • TouchScaleListener was passing e.RawX/e.RawY (screen-absolute coordinates) instead of e.GetX()/e.GetY() (view-relative coordinates), causing both the metering point and indicator circle to be offset.
  • Focus indicator Y-offset used a hardcoded / 1.25f approximation instead of accounting for PreviewView.TranslationY. Unified with iOS to use the same correct formula.

Copilot AI review requested due to automatic review settings April 27, 2026 11:02
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses camera focus/zoom reliability issues across iOS and Android in the DIPS.Mobile.UI camera APIs (barcode scanning + image capture), with a small SDK bump and changelog entry to ship the fixes.

Changes:

  • iOS: ensure continuous autofocus/auto-exposure is enabled on session start and re-engaged after zoom changes; restore continuous AF after tap-to-focus one-shot completes.
  • Android: re-engage autofocus after zoom changes; fix tap-to-focus coordinate mapping so the metering point and indicator align with the tapped location.
  • Repo metadata: bump .NET SDK version and add a patch changelog entry.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/library/DIPS.Mobile.UI/API/Camera/Shared/iOS/CameraSession.cs Enables continuous AF/AE on startup and after slider-based zoom changes.
src/library/DIPS.Mobile.UI/API/Camera/Shared/Android/CameraFragment.cs Triggers a focus/metering action after pinch-to-zoom to re-engage autofocus.
src/library/DIPS.Mobile.UI/API/Camera/Preview/iOS/PreviewView.cs Re-engages continuous AF after pinch end; restores continuous AF/AE after tap-to-focus via KVO observer.
src/library/DIPS.Mobile.UI/API/Camera/Preview/CameraPreview.cs Unifies focus-indicator Y-offset calculation across platforms using PreviewView.TranslationY.
src/library/DIPS.Mobile.UI/API/Camera/Preview/Android/PreviewView/PreviewViewHandler.cs Uses view-relative touch coordinates (GetX/GetY) for tap-to-focus.
global.json Bumps pinned SDK from 10.0.100 to 10.0.200.
CHANGELOG.md Adds 56.0.3 entry describing the camera fixes.

Comment thread src/library/DIPS.Mobile.UI/API/Camera/Shared/Android/CameraFragment.cs Outdated
Comment thread src/library/DIPS.Mobile.UI/API/Camera/Preview/iOS/PreviewView.cs
Vetle444 and others added 2 commits April 27, 2026 14:02
…gment.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants