目录

class info
com.huawei.hms.mlplugin.card.gcr.MLGcrCaptureUIConfig.Factory
Creates an instance of the recognition UI configurator.

Public Method Summary

Return typeMethod name
MLGcrCaptureUIConfigcreate()
MLGcrCaptureUIConfig.FactorysetBackButtonResId(int backResId)
MLGcrCaptureUIConfig.FactorysetOrientation(int orientation)
MLGcrCaptureUIConfig.FactorysetPhotoButtonResId(int photoResId)
MLGcrCaptureUIConfig.FactorysetScanBoxCornerColor(int color)
MLGcrCaptureUIConfig.FactorysetTipText(String tip)
MLGcrCaptureUIConfig.FactorysetTipTextColor(int color)
MLGcrCaptureUIConfig.FactorysetTorchResId(int torchOffResId, int torchOnResId)

Public Methods

Method
public MLGcrCaptureUIConfig create()
Creates an instance of the general card recognition UI configurator.

Return

Typedesc
MLGcrCaptureUIConfigInstance of the general card recognition UI configurator.

Sample Code

  1. MLGcrCaptureUIConfig uiConfig = new MLGcrCaptureUIConfig.Factory()
  2.     // Set the color of the scanning box.
  3.     .setScanBoxCornerColor(Color.GREEN)
  4.     // Set the tip text in the scanning box. It is recommended that the tip text contain fewer than 30 characters.
  5.     .setTipText("Recognizing, align edges")
  6.     // Set the screen orientation. Three modes are supported.
  7.      // MLGcrCaptureUIConfig.ORIENTATION_AUTO: adaptive mode. The physical sensor decides the screen orientation.
  8.     // MLGcrCaptureUIConfig.ORIENTATION_LANDSCAPE: landscape mode. The screen width is greater than the screen height.
  9.      // MLGcrCaptureUIConfig.ORIENTATION_PORTRAIT: portrait mode. The screen height is greater than the screen width.
  10.     .setOrientation(MLGcrCaptureUIConfig.ORIENTATION_AUTO)
  11.     .create();
Method
public MLGcrCaptureUIConfig.Factory setBackButtonResId(int backResId)
Sets the resource ID of the back button image on the scanning UI.

Parameters

Parameter nameParameter desc
backResIdResource ID of the back button image.

Return

Typedesc
MLGcrCaptureUIConfig.FactoryFactory instance of the general card recognition UI configurator.
Method
public MLGcrCaptureUIConfig.Factory setOrientation(int orientation)
Sets the scanning screen orientation (landscape or portrait).

Parameters

Parameter nameParameter desc
orientationScanning screen orientation (landscape or portrait). The options are ORIENTATION_AUTO (default value), ORIENTATION_LANDSCAPE, and ORIENTATION_PORTRAIT.

Return

Typedesc
MLGcrCaptureUIConfig.FactoryFactory instance of the general card recognition UI configurator.
Method
public MLGcrCaptureUIConfig.Factory setPhotoButtonResId(int photoResId)
Sets the resource ID of the shot button image on the scanning UI.

Parameters

Parameter nameParameter desc
photoResIdResource ID of the shot button image.

Return

Typedesc
MLGcrCaptureUIConfig.FactoryFactory instance of the general card recognition UI configurator.
Method
public MLGcrCaptureUIConfig.Factory setScanBoxCornerColor(int color)
Sets the color value of the scanning box corners.

Parameters

Parameter nameParameter desc
colorColor value of the scanning box corners.

Return

Typedesc
MLGcrCaptureUIConfig.FactoryFactory instance of the general card recognition UI configurator.
Method
public MLGcrCaptureUIConfig.Factory setTipText(String tip)
Sets the tips displayed in the scanning box.

Parameters

Parameter nameParameter desc
tipTips displayed in the scanning box.

Return

Typedesc
MLGcrCaptureUIConfig.FactoryFactory instance of the general card recognition UI configurator.
Method
public MLGcrCaptureUIConfig.Factory setTipTextColor(int color)
Sets the color value of the tips displayed in the scanning box.

Parameters

Parameter nameParameter desc
colorColor value of the tips displayed in the scanning box.

Return

Typedesc
MLGcrCaptureUIConfig.FactoryFactory instance of the general card recognition UI configurator.
Method
public MLGcrCaptureUIConfig.Factory setTorchResId(int torchOffResId, int torchOnResId)
Sets the resource IDs of the torch-on and torch-off images on the scanning UI.

Parameters

Parameter nameParameter desc
torchOffResIdResource ID of the torch-off image.
torchOnResIdResource ID of the torch-on image.

Return

Typedesc
MLGcrCaptureUIConfig.FactoryFactory instance of the general card recognition UI configurator.