| class info |
| com.huawei.hms.mlplugin.card.gcr.MLGcrCaptureUIConfig.Factory |
| Creates an instance of the recognition UI configurator. |
| Return type | Method name |
| MLGcrCaptureUIConfig | create() |
| MLGcrCaptureUIConfig.Factory | setBackButtonResId(int backResId) |
| MLGcrCaptureUIConfig.Factory | setOrientation(int orientation) |
| MLGcrCaptureUIConfig.Factory | setPhotoButtonResId(int photoResId) |
| MLGcrCaptureUIConfig.Factory | setScanBoxCornerColor(int color) |
| MLGcrCaptureUIConfig.Factory | setTipText(String tip) |
| MLGcrCaptureUIConfig.Factory | setTipTextColor(int color) |
| MLGcrCaptureUIConfig.Factory | setTorchResId(int torchOffResId, int torchOnResId) |
| Method |
| public MLGcrCaptureUIConfig create() |
| Creates an instance of the general card recognition UI configurator. |
Return
| Type | desc |
| MLGcrCaptureUIConfig | Instance of the general card recognition UI configurator. |
Sample Code
- MLGcrCaptureUIConfig uiConfig = new MLGcrCaptureUIConfig.Factory()
- // Set the color of the scanning box.
- .setScanBoxCornerColor(Color.GREEN)
- // Set the tip text in the scanning box. It is recommended that the tip text contain fewer than 30 characters.
- .setTipText("Recognizing, align edges")
- // Set the screen orientation. Three modes are supported.
- // MLGcrCaptureUIConfig.ORIENTATION_AUTO: adaptive mode. The physical sensor decides the screen orientation.
- // MLGcrCaptureUIConfig.ORIENTATION_LANDSCAPE: landscape mode. The screen width is greater than the screen height.
- // MLGcrCaptureUIConfig.ORIENTATION_PORTRAIT: portrait mode. The screen height is greater than the screen width.
- .setOrientation(MLGcrCaptureUIConfig.ORIENTATION_AUTO)
- .create();
| Method |
| public MLGcrCaptureUIConfig.Factory setBackButtonResId(int backResId) |
| Sets the resource ID of the back button image on the scanning UI. |
Parameters
| Parameter name | Parameter desc |
| backResId | Resource ID of the back button image. |
Return
| Type | desc |
| MLGcrCaptureUIConfig.Factory | Factory 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 name | Parameter desc |
| orientation | Scanning screen orientation (landscape or portrait). The options are ORIENTATION_AUTO (default value), ORIENTATION_LANDSCAPE, and ORIENTATION_PORTRAIT. |
Return
| Type | desc |
| MLGcrCaptureUIConfig.Factory | Factory 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 name | Parameter desc |
| photoResId | Resource ID of the shot button image. |
Return
| Type | desc |
| MLGcrCaptureUIConfig.Factory | Factory 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 name | Parameter desc |
| color | Color value of the scanning box corners. |
Return
| Type | desc |
| MLGcrCaptureUIConfig.Factory | Factory 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 name | Parameter desc |
| tip | Tips displayed in the scanning box. |
Return
| Type | desc |
| MLGcrCaptureUIConfig.Factory | Factory 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 name | Parameter desc |
| color | Color value of the tips displayed in the scanning box. |
Return
| Type | desc |
| MLGcrCaptureUIConfig.Factory | Factory 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 name | Parameter desc |
| torchOffResId | Resource ID of the torch-off image. |
| torchOnResId | Resource ID of the torch-on image. |
Return
| Type | desc |
| MLGcrCaptureUIConfig.Factory | Factory instance of the general card recognition UI configurator. |