Package net.gini.android.capture.review

Contains the Activity and Fragments used for the Review Screen.

Screen API

The preferred way of adding network calls to the Gini Capture SDK is by creating a net.gini.android.capture.GiniCapture instance with a net.gini.android.capture.network.GiniCaptureNetworkService and a net.gini.android.capture.network.GiniCaptureNetworkApi implementation.

Component API

To use the Component API you have to include the net.gini.android.capture.review.ReviewFragmentCompat 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.capture.review.ReviewFragmentListener interface.

Types

ReviewActivity
Link copied to clipboard

Screen API When you use the Screen API, the {@code ReviewActivity} displays the photographed or imported image and allows the user to review it by checking the sharpness, quality and orientation of the image. The user can correct the orientation by rotating the image.

The preferred way of adding network calls to the Gini Capture SDK is by creating a GiniCapture instance with a GiniCaptureNetworkService and a GiniCaptureNetworkApi implementation.

The {@code ReviewActivity} is started by the CameraActivity after the user has taken a photo or imported an image of a document.

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

The following items are customizable:

  • Rotate button icon: via images for mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi named {@code * gc_review_button_rotate.png}
  • Rotate button color: via the color resources named {@code gc_review_fab_mini} and {@code gc_review_fab_mini_pressed}
  • Next button icon: via images for mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi named {@code * gc_review_fab_next.png}
  • Next button color: via the color resources named {@code gc_review_fab} and {@code * gc_review_fab_pressed}
  • Bottom advice text: via the string resource named {@code gc_review_bottom_panel_text}
  • Bottom text color: via the color resource named {@code gc_review_bottom_panel_text}
  • Bottom text font: via overriding the style named {@code * GiniCaptureTheme.Review.BottomPanel.TextStyle} and setting an item named {@code gcCustomFont} with the path to the font file in your {@code assets} folder
  • Bottom text style: via overriding the style named {@code * GiniCaptureTheme.Review.BottomPanel.TextStyle} and setting an item named {@code android:textStyle} to {@code normal} , {@code bold} or {@code italic}
  • Bottom text size: via overriding the style named {@code * GiniCaptureTheme.Review.BottomPanel.TextStyle} and setting an item named {@code android:textSize} to the desired {@code sp} size
  • Bottom panel background color: via the color resource named {@code * gc_review_bottom_panel_background}
  • Background color: via the color resource named {@code gc_background} . Note: this color resource is global to all Activities ( CameraActivity , , ReviewActivity , AnalysisActivity )

Important: All overridden styles must have their respective {@code Root.} prefixed style as their parent. Ex.: the parent of {@code GiniCaptureTheme.Review.BottomPanel.TextStyle} must be {@code Root.GiniCaptureTheme.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 , AnalysisActivity ).

The following items are customizable:

  • Background color: via the color resource named {@code gc_action_bar} (highly recommended for Android 5+: customize the status bar color via {@code gc_status_bar} )
  • Title: via the string resource you set in your {@code AndroidManifest.xml} when declaring your Activity that extends ReviewActivity . The default title string resource is named {@code gc_title_review}
  • Title color: via the color resource named {@code gc_action_bar_title}
  • Back button: via images for mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi named {@code gc_action_bar_back}

public class ReviewActivity extends AppCompatActivity implements ReviewFragmentListener, ReviewFragmentInterface
ReviewFragmentCompat
Link copied to clipboard

Component API

When you use the Compontent API with the Android Support Library, the {@code * ReviewFragmentCompat} displays the photographed or imported image and allows the user to review it by checking the sharpness, quality and orientation of the image. The user can correct the orientation by rotating the image.

Note: Your Activity hosting this Fragment must extend the and use an AppCompat Theme.

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

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

Your Activity is automatically set as the listener in onCreate .

Customizing the Review Screen See the ReviewActivity for details.

public class ReviewFragmentCompat extends Fragment implements FragmentImplCallback, ReviewFragmentInterface
ReviewFragmentHelper
Link copied to clipboard

Internal use only.

final class ReviewFragmentHelper
ReviewFragmentImpl
Link copied to clipboard

Internal use only.

class ReviewFragmentImpl implements ReviewFragmentInterface
ReviewFragmentInterface
Link copied to clipboard

Methods which Review Fragment must implement.

public interface ReviewFragmentInterface
ReviewFragmentListener
Link copied to clipboard

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

public interface ReviewFragmentListener
RotatableImageViewContainer
Link copied to clipboard

Internal use only.

public class RotatableImageViewContainer extends FrameLayout
RotatableTouchImageViewContainer
Link copied to clipboard

Internal use only.

public class RotatableTouchImageViewContainer extends RotatableImageViewContainer