Package net.gini.android.vision.review.multipage

Contains the Activity and Fragment used for the Multi-Page Review Screen.

Screen API

The net.gini.android.vision.review.multipage.MultiPageReviewActivity displays images of a document and allows the user to reorder, rotate, zoom and delete them.

Component API

To use the Component API you have to include the net.gini.android.vision.review.multipage.MultiPageReviewFragment in an Activity in your app (a dedicated Activity is recommended). To receive events from the Fragments your Activity must implement the net.gini.android.vision.review.multipage.MultiPageReviewFragmentListener interface.

Types

MultiPageReviewActivity
Link copied to clipboard

Screen API When you use the Screen API and have enabled the multi-page feature, the {@code * MultiPageReviewActivity} displays the photographed or imported images and allows the user to review them by checking the order, sharpness, quality and orientation of the images. The user can correct the order by dragging the thumbnails of the images and can also correct the orientation by rotating the images.

If multi-page has been enabled then the {@code MultiPageReviewActivity} is started by the CameraActivity after the user has taken the first photo or imported the first image of a document. For subsequent images the user has to tap on the image stack in the Camera Screen to launch it.

Important: A GiniVision instance is required to use the {@code * MultiPageReviewActivity}

Customizing the Multi-Page Review Screen Customizing the look of the Review Screen is done via overriding of app resources.

The following items are customizable:

  • Page indicator text style: via overriding the style named {@code * GiniVisionTheme.Review.MultiPage.PageIndicator.TextStyle}
  • Page indicator font: via overriding the style named {@code * GiniVisionTheme.Review.MultiPage.PageIndicator.TextStyle} and setting an item named {@code * gvCustomFont} with the path to the font file in your {@code assets} folder
  • Page indicator background color: via the color resource named {@code * gv_multi_page_review_page_indicator_background}
  • Next button icon: via images for mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi named {@code * gv_review_fab_checkmark.png}
  • Next button color: via the color resources named {@code gv_review_fab} and {@code * gv_review_fab_pressed}
  • Thumbnails panel background color: via the color resource named {@code * gv_multi_page_review_thumbnails_panel_background}
  • Thumbnail card background color: via the color resource named {@code * gv_multi_page_review_thumbnail_card_background}
  • Thumbnail badge text style: via overriding the style named {@code * GiniVisionTheme.Review.MultiPage.ThumbnailBadge.TextStyle}
  • Thumbnail badge font: via overriding the style named {@code * GiniVisionTheme.Review.MultiPage.ThumbnailBadge.TextStyle} and setting an item named {@code * gvCustomFont} with the path to the font file in your {@code assets} folder
  • Thumbnail badge background border color: via the color resource named {@code * gv_multi_page_thumbnail_badge_background_border}
  • Thumbnail drag indicator bumps icon: via images for mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi named {@code gv_bumps_icon.png}
  • Thumbnail highlight strip color: via the color resource named {@code * gv_multi_page_thumbnail_highlight_strip}
  • Thumbnail activity indicator color: via the color resource named {@code * gv_analysis_activity_indicator}
  • Thumbnail upload success background circle color: via the color resource named {@code * gv_multi_page_thumbnail_upload_success_icon_background}
  • Thumbnail upload success foreground tick color: via the color resource named {@code * gv_multi_page_thumbnail_upload_success_icon_foreground}
  • Thumbnail upload failure background circle color: via the color resource named {@code * gv_multi_page_thumbnail_upload_failure_icon_background}
  • Thumbnail upload failure foreground cross color: via the color resource named {@code * gv_multi_page_thumbnail_upload_failure_icon_foreground}
  • Add page icon: via images for mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi named {@code * gv_multi_page_add_page_icon.png}
  • Add page icon subtitle text: via the string resource named {@code * gv_multi_page_review_add_pages_subtitle}
  • Add page icon subtitle text style: via overriding the style named {@code * GiniVisionTheme.Review.MultiPage.AddPagesSubtitle.TextStyle}
  • Add page icon subtitle font: via overriding the style named {@code * GiniVisionTheme.Review.MultiPage.AddPagesSubtitle.TextStyle} and setting an item named {@code * gvCustomFont} with the path to the font file in your {@code assets} folder
  • Reorder pages tip text: via the string resource named {@code * gv_multi_page_review_reorder_pages_tip}
  • Reorder pages tip text style: via overriding the style named {@code * GiniVisionTheme.Review.MultiPage.ReorderPagesTip.TextStyle}
  • Reorder pages tip font: via overriding the style named {@code * GiniVisionTheme.Review.MultiPage.ReorderPagesTip.TextStyle} and setting an item named {@code * gvCustomFont} with the path to the font file in your {@code assets} folder
  • Rotate icon: via images for mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi named {@code * gv_rotate_icon.png}
  • Delete icon: via images for mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi named {@code * gv_delete_icon.png}
  • Image error message text style: via overriding the style named {@code * GiniVisionTheme.Snackbar.Error.TextStyle} and setting an item named {@code android:textStyle} to {@code normal} , {@code bold} or {@code italic}
  • Image error message font: via overriding the style named {@code * GiniVisionTheme.Snackbar.Error.TextStyle} and setting an item named {@code gvCustomFont} with the path to the font file in your {@code assets} folder
  • Image error message button text style: via overriding the style named {@code * GiniVisionTheme.Snackbar.Error.Button.TextStyle} and setting an item named {@code * android:textStyle} to {@code normal} , {@code bold} or {@code italic}
  • Image error message button font: via overriding the style named {@code * GiniVisionTheme.Snackbar.Error.Button.TextStyle} and setting an item named {@code gvCustomFont} with the path to the font file in your {@code assets} folder
  • Image error message background color: via the color resource named {@code * gv_snackbar_error_background}
  • Image analysis error message retry button text: via the string resource named {@code * gv_document_analysis_error_retry}
  • Imported image error message delete button text: via the string resource named {@code * gv_multi_page_review_delete_invalid_document}
  • Imported image delete last page dialog message: via the string resource named {@code * gv_multi_page_review_file_import_delete_last_page_dialog_message}
  • Imported image delete last page dialog positive button text: via the string resource named {@code gv_multi_page_review_file_import_delete_last_page_dialog_positive_button}
  • Imported image delete last page dialog negative button text: via the string resource named {@code gv_multi_page_review_file_import_delete_last_page_dialog_negative_button}
  • Imported image delete last page dialog button color: via the color resource named {@code gv_accent}

Important: All overridden styles must have their respective {@code Root.} prefixed style as their parent. Ex.: the parent of {@code GiniVisionTheme.Review.BottomPanel.TextStyle} must be {@code Root.GiniVisionTheme.Review.BottomPanel.TextStyle} .

Customizing the Action Bar Customizing the Action Bar is also done via overriding of app resources and each one - except the title string resource - is global to all Activities ( CameraActivity , , ReviewActivity , MultiPageReviewActivity , ).

The following items are customizable:

  • Background color: via the color resource named {@code gv_action_bar} (highly recommended for Android 5+: customize the status bar color via {@code gv_status_bar} )
  • Title: via the string resource named {@code gv_title_multi_page_review}
  • Title color: via the color resource named {@code gv_action_bar_title}
  • Back button (only for ReviewActivity , MultiPageReviewActivity and ): via images for mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi named {@code * gv_action_bar_back}

public class MultiPageReviewActivity extends AppCompatActivity implements MultiPageReviewFragmentListener
MultiPageReviewFragment
Link copied to clipboard

Component API

When you use the Compontent API and have enabled the multi-page feature, the {@code * MultiPageReviewFragment} displays the photographed or imported images and allows the user to review them by checking the order, sharpness, quality and orientation of the images. The user can correct the order by dragging the thumbnails of the images and can also correct the orientation by rotating the images.

Important:

Include the {@code MultiPageReviewFragment} into your layout by using the factory method to create an instance and display it using the androidx.fragment.app.FragmentManager .

A MultiPageReviewFragmentListener instance must be available until the {@code * MultiPageReviewFragment} 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 MultiPageReviewFragmentListener interface or explicitly by setting the listener using setListener .

Your Activity is automatically set as the listener in onCreate .

Customizing the Multi-Page Review Screen See the MultiPageReviewActivity for details.

public class MultiPageReviewFragment extends Fragment implements MultiPageReviewFragmentInterface, PreviewFragmentListener, FragmentImplCallback
MultiPageReviewFragmentInterface
Link copied to clipboard

Methods which the Multi-Page Review Fragment must implement.

public interface MultiPageReviewFragmentInterface
MultiPageReviewFragmentListener
Link copied to clipboard

Interface used by the MultiPageReviewFragment to dispatch events to the hosting Activity.

public interface MultiPageReviewFragmentListener