Scan without asking the user to frame or turn the phone
The library's CaptureActivity has three defaults that put work on the person holding the phone, so the scan now goes through our own subclass instead: - It decodes only the framing rectangle, inset 10% from every edge. A code filling the viewfinder still decodes -- measured against the library's own decoder rather than assumed -- but only by spending its quiet zone on the crop, and anything further out is never looked at. The whole preview is decoded now, so framing is not something to get right. - It draws a red laser line and scatters dots wherever the detector finds a candidate pattern. That is the library's house style, and it looks like a fault. The preview is plain now. - Its manifest entry pins the activity to landscape. The code being scanned is usually on a monitor in front of someone holding the phone upright, so ours follows the sensor. Verified on the emulator: the scanner opens on a bare preview with no laser, no dots and no status line. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QQz6R4kBQcWSHBNZMgBnjL
This commit is contained in:
1 parent
0522123a33
commit
bf82166736
4 files changed
+55
-1
No files matched your search
@@ -158,7 +158,9 @@ Established 2026-08-25, and it decides more than it looks like:
|
||||
silently never matches — while the phone's own camera app, which tries
|
||||
both, does. The scanner asks for `Intents.Scan.MIXED_SCAN`, which
|
||||
alternates normal and inverted frames; keep it that way rather than
|
||||
making the server dictate the colours.
|
||||
making the server dictate the colours. `EnrollmentScanActivity` also
|
||||
turns off the library's 10% framing-rect inset (it decodes only what is
|
||||
inside it) and its laser/result-point decorations.
|
||||
- **AGP 9 refuses `Provider`s in the source-set API**: generated sources go
|
||||
through `androidComponents.onVariants { it.sources.java?.addGenerated
|
||||
SourceDirectory(task, Task::outputDir) }`, which also carries the task
|
||||
|
||||
Reference in new issue
Block a user