Skip to content

Commit 96447fd

Browse files
Updating capabilities code snippets
1 parent f141f11 commit 96447fd

20 files changed

Lines changed: 139 additions & 74 deletions

_includes/sidelist-programming/programming-android.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
<li lang="android"><a href="{{ site.features }}use-format-specific-configuration.html?lang=android" class="otherLinkColour">Use format specific configurations</a></li>
6464
</ul>
6565
</li>
66-
<li lang="android"><a class="otherLinkColour">Customize the UI</a>
66+
<li lang="android"><a href="{{ site.android }}user-guide/capabilities/customize-ui-index.html" class="otherLinkColour">Customize the UI</a>
6767
<ul lang="android">
6868
<li lang="android"><a href="{{ site.android }}user-guide/capabilities/add-functional-buttons.html" class="otherLinkColour">Add Functional Buttons</a></li>
6969
<li lang="android"><a href="{{ site.android }}user-guide/capabilities/add-graphics.html" class="otherLinkColour">Add Graphics with DrawingItems</a></li>
@@ -73,9 +73,9 @@
7373
</ul>
7474
</li>
7575

76-
<li lang="android"><a href="{{ site.dbr_android_api }}" class="otherLinkColour">API References</a>
76+
<li lang="android"><a class="otherLinkColour">API References</a>
7777
<ul lang="android">
78-
<li lang="android"><a class="otherLinkColour">BarcodeScanner APIs</a>
78+
<li lang="android"><a href="{{ site.dbr_android_api }}barcode-scanner/index.html" class="otherLinkColour">BarcodeScanner APIs</a>
7979
<ul lang="android">
8080
<li lang="android"><a>Classes</a>
8181
<ul lang="android">
@@ -92,7 +92,7 @@
9292
</li>
9393
</ul>
9494
</li>
95-
<li lang="android"><a class="otherLinkColour">Foundational APIs</a>
95+
<li lang="android"><a href="{{ site.dbr_android_api }}" class="otherLinkColour">Foundational APIs</a>
9696
<ul lang="android">
9797
<li lang="android"><a>DynamsoftCaptureVisionRouter</a>
9898
<ul lang="android">

_includes/sidelist-programming/programming-oc.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676

7777
<li lang="objectivec-swift"><a href="{{ site.oc }}samples/index.html" class="otherLinkColour">Demo &amp; Samples</a></li>
7878

79-
<li lang="objectivec-swift"><a href="{{ site.dbr_ios_api }}barcode-scanner/index.html" class="otherLinkColour">API References</a>
79+
<li lang="objectivec-swift"><a class="otherLinkColour">API References</a>
8080
<ul lang="objectivec-swift">
8181
<li lang="objectivec-swift"><a href="{{ site.dbr_ios_api }}barcode-scanner/index.html" class="otherLinkColour">BarcodeScanner APIs</a>
8282
<ul lang="objectivec-swift">

programming/android/api-reference/barcode-scanner/index.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,10 @@ keywords: BarcodeScanner, api reference, Android
1616
| [`BarcodeScannerActivity`](barcode-scanner-activity.md) | The main class of `BarcodeScanner`. It is an activity class that implements barcode decoding features. |
1717
| [`BarcodeScannerConfig`](barcode-scanner-config.md) | The class that provides barcode scanning configurations. |
1818
| [`BarcodeScanResult`](barcode-scan-result.md) | The result class. |
19+
20+
## Enumerations
21+
22+
| Enumeration | Description |
23+
| ----------- | ----------- |
1924
| [`EnumResultStatus`](enum-result-status.md) | An enumeration class that describes the result status. |
2025
| [`EnumScanningMode`](enum-scanning-mode.md) | An enumeration class that describes the scanning mode. |

programming/android/user-guide/capabilities/add-functional-buttons.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ noTitleIndex: true
1919
BarcodeScanner provides a set of UI elements that you can easily customize.
2020

2121
<div align="center">
22-
<p><img src="../../../assets/buttons.png" width="70%" alt="barcode-scanner"></p>
23-
<p>Barcode Scanner UI Components</p>
22+
<p><img src="../../../assets/buttons.png" width="70%" alt="buttons"></p>
23+
<p>buttons</p>
2424
</div>
2525

2626
- Torch button: A clickable button that turns the torch on or off.

programming/android/user-guide/capabilities/add-graphics.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,7 @@ Set the style of the highlight overlays with a user defined style:
126126
```kotlin
127127
val layer = cameraView.getDrawingLayer(DrawingLayer.DBR_LAYER_ID)
128128
// Create a new DrawingStyle via the DrawingStyleManager.
129-
val teal_200_transparent = ResourcesCompat.getColor(
130-
this@MainActivity.getResources(),
131-
R.color.teal_200_transparent,
132-
null
133-
)
129+
val teal_200_transparent = ResourcesCompat.getColor(this@MainActivity.getResources(), R.color.teal_200_transparent, null)
134130
val teal_200 = ResourcesCompat.getColor(this@MainActivity.getResources(), R.color.teal_200, null)
135131
val style = DrawingStyleManager.createDrawingStyle(teal_200, 1.0f, teal_200_transparent, teal_200)
136132
// Set the newly created DrawingStyle to the layer.

programming/android/user-guide/capabilities/barcode-formats.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Example:
3434
>- Java
3535
>- Kotlin
3636
>
37-
>1.
37+
>1.
3838
```java
3939
try {
4040
SimplifiedCaptureVisionSettings settings = mRouter.getSimplifiedSettings(EnumPresetTemplate.PT_READ_BARCODES);
@@ -46,7 +46,7 @@ try {
4646
throw new RuntimeException(e);
4747
}
4848
```
49-
2.
49+
2.
5050
```kotlin
5151
try {
5252
val settings = mRouter.getSimplifiedSettings(EnumPresetTemplate.PT_READ_BARCODES)
@@ -69,13 +69,13 @@ Example:
6969
>- Java
7070
>- Kotlin
7171
>
72-
>1.
72+
>1.
7373
```java
7474
BarcodeScannerConfig config = new BarcodeScannerConfig();
7575
// QR Code + DataMatrix
7676
config.setBarcodeFormats(EnumBarcodeFormat.BF_QR_CODE | EnumBarcodeFormat.BF_DATAMATRIX);
7777
```
78-
2.
78+
2.
7979
```kotlin
8080
val config = BarcodeScannerConfig()
8181
// QR Code + DataMatrix
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
layout: default-layout
3+
title: Customize the UI - Dynamsoft Barcode Reader Android
4+
description: Learn how to customize the UI of Dynamsoft Barcode Reader on Android.
5+
keywords: BarcodeScanner, barcode reader, Android, scan region, torch button, close button, scan laser
6+
needAutoGenerateSidebar: true
7+
needGenerateH3Content: true
8+
noTitleIndex: true
9+
---
10+
11+
# Customize Your UI
12+
13+
| Customizable UI Elements | Descriptions |
14+
| ------------------------ | ------------ |
15+
| [Torch button](add-functional-buttons.md) | The button for you to turn on/off the torch. |
16+
| [Camera toggle button](add-functional-buttons.md) | The button for you to switch between front/back-facing cameras. |
17+
| [Close button](add-functional-buttons.md) (BarcodeScanner API only) | The button for you to manually close the BarcodeScanner. |
18+
| [Scan Region stroke](scan-region-style.md) | The boundary of the scan region. |
19+
| [Scan Region Mask](scan-region-style.md) | The mask outside the scan region. |
20+
| [Graphics (DrawingItems)](add-graphics.md) | Quadrilateral, rectangle, arc, etc. |
21+
22+
<div align="center">
23+
<p><img src="../../../assets/customize-ui.png" width="70%" alt="customize-ui"></p>
24+
<p>Customizable UI Elements</p>
25+
</div>

programming/android/user-guide/capabilities/init-customized-template.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ Using a template file is one of the quickest ways to improve BarcodeScanner perf
1717
Add a **Templates** folder under your project's assets directory at **src\main\assets\Templates**. Put your JSON file in the **Templates** folder. Here, we use **ReadQRCode.json** as an example.
1818

1919
<div align="left">
20-
<p><img src="../../../assets/init-settings-from-file-android.png" alt="initSettings" width="50%" /></p>
20+
<p><img src="../../../assets/init-settings-from-file-android.png" alt="initSettings" width="50%" /></p>
21+
<p>init settings</p>
2122
</div>
2223

2324
## Initialize with Foundational APIs
@@ -64,4 +65,4 @@ val config = BarcodeScannerConfig().apply {
6465
**Related APIs**
6566

6667
- [`setTemplateFile`]({{ site.dbr_android_api }}barcode-scanner/barcode-scanner-config.html#settemplatefile)
67-
- [initSettingsFromFile]({{ site.dcvb_android_api }}capture-vision-router/settings.html#initsettingsfromfile)
68+
- [`initSettingsFromFile`]({{ site.dcvb_android_api }}capture-vision-router/settings.html#initsettingsfromfile)

programming/android/user-guide/capabilities/read-specific-area.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ mCamera.scanRegion = DSRect(0.15f, 0.25f, 0.85f, 0.65f, true)
3838
**Related APIs**
3939

4040
- [`CameraEnhancer`]({{ site.dbr_android_api }}camera-enhancer/camera-enhancer.html)
41-
- [`setScanRegion`]({{ site.dbr_android_api }}camera-enhancer/camera-enhancer.html#setscanregion)
41+
- [`setScanRegion`]({{ site.dbr_android_api }}camera-enhancer/camera-enhancer.html#setscanregion)
4242

4343
### Work with BarcodeScanner APIs
4444

@@ -105,7 +105,7 @@ try {
105105
captureVisionSettings.roiMeasuredInPercentage = true
106106
mRouter.updateSettings(EnumPresetTemplate.PT_READ_BARCODES, captureVisionSettings)
107107
} catch (e: CaptureVisionRouterException) {
108-
e.printStackTrace()
108+
e.printStackTrace()
109109
}
110110
```
111111

programming/android/user-guide/capabilities/scan-region-style.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,18 @@ After you call `setScanRegion`, the scan region is visible by default. You can h
2121
>1.
2222
```java
2323
try {
24-
mCamera.setScanRegion(new DSRect(0.15f, 0.25f, 0.85f, 0.65f, true));
24+
mCamera.setScanRegion(new DSRect(0.15f, 0.25f, 0.85f, 0.65f, true));
2525
} catch (CameraEnhancerException e) {
26-
throw new RuntimeException(e);
26+
throw new RuntimeException(e);
2727
}
2828
cameraView.setScanRegionMaskVisible(false);
2929
```
3030
2.
3131
```kotlin
3232
try {
33-
mCamera.setScanRegion(DSRect(0.15f, 0.25f, 0.85f, 0.65f, true))
33+
mCamera.setScanRegion(DSRect(0.15f, 0.25f, 0.85f, 0.65f, true))
3434
} catch (e: CameraEnhancerException) {
35-
throw RuntimeException(e)
35+
throw RuntimeException(e)
3636
}
3737
cameraView.setScanRegionMaskVisible(false)
3838
```
@@ -42,8 +42,8 @@ cameraView.setScanRegionMaskVisible(false)
4242
The scan region mask style includes the stroke color, stroke width, and mask color.
4343

4444
<div align="center">
45-
<p><img src="../../../assets/scan-region-style.png" width="70%" alt="barcode-scanner"></p>
46-
<p>Barcode Scanner UI Components</p>
45+
<p><img src="../../../assets/scan-region-style.png" width="70%" alt="scan-region-style"></p>
46+
<p>Scan Region Style</p>
4747
</div>
4848

4949
1. Add your colors to `res/values/colors.xml`.

0 commit comments

Comments
 (0)