-
Notifications
You must be signed in to change notification settings - Fork 1
PP-1480: Integration of Capture SDK #836
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
base: main
Are you sure you want to change the base?
Conversation
…ted from example app PP-1480
…t property PP-1480
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 fixes a crash in the example app when the GiniCapture SDK is started by implementing proper fragment recreation handling for orientation changes and improving memory management through nullable listeners.
- Adds a custom FragmentFactory to handle GiniCaptureFragment creation with parameterized constructor
- Changes GiniCaptureFragment listener from lateinit to nullable for better memory management
- Updates example app structure to properly handle fragment state restoration
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
GiniCaptureFragment.kt | Changes listener to nullable and adds null-safe calls to prevent crashes and improve GC |
activity_stand_alone_capture_flow.xml | New layout file for standalone capture flow with FragmentContainerView |
CaptureResultListener.kt | Adds missing boolean parameter to ExtractionsActivity intent |
ClientCaptureSDKFragment.kt | Simplifies fragment by delegating result handling and adding nullable listener management |
CaptureSdkStandAloneActivity.kt | Implements FragmentFactory pattern and proper fragment state restoration |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
...le-app/src/main/java/net/gini/android/bank/sdk/exampleapp/ui/CaptureSdkStandAloneActivity.kt
Outdated
Show resolved
Hide resolved
...le-app/src/main/java/net/gini/android/bank/sdk/exampleapp/ui/CaptureSdkStandAloneActivity.kt
Outdated
Show resolved
Hide resolved
|
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 have added a comment. Please take a look and if applicable, try to fix it. Thank you!
Description
Here is the Jira Ticket Link
Notes for reviewer
Fixes crash in the example app, when GiniCapture SDK is started.
Reason detected:
Android system was not able to create GiniCaptureFragment because this class have parameterized constructor, So fragment factory is provided in the example app, which Android system will use to construct the fragment in case of orientation change.
Also, changed the
lateinit giniCaptureFragmentListener
property ofGiniCaptureFragment
to nullable, so it can be marked as null when theonDestroy
is called, and it can be collected by GC.Because we are setting the listener again in the event of orientation change through
ClientCaptureSDKFragmentFactory
, so we will keep getting the updates.Thank you.