Analysis Fragment Compat
Component API
When you use the Component API with the Android Support Library, the {@code * AnalyzeDocumentFragmentCompat}
displays the captured or imported document and an activity indicator while the document is being analyzed by the Gini API.
Note: You can use the activity indicator message to display a message under the activity indicator by overriding the string resource named {@code gc_analysis_activity_indicator_message}
. The message is displayed for images only.
For PDF documents the first page is shown (only on Android 5.0 Lollipop and newer) along with the PDF's filename and number of pages above the page. On Android KitKat and older only the PDF's filename is shown with the preview area left empty.
Note: Your Activity hosting this Fragment must extend the and use an AppCompat Theme.
Include the {@code AnalyzeDocumentFragmentCompat}
into your layout by using the factory method to create an instance and display it using the androidx.fragment.app.FragmentManager .
An AnalysisFragmentListener instance must be available until the {@code * AnalysisFragmentCompat}
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 AnalysisFragmentListener interface or explicitly by setting the listener using .
Your Activity is automatically set as the listener in onCreate .
Customizing the Analysis ScreenSee the AnalysisActivity for details.