Skip to content

feat: Add native tap-to-focus reset listener - #4173

Closed
mrousavy wants to merge 1 commit into
feat/native-tap-focus-listenersfrom
feat/native-tap-focus-reset-listener
Closed

feat: Add native tap-to-focus reset listener#4173
mrousavy wants to merge 1 commit into
feat/native-tap-focus-listenersfrom
feat/native-tap-focus-reset-listener

Conversation

@mrousavy

Copy link
Copy Markdown
Member

Summary

  • add addOnFocusResetListener to the native tap-to-focus gesture controller
  • emit after MeteringTask successfully performs its automatic reset on iOS
  • explicitly schedule and await CameraX focus cancellation on Android so reset completion is observable
  • invalidate pending automatic resets when a newer focus or manual reset supersedes the gesture

This PR is stacked on #4172. It intentionally reports automatic resets from native tap-to-focus gestures only; failed or superseded resets do not emit.

Test plan

  • bun camera specs
  • bun run lint-all
  • bun camera typecheck
  • bun camera build
  • ./apps/simple-camera/android/gradlew -p apps/simple-camera/android :react-native-vision-camera:assembleDebug --no-daemon --console=plain
  • xcodebuild -workspace SimpleCamera.xcworkspace -scheme VisionCamera -sdk iphonesimulator -configuration Debug -destination 'generic/platform=iOS Simulator' -derivedDataPath build CODE_SIGNING_ALLOWED=NO build -quiet

@vercel

vercel Bot commented Aug 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
react-native-vision-camera-docs Ready Ready Preview Aug 24, 2026 4:13pm

Request Review

@mrousavy

Copy link
Copy Markdown
Member Author

Too overcomplicated. Let's just not have this feature now, the code got too complex to support this. We can ask the CameraX team to add a on focus reset event

@mrousavy mrousavy closed this Aug 26, 2026
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.

1 participant