-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
sample-gltf-viewer: introduce QR code feature. #3599
Conversation
Let me get this straight: you also created a project called |
Well it's just the name of a Kotlin class, it seemed like the most appropriate name at the time. :) |
@@ -74,6 +111,126 @@ class MainActivity : Activity() { | |||
modelViewer.view.bloomOptions = bloomOptions | |||
} | |||
|
|||
private fun bindPreview(cameraProvider: ProcessCameraProvider) { | |||
val preview : Preview = Preview.Builder().build().also { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can leave off the : Preview
here and : CameraSelector
down below
val scanner = BarcodeScanning.getClient(options) | ||
scanner.process(image) | ||
.addOnSuccessListener { barcodes -> | ||
for (barcode in barcodes) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If multiple barcodes are detected, does it make sense to call downloadFromBarcode
for each? Perhaps we just want to download the first one we find.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, I will simplify this.
This commit did not require any changes to ModelViewer or any of our libraries. It involved the following additions to the app MainActivity: - Add a button to the app bar, which requires AppCompatActivity as per https://developer.android.com/training/appbar/setting-up - Add a PreviewView widget from androidx. - Add usage of BarcodeScanner in mlkit. - Add a coroutine for downloading data via HttpURLConnection. We would like to add more features in the future, including the ability to drop additional models without rescanning and the ability to drop zip files.
This adds a button to the action bar and spins up a WebSockets server. Unlike my first attempt (#3599), this does not use a piping server and is therefore much faster to use over a LAN.
This adds a WebSockets server to filament-utils-android. Unlike my first attempt (#3599), this does not use a piping server and is therefore much faster to use over a LAN. It also has lower user friction because there is no need to touch a button in the app or scan a QR code.
This adds a WebSockets server to filament-utils-android. Unlike my first attempt (#3599), this does not use a piping server and is therefore much faster to use over a LAN. It also has lower user friction because there is no need to touch a button in the app or scan a QR code.
This adds a WebSockets server to filament-utils-android. Unlike my first attempt (#3599), this does not use a piping server and is therefore much faster to use over a LAN. It also has lower user friction because there is no need to touch a button in the app or scan a QR code.
This adds a WebSockets server to filament-utils-android. Unlike my first attempt (#3599), this does not use a piping server and is therefore much faster to use over a LAN. It also has lower user friction because there is no need to touch a button in the app or scan a QR code.
This adds a WebSockets server to filament-utils-android. Unlike my first attempt (#3599), this does not use a piping server and is therefore much faster to use over a LAN. It also has lower user friction because there is no need to touch a button in the app or scan a QR code.
This adds a WebSockets server to filament-utils-android. Unlike my first attempt (#3599), this does not use a piping server and is therefore much faster to use over a LAN. It also has lower user friction because there is no need to touch a button in the app or scan a QR code.
This adds a WebSockets server to filament-utils-android. Unlike my first attempt (google#3599), this does not use a piping server and is therefore much faster to use over a LAN. It also has lower user friction because there is no need to touch a button in the app or scan a QR code.
This works in tandem with the new page at https://google.github.io/filament/qrcode/
This feature did not require any changes to
ModelViewer.kt
or any of our libraries. It involves the following additions to the app MainActivity:Add a button to the app bar, which requires AppCompatActivity as per
https://developer.android.com/training/appbar/setting-up
Add a PreviewView widget from androidx.
Add usage of BarcodeScanner in mlkit.
Add a coroutine for downloading data via HttpURLConnection.
We would like to add more features in the future, including the ability
to drop additional models without rescanning and the ability to drop
zip files.
This feature was inspired by a Model Viewer editor feature, thanks @elalish