Skip to content

Commit 07e8b93

Browse files
committed
Update README to note that example can not be launched directly
Additionally update the app.js layout to harmonize the appearance and add a cordova/package.json file which is require for a cordova app starting with cordova-android 10.
1 parent db33d3a commit 07e8b93

File tree

4 files changed

+17
-5
lines changed

4 files changed

+17
-5
lines changed

example/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
## Prerequisites
44

55
To run the example it is recommended to use the [Tabris.js CLI](https://www.npmjs.com/package/tabris-cli).
6+
7+
The example can not be run directly from this directory since cordova doesn't allow to consume plugins if they are contained in a parent folder. Instead copy the example to an unrelated directory and adjust the `config.xml` of the example to point the `tabris-plugin-barcode-scanner` directory.
8+
69
## Running the Example
710

811
Using the Tabris.js CLI the example can be started by running:

example/cordova/config.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
version="3.1.0"
66
android-packageName="com.eclipsesource.tabris.barcodescanner.example"
77
android-versionCode="1">
8-
<name>Tabris.js Barcode Scanner Plugin Example</name>
8+
<name>Barcode scanner example for Tabris.js</name>
99
<description>Example for the Tabris.js Barcode Scanner plugin.</description>
1010
<author email="[email protected]" href="https://tabrisjs.com">EclipseSource</author>
1111

example/cordova/package.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"name": "tabris-plugin-barcode-scanner-example"
3+
}

example/src/app.js

+10-4
Original file line numberDiff line numberDiff line change
@@ -19,29 +19,35 @@ let scanner = new esbarcodescanner.BarcodeScannerView({
1919
let controls = new Composite({
2020
id: 'controls',
2121
left: 0, right: 0, bottom: 0,
22+
elevation: 2,
2223
background: '#FAFAFA',
2324
}).appendTo(contentView);
2425

2526
let barcodeTextView = new TextView({
26-
left: 0, top: 0, right: 0, height: 64,
27-
text: '<i><b>Waiting for barcode...</b></i>',
27+
left: 0, top: 0, right: 0, height: 48,
28+
text: '<i>Scanning for barcode...</i>',
2829
markupEnabled: true,
2930
lineSpacing: 1.2,
3031
font: '16px',
3132
alignment: 'centerX',
32-
background: 'white',
33-
elevation: 2
33+
}).appendTo(controls);
34+
35+
new Composite({
36+
top: "prev()", left: 0, right: 0, height: 1,
37+
background: '#00000022',
3438
}).appendTo(controls);
3539

3640
let formatPicker = new Picker({
3741
left: 16, top: 'prev() 16', right: 16,
3842
itemCount: BARCODES.length,
43+
selectionIndex: 0,
3944
itemText: (index) => BARCODES[index],
4045
}).appendTo(controls);
4146

4247
new Picker({
4348
left: 16, top: 'prev() 16', right: 16,
4449
itemCount: SCALE_MODES.length,
50+
selectionIndex: 0,
4551
itemText: (index) => SCALE_MODES[index],
4652
}).onSelect((event) => scanner.scaleMode = SCALE_MODES[event.index])
4753
.appendTo(controls);

0 commit comments

Comments
 (0)