Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit 5fa5103

Browse files
Added a bit of logging
1 parent 72d9e39 commit 5fa5103

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import { Component } from "@angular/core";
2-
import { MLKitScanBarcodesOnDeviceResult } from "nativescript-plugin-firebase/mlkit/barcodescanning";
2+
import {
3+
MLKitScanBarcodesOnDeviceResult,
4+
MLKitScanBarcodesResultBarcode
5+
} from "nativescript-plugin-firebase/mlkit/barcodescanning";
36
import { AbstractMLKitViewComponent } from "~/tabs/mlkit/abstract.mlkitview.component";
47

58
@Component({
@@ -8,23 +11,20 @@ import { AbstractMLKitViewComponent } from "~/tabs/mlkit/abstract.mlkitview.comp
811
templateUrl: "./barcodescanning.component.html",
912
})
1013
export class BarcodeScanningComponent extends AbstractMLKitViewComponent {
11-
barcodes: Array<{
12-
value: string;
13-
format: string;
14-
}>;
14+
15+
barcodes: Array<MLKitScanBarcodesResultBarcode>;
1516

1617
pause: boolean = false;
1718

1819
onBarcodeScanResult(event: any): void {
1920
const result: MLKitScanBarcodesOnDeviceResult = event.value;
2021
this.barcodes = result.barcodes;
2122

22-
console.log("this.barcodes: " + JSON.stringify(this.barcodes));
23-
2423
if (this.barcodes.length > 0) {
25-
console.log("pausing the scanner for 3 seconds (to test the 'pause' feature)");
24+
console.log("this.barcodes: " + JSON.stringify(this.barcodes));
25+
console.log("pausing the scanner for 1 second (to show the 'pause' feature)");
2626
this.pause = true;
27-
setTimeout(() => this.pause = false, 3000)
27+
setTimeout(() => this.pause = false, 1000)
2828
}
2929
}
3030
}

demo-ng/app/tabs/mlkit/facedetection/facedetection.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export class FaceDetectionComponent extends AbstractMLKitViewComponent {
1616
const value: MLKitDetectFacesOnDeviceResult = scanResult.value;
1717
if (value.faces.length > 0) {
1818
this.faces = value.faces;
19+
console.log("this.faces: " + JSON.stringify(this.faces));
1920

2021
let allSmilingAndEyesOpen = true;
2122
value.faces.forEach(face => {

0 commit comments

Comments
 (0)