-
Notifications
You must be signed in to change notification settings - Fork 48
[EPIC-6660] update snippets to new result api #414
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
Conversation
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.
Pull request overview
This PR updates code snippets to migrate from the old activity result API to a new result API pattern. The changes modernize result handling by replacing registerForActivityResultOk with registerForActivityResult and using onSuccess/onFailure extension functions for cleaner error handling.
Key Changes
- Migrated from
registerForActivityResultOktoregisterForActivityResultwithonSuccess/onFailurehandlers - Added comprehensive error handling with specific error type cases (
InvalidLicenseError,OperationCanceledError) - Updated SDK version from
8.0.0.61-STAGING-SNAPSHOTto8.0.0.62-STAGING-SNAPSHOT
Reviewed changes
Copilot reviewed 27 out of 27 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| SinglePagePreviewActivity.kt | Updated cropping result handler to use new API |
| MainActivity.kt (document-scanner) | Updated document scanner result handler with error handling |
| StandaloneCropScreenSnippet.kt | Updated cropping UI snippet with comprehensive error handling |
| Multiple snippet files | Migrated all RTU UI snippets to new result API pattern |
| QuickStartSnippets.kt | Simplified result parameter naming |
| VinUiSnippet.kt | Added error handling to all VIN scanner snippets |
| TextPatternUiSnippet.kt | Added error handling to all text pattern scanner snippets |
| MrzUiSnippet.kt | Added error handling to all MRZ scanner snippets |
| RtuUi2DocumentSnippets.kt | Updated migration snippets to new API |
| DataExtractionUiSnippet.kt | Added error handling to all data extractor snippets |
| CreditCardUiSnippet.kt | Added error handling and fixed credit card result handling |
| CheckUiSnippet.kt | Added error handling to all check scanner snippets |
| MainActivity.kt (data-capture) | Updated multiple scanner result handlers |
| app/build.gradle files | Bumped SDK version to 8.0.0.62-STAGING-SNAPSHOT |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...mple/app/src/main/java/io/scanbot/example/doc_code_snippet/creditcard/CreditCardUiSnippet.kt
Show resolved
Hide resolved
...mple/app/src/main/java/io/scanbot/example/doc_code_snippet/creditcard/CreditCardUiSnippet.kt
Outdated
Show resolved
Hide resolved
data-capture-ready-to-use-ui-example/app/src/main/java/io/scanbot/example/MainActivity.kt
Outdated
Show resolved
Hide resolved
data-capture-ready-to-use-ui-example/app/src/main/java/io/scanbot/example/MainActivity.kt
Show resolved
Hide resolved
…bot/example/doc_code_snippet/creditcard/CreditCardUiSnippet.kt Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
No description provided.