Setting
Adapting the RFID app
46
Hans Turck GmbH & Co. KG | T +49 208 4952-0 | F +49 208 4952-264 | [email protected] | www.turck.com
// showBarcodePage shows the barcode page.
showBarcodePage() {
app.showPage(
new
turck.ui.BarcodePage({
titleText:
"@string/HomePageBarcodeButton"
,
// these define what each footer button DOES, not the text they display.
// setting one to "scan" makes that footer button start or stop a barcode
// scan. setting it to "copy" makes that button copy the scanned barcode
// to the Android clipboard.
footerCenter:
"scan"
,
footerRight:
"copy"
,
// this function gets called when a barcode is found.
barcodeScanned:
function
(barcode) {
// displayBarcode() makes the barcode value appear on the screen.
this
.displayBarcode(barcode);
},
// onPD67RightButtonPress works the same way it did above.
onPD67TriggerButtonPress:
function
() {
if
(!
this
.isScanning) {
this
.startBarcodeScan();
}
else
{
this
.cancelBarcodeScan();
}
},
// onPD67LeftButtonPress works the same way it did above.
onPD67LeftButtonPress:
function
() {
if
(!
this
.isScanning) {
this
.startBarcodeScan();
}
else
{
this
.cancelBarcodeScan();
}
},
// onPD67RightButtonPress works the same way it did above.
onPD67RightButtonPress:
function
() {
if
(!
this
.isScanning) {
this
.startBarcodeScan();
}
else
{
this
.cancelBarcodeScan();
}
}
}));
}
}
// Create the app object. very important!
var
app =
new
turck.DefaultApp();