Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add QR code scanner for frontend #4303

Merged
merged 12 commits into from
May 3, 2024

Conversation

jpelgrom
Copy link
Member

@jpelgrom jpelgrom commented Mar 27, 2024

Summary

Add a QR code scanner to the app (home-assistant/frontend#19570). This uses the 'old' ZXing library because something like MLKit is not 100% open source and would exclude the minimal flavor.

Screenshots

Recreated from design in frontend PR and the Google Matter barcode scanner which closely matches the design sample

Active scanner Active scanner, landscape optimized layout Permission denied
image image image

Link to pull request in Documentation repository

n/a

Any other notes

 - Add a overlay with cutout in the middle / on the side, matching design and Google's barcode scanner
 - Working button for toggling the flashlight on and off
 - Fix camera remaining active when the activity is paused (for example, by going to another app)
 - Set the app's theme
 - Add more UI parts: title, subtitle, optional action button
 - Request permission when launched, and add snackbar when permission is denied
 - Add flashlight button and position it to line up with the frame
 - Make title/subtitle/action dynamic
 - Fix double scrim for system bars on older API levels
 - The type for external bus messages should be command, with the bar_code/* in the key command
 - Send aborted when closing the scanner using back
 - Make sure the device actually has a camera and is not automotive
@jpelgrom
Copy link
Member Author

jpelgrom commented May 1, 2024

External bus functionality implemented, this should be good to review now!

qr.mp4

@jpelgrom jpelgrom marked this pull request as ready for review May 1, 2024 10:27
Copy link
Member

@dshokouhi dshokouhi left a comment

Choose a reason for hiding this comment

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

Looks good to me, great work on all this!

@dshokouhi dshokouhi merged commit 674f5d4 into home-assistant:master May 3, 2024
4 checks passed
@jpelgrom jpelgrom deleted the barcodescanner branch May 3, 2024 04:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants