Camera Fragment Compat
Component API
{@code CameraFragmentCompat}
is the main entry point to the Gini Capture SDK when using the Component API with the Android Support Library.
It shows a camera preview with tap-to-focus functionality, a trigger button and an optional flash on/off button. The camera preview also shows document corner guides to which the user should align the document.
If instantiated with then a button for importing documents is shown next to the trigger button. A hint popup is displayed the first time the Gini Capture SDK is used to inform the user about document importing.
For importing documents {@code READ_EXTERNAL_STORAGE}
permission is required and if the permission is not granted the Gini Capture SDK will prompt the user to grant the permission. See @ { code Customizing the Camera Screen } on how to override the message and button titles for the rationale and on permission denial alerts.
Note: Your Activity hosting this Fragment must extend the and use an AppCompat Theme.
Include the {@code CameraFragmentCompat}
into your layout either directly with {@code }
in your Activity's layout or using the androidx.fragment.app.FragmentManager and one of the {@code createInstance()}
methods.
A CameraFragmentListener instance must be available until the {@code * CameraFragmentCompat}
is attached to an activity. Failing to do so will throw an exception. The listener instance can be provided either implicitly by making the hosting Activity implement the CameraFragmentListener interface or explicitly by setting the listener using .
Your Activity is automatically set as the listener in onAttach .
Customizing the Camera ScreenSee the CameraActivity for details.