@habibov77/cordova-plugin-mcc-mlkit-barcode-scanner-fixed 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +166 -0
- package/package.json +47 -0
- package/plugin.xml +130 -0
- package/src/android/build-extras.gradle +14 -0
- package/src/android/res/assets/beep.ogg +0 -0
- package/src/android/res/drawable/flashlight.png +0 -0
- package/src/android/res/drawable/torch_active.xml +12 -0
- package/src/android/res/drawable/torch_inactive.xml +12 -0
- package/src/android/res/layout/capture_activity.xml +51 -0
- package/src/android/res/values/strings-de.xml +14 -0
- package/src/android/res/values/strings-en.xml +14 -0
- package/src/android/src/CaptureActivity.java +496 -0
- package/src/android/src/MLKitBarcodeScanner.java +183 -0
- package/src/android/src/utils/BitmapUtils.java +286 -0
- package/src/android/src/utils/FrameMetadata.java +69 -0
- package/src/ios/CDViOSScanner.h +21 -0
- package/src/ios/CDViOSScanner.m +197 -0
- package/src/ios/CameraViewController.h +38 -0
- package/src/ios/CameraViewController.m +554 -0
- package/src/ios/Sounds/beep.caf +0 -0
- package/src/ios/de.lproj/Localizable.strings +8 -0
- package/src/ios/en.lproj/Localizable.strings +8 -0
- package/www/BarcodeScanner.contract.js +10 -0
- package/www/BarcodeScanner.plugin.js +133 -0
package/README.md
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
## cordova-plugin-mcc-mlkit-barcode-scanner
|
|
2
|
+
|
|
3
|
+
Google ML Kit barcode scanning for Cordova (Android and iOS). Ships a simple JS API and TypeScript types, supports multiple barcode formats, optional beep/vibration feedback, and a configurable detector window.
|
|
4
|
+
|
|
5
|
+
- **Platforms**: Android, iOS
|
|
6
|
+
- **Cordova**: `cordova >= 7.1.0`, `cordova-android >= 8.0.0`, `cordova-ios >= 4.5.0`
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
cordova plugin add cordova-plugin-mcc-mlkit-barcode-scanner
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### iOS permission
|
|
17
|
+
Add a camera permission description (required by iOS) to your app’s `config.xml`:
|
|
18
|
+
|
|
19
|
+
```xml
|
|
20
|
+
<edit-config file="*-Info.plist" mode="merge" target="NSCameraUsageDescription">
|
|
21
|
+
<string>Camera access is required to scan barcodes.</string>
|
|
22
|
+
</edit-config>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### Global object
|
|
27
|
+
The plugin is exposed on the Cordova namespace after `deviceready`:
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
cordova.plugins.mlkit.barcodeScanner
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
### API
|
|
35
|
+
|
|
36
|
+
- `scan(options, success, failure): void`
|
|
37
|
+
- `options` (partial, all optional):
|
|
38
|
+
- `barcodeFormats`: object of booleans to enable formats:
|
|
39
|
+
- `Aztec`, `CodaBar`, `Code39`, `Code93`, `Code128`, `DataMatrix`, `EAN8`, `EAN13`, `ITF`, `PDF417`, `QRCode`, `UPCA`, `UPCE`
|
|
40
|
+
- `beepOnSuccess`: boolean (default `false`)
|
|
41
|
+
- `vibrateOnSuccess`: boolean (default `false`)
|
|
42
|
+
- `detectorSize`: number between 0 and 1, relative detector height (default `0.6`)
|
|
43
|
+
- `rotateCamera`: boolean (default `false`)
|
|
44
|
+
- `timeoutMs`: number (default `0`, disabled). Closes the scanner if no barcode is read before this timeout.
|
|
45
|
+
- `success(result)`:
|
|
46
|
+
- `result.text`: string (raw barcode text)
|
|
47
|
+
- `result.format`: string (one of the enabled formats above)
|
|
48
|
+
- `result.type`: string (ML Kit content type, e.g. `TEXT`, `URL`, `WIFI`, …)
|
|
49
|
+
- `failure(error)`:
|
|
50
|
+
- `error.cancelled`: boolean
|
|
51
|
+
- `error.message`: string (`"The scan was cancelled."`, `"Scanner already open."`, `"Scan timed out."`, or error message)
|
|
52
|
+
|
|
53
|
+
Default options enable all formats, with beep/vibrate off.
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
### Basic usage (vanilla JS)
|
|
57
|
+
|
|
58
|
+
```javascript
|
|
59
|
+
document.addEventListener('deviceready', function () {
|
|
60
|
+
var scanner = cordova.plugins.mlkit.barcodeScanner;
|
|
61
|
+
|
|
62
|
+
var options = {
|
|
63
|
+
barcodeFormats: { QRCode: true, Code128: true }, // others use defaults
|
|
64
|
+
beepOnSuccess: true,
|
|
65
|
+
vibrateOnSuccess: true,
|
|
66
|
+
detectorSize: 0.6, // 60% of view height
|
|
67
|
+
rotateCamera: false
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
scanner.scan(
|
|
71
|
+
options,
|
|
72
|
+
function onSuccess(result) {
|
|
73
|
+
console.log('Text:', result.text);
|
|
74
|
+
console.log('Format:', result.format);
|
|
75
|
+
console.log('Type:', result.type);
|
|
76
|
+
},
|
|
77
|
+
function onFailure(err) {
|
|
78
|
+
if (err && err.cancelled) {
|
|
79
|
+
console.log('User cancelled');
|
|
80
|
+
} else {
|
|
81
|
+
console.error('Scan failed:', err && err.message);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
);
|
|
85
|
+
});
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
### AngularJS / Ionic 1
|
|
90
|
+
|
|
91
|
+
Factory wrapper:
|
|
92
|
+
|
|
93
|
+
```javascript
|
|
94
|
+
angular.module('app').factory('BarcodeScanner', function ($q, $window, $ionicPlatform) {
|
|
95
|
+
function getScanner() {
|
|
96
|
+
return $window.cordova
|
|
97
|
+
&& $window.cordova.plugins
|
|
98
|
+
&& $window.cordova.plugins.mlkit
|
|
99
|
+
&& $window.cordova.plugins.mlkit.barcodeScanner;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function scan(options) {
|
|
103
|
+
return $q(function (resolve, reject) {
|
|
104
|
+
$ionicPlatform.ready(function () {
|
|
105
|
+
var scanner = getScanner();
|
|
106
|
+
if (!scanner) {
|
|
107
|
+
return reject({ cancelled: false, message: 'Plugin not available' });
|
|
108
|
+
}
|
|
109
|
+
scanner.scan(options || {}, resolve, reject);
|
|
110
|
+
});
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
return { scan: scan };
|
|
115
|
+
});
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Controller usage:
|
|
119
|
+
|
|
120
|
+
```javascript
|
|
121
|
+
angular.module('app').controller('ScanCtrl', function ($scope, BarcodeScanner) {
|
|
122
|
+
$scope.scan = function () {
|
|
123
|
+
BarcodeScanner.scan({
|
|
124
|
+
barcodeFormats: { QRCode: true, Code128: true },
|
|
125
|
+
beepOnSuccess: true
|
|
126
|
+
}).then(function (res) {
|
|
127
|
+
$scope.result = res.text;
|
|
128
|
+
}).catch(function (err) {
|
|
129
|
+
if (!err.cancelled) {
|
|
130
|
+
$scope.error = err.message || 'Scan failed';
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
};
|
|
134
|
+
});
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
### TypeScript (optional)
|
|
139
|
+
|
|
140
|
+
```ts
|
|
141
|
+
import type { IOptions, IResult, IError } from 'cordova-plugin-mcc-mlkit-barcode-scanner';
|
|
142
|
+
|
|
143
|
+
document.addEventListener('deviceready', () => {
|
|
144
|
+
const options: IOptions = {
|
|
145
|
+
barcodeFormats: { QRCode: true },
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
cordova.plugins.mlkit.barcodeScanner.scan(
|
|
149
|
+
options,
|
|
150
|
+
(r: IResult) => console.log(r.text, r.format, r.type),
|
|
151
|
+
(e: IError) => console.error(e.message),
|
|
152
|
+
);
|
|
153
|
+
});
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
### Notes
|
|
158
|
+
- Call the API only after `deviceready` (or `$ionicPlatform.ready`).
|
|
159
|
+
- Only one scanner can be open at a time; attempting to open another returns `"Scanner already open."`.
|
|
160
|
+
- Android permissions are added automatically; iOS requires `NSCameraUsageDescription` as shown above.
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
### License
|
|
164
|
+
MIT
|
|
165
|
+
|
|
166
|
+
|
package/package.json
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@habibov77/cordova-plugin-mcc-mlkit-barcode-scanner-fixed",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Google MLKit Vision Barcode Scanner Plugin with 16 KB page size support",
|
|
5
|
+
"cordova": {
|
|
6
|
+
"id": "cordova-plugin-mcc-mlkit-barcode-scanner",
|
|
7
|
+
"platforms": [
|
|
8
|
+
"android",
|
|
9
|
+
"ios"
|
|
10
|
+
]
|
|
11
|
+
},
|
|
12
|
+
"keywords": [
|
|
13
|
+
"ecosystem:cordova",
|
|
14
|
+
"cordova-ios",
|
|
15
|
+
"cordova-android",
|
|
16
|
+
"mlkit",
|
|
17
|
+
"barcode",
|
|
18
|
+
"scanner"
|
|
19
|
+
],
|
|
20
|
+
"author": "MCC",
|
|
21
|
+
"license": "MIT",
|
|
22
|
+
"main": "www/BarcodeScanner.contract.js",
|
|
23
|
+
"engines": {
|
|
24
|
+
"node": ">=10.0.0"
|
|
25
|
+
},
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "npm run clean && npm run transpile",
|
|
28
|
+
"clean": "node -e \"const fs=require('fs'),path=require('path'),p='www';fs.mkdirSync(p,{recursive:true});for(const f of fs.readdirSync(p)){fs.rmSync(path.join(p,f),{recursive:true,force:true});}\"",
|
|
29
|
+
"lint": "eslint . --ext .js,.ts --cache && tsc -p tsconfig.lint.json",
|
|
30
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
31
|
+
"transpile": "npx --yes rollup@2 --config rollup.config.mjs --silent"
|
|
32
|
+
},
|
|
33
|
+
"files": [
|
|
34
|
+
"/src/",
|
|
35
|
+
"/www/**/*.{js,js.map,d.ts}",
|
|
36
|
+
"/plugin.xml"
|
|
37
|
+
],
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@rollup/plugin-commonjs": "20.0.0",
|
|
40
|
+
"@rollup/plugin-node-resolve": "13.0.4",
|
|
41
|
+
"@types/cordova": "0.0.34",
|
|
42
|
+
"@types/node": "16.7.1",
|
|
43
|
+
"rollup": "2.56.3",
|
|
44
|
+
"rollup-plugin-typescript2": "^0.37.0",
|
|
45
|
+
"tslib": "^2.8.1"
|
|
46
|
+
}
|
|
47
|
+
}
|
package/plugin.xml
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
<?xml version='1.0' encoding='utf-8'?>
|
|
2
|
+
<plugin id="cordova-plugin-mcc-mlkit-barcode-scanner"
|
|
3
|
+
version="4.1.1"
|
|
4
|
+
xmlns="http://apache.org/cordova/ns/plugins/1.0"
|
|
5
|
+
xmlns:android="http://schemas.android.com/apk/res/android">
|
|
6
|
+
<name>cordova-plugin-mcc-mlkit-barcode-scanner</name>
|
|
7
|
+
<js-module name="cordova-plugin-mcc-ml-kit-barcode-scanner"
|
|
8
|
+
src="www/BarcodeScanner.plugin.js">
|
|
9
|
+
<clobbers target="cordova.plugins.mlkit.barcodeScanner" />
|
|
10
|
+
</js-module>
|
|
11
|
+
|
|
12
|
+
<engines>
|
|
13
|
+
<engine name="cordova"
|
|
14
|
+
version=">=7.1.0" />
|
|
15
|
+
<engine name="cordova-android"
|
|
16
|
+
version=">=8.0.0" />
|
|
17
|
+
<engine name="cordova-ios"
|
|
18
|
+
version=">=4.5.0" />
|
|
19
|
+
</engines>
|
|
20
|
+
<platform name="ios">
|
|
21
|
+
<config-file parent="/*"
|
|
22
|
+
target="config.xml">
|
|
23
|
+
<feature name="cordova-plugin-mcc-mlkit-barcode-scanner">
|
|
24
|
+
<param name="ios-package"
|
|
25
|
+
value="CDViOSScanner" />
|
|
26
|
+
</feature>
|
|
27
|
+
</config-file>
|
|
28
|
+
<config-file target="*-Info.plist"
|
|
29
|
+
parent="CFBundleDevelopmentRegion">
|
|
30
|
+
<string>de_DE</string>
|
|
31
|
+
</config-file>
|
|
32
|
+
<config-file target="*-Info.plist"
|
|
33
|
+
parent="CFBundleLocalizations">
|
|
34
|
+
<array>
|
|
35
|
+
<string>en</string>
|
|
36
|
+
<string>de</string>
|
|
37
|
+
</array>
|
|
38
|
+
</config-file>
|
|
39
|
+
|
|
40
|
+
<framework src="Foundation.framework" />
|
|
41
|
+
<framework src="AVFoundation.framework" />
|
|
42
|
+
<framework src="UIKit.framework" />
|
|
43
|
+
<podspec>
|
|
44
|
+
<config>
|
|
45
|
+
<source url="https://cdn.cocoapods.org/" />
|
|
46
|
+
</config>
|
|
47
|
+
<pods use-frameworks="true">
|
|
48
|
+
<pod name="GoogleMLKit/BarcodeScanning"
|
|
49
|
+
spec="~> 2.5.0" />
|
|
50
|
+
</pods>
|
|
51
|
+
</podspec>
|
|
52
|
+
<header-file src="src/ios/CDViOSScanner.h" />
|
|
53
|
+
<source-file src="src/ios/CDViOSScanner.m" />
|
|
54
|
+
<header-file src="src/ios/CameraViewController.h" />
|
|
55
|
+
<source-file src="src/ios/CameraViewController.m" />
|
|
56
|
+
<resource-file src="src/ios/Sounds/beep.caf" />
|
|
57
|
+
<resource-file src="src/ios/de.lproj/Localizable.strings"
|
|
58
|
+
target="de.lproj/Localizable.strings" />
|
|
59
|
+
<resource-file src="src/ios/en.lproj/Localizable.strings"
|
|
60
|
+
target="en.lproj/Localizable.strings" />
|
|
61
|
+
</platform>
|
|
62
|
+
<platform name="android">
|
|
63
|
+
<dependency id="cordova-plugin-androidx-adapter"
|
|
64
|
+
version="^1.1.3" />
|
|
65
|
+
|
|
66
|
+
<config-file parent="/*"
|
|
67
|
+
target="res/xml/config.xml">
|
|
68
|
+
<feature name="cordova-plugin-mcc-mlkit-barcode-scanner">
|
|
69
|
+
<param name="android-package"
|
|
70
|
+
value="com.mcc.cordova.plugins.mlkit.barcode.scanner.MLKitBarcodeScanner" />
|
|
71
|
+
</feature>
|
|
72
|
+
</config-file>
|
|
73
|
+
|
|
74
|
+
<config-file parent="/*"
|
|
75
|
+
target="AndroidManifest.xml">
|
|
76
|
+
<uses-permission android:name="android.permission.CAMERA" />
|
|
77
|
+
<uses-permission android:name="android.permission.VIBRATE" />
|
|
78
|
+
<uses-feature android:name="android.hardware.camera"
|
|
79
|
+
android:required="false" />
|
|
80
|
+
</config-file>
|
|
81
|
+
|
|
82
|
+
<config-file parent="application"
|
|
83
|
+
target="AndroidManifest.xml">
|
|
84
|
+
<meta-data android:name="com.google.android.gms.version"
|
|
85
|
+
android:value="@integer/google_play_services_version" />
|
|
86
|
+
<activity android:label="Read Barcode"
|
|
87
|
+
android:name="com.mcc.cordova.plugins.mlkit.barcode.scanner.CaptureActivity"
|
|
88
|
+
android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
|
|
89
|
+
</config-file>
|
|
90
|
+
|
|
91
|
+
<source-file src="src/android/src/CaptureActivity.java"
|
|
92
|
+
target-dir="src/com/mcc/cordova/plugins/mlkit/barcode/scanner" />
|
|
93
|
+
<source-file src="src/android/src/MLKitBarcodeScanner.java"
|
|
94
|
+
target-dir="src/com/mcc/cordova/plugins/mlkit/barcode/scanner" />
|
|
95
|
+
<source-file src="src/android/src/utils/BitmapUtils.java"
|
|
96
|
+
target-dir="src/com/mcc/cordova/plugins/mlkit/barcode/scanner/utils" />
|
|
97
|
+
<source-file src="src/android/src/utils/FrameMetadata.java"
|
|
98
|
+
target-dir="src/com/mcc/cordova/plugins/mlkit/barcode/scanner/utils" />
|
|
99
|
+
|
|
100
|
+
<resource-file src="src/android/res/assets/beep.ogg"
|
|
101
|
+
target="assets/beep.ogg" />
|
|
102
|
+
<resource-file src="src/android/res/values/strings-en.xml"
|
|
103
|
+
target="res/values/strings.xml" />
|
|
104
|
+
<resource-file src="src/android/res/values/strings-de.xml"
|
|
105
|
+
target="res/values-de/strings.xml" />
|
|
106
|
+
<resource-file src="src/android/res/layout/capture_activity.xml"
|
|
107
|
+
target="res/layout/capture_activity.xml" />
|
|
108
|
+
<resource-file src="src/android/res/drawable/flashlight.png"
|
|
109
|
+
target="res/drawable/flashlight.png" />
|
|
110
|
+
<resource-file src="src/android/res/drawable/torch_active.xml"
|
|
111
|
+
target="res/drawable/torch_active.xml" />
|
|
112
|
+
<resource-file src="src/android/res/drawable/torch_inactive.xml"
|
|
113
|
+
target="res/drawable/torch_inactive.xml" />
|
|
114
|
+
|
|
115
|
+
<framework src="com.android.support:support-v4:27.1.0" />
|
|
116
|
+
<framework src="com.android.support:design:27.1.0" />
|
|
117
|
+
|
|
118
|
+
<framework src="com.google.mlkit:barcode-scanning:17.3.0" />
|
|
119
|
+
|
|
120
|
+
<framework src="androidx.camera:camera-core:1.4.2" />
|
|
121
|
+
<framework src="androidx.camera:camera-camera2:1.4.2" />
|
|
122
|
+
<framework src="androidx.camera:camera-lifecycle:1.4.2" />
|
|
123
|
+
<framework src="androidx.camera:camera-view:1.4.2" />
|
|
124
|
+
<framework src="androidx.constraintlayout:constraintlayout:2.1.4" />
|
|
125
|
+
|
|
126
|
+
<framework src="src/android/build-extras.gradle"
|
|
127
|
+
custom="true"
|
|
128
|
+
type="gradleReference" />
|
|
129
|
+
</platform>
|
|
130
|
+
</plugin>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
ext.postBuildExtras = {
|
|
2
|
+
android {
|
|
3
|
+
compileOptions {
|
|
4
|
+
sourceCompatibility JavaVersion.VERSION_1_8
|
|
5
|
+
targetCompatibility JavaVersion.VERSION_1_8
|
|
6
|
+
}
|
|
7
|
+
allprojects {
|
|
8
|
+
compileOptions {
|
|
9
|
+
sourceCompatibility = JavaVersion.VERSION_1_8
|
|
10
|
+
targetCompatibility = JavaVersion.VERSION_1_8
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
|
|
3
|
+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
|
|
4
|
+
<item>
|
|
5
|
+
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval">
|
|
6
|
+
<solid android:color="#FFFFFF" />
|
|
7
|
+
</shape>
|
|
8
|
+
</item>
|
|
9
|
+
<item android:drawable="@drawable/flashlight" android:bottom="10dp" android:top="10dp" android:left="10dp" android:right="10dp" >
|
|
10
|
+
|
|
11
|
+
</item>
|
|
12
|
+
</layer-list>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
|
|
3
|
+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
|
|
4
|
+
<item>
|
|
5
|
+
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval">
|
|
6
|
+
<solid android:color="#40FFFFFF" />
|
|
7
|
+
</shape>
|
|
8
|
+
</item>
|
|
9
|
+
<item android:drawable="@drawable/flashlight" android:bottom="10dp" android:top="10dp" android:left="10dp" android:right="10dp" >
|
|
10
|
+
|
|
11
|
+
</item>
|
|
12
|
+
</layer-list>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
3
|
+
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
4
|
+
xmlns:tools="http://schemas.android.com/tools"
|
|
5
|
+
android:id="@+id/topLayout"
|
|
6
|
+
android:layout_width="match_parent"
|
|
7
|
+
android:layout_height="match_parent">
|
|
8
|
+
|
|
9
|
+
<SurfaceView
|
|
10
|
+
android:id="@+id/overlay"
|
|
11
|
+
android:layout_width="0dp"
|
|
12
|
+
android:layout_height="0dp"
|
|
13
|
+
app:layout_constraintBottom_toBottomOf="parent"
|
|
14
|
+
app:layout_constraintEnd_toEndOf="parent"
|
|
15
|
+
app:layout_constraintStart_toStartOf="parent"
|
|
16
|
+
app:layout_constraintTop_toTopOf="parent" />
|
|
17
|
+
|
|
18
|
+
<androidx.camera.view.PreviewView
|
|
19
|
+
android:id="@+id/previewView"
|
|
20
|
+
android:layout_width="0dp"
|
|
21
|
+
android:layout_height="0dp"
|
|
22
|
+
app:layout_constraintBottom_toBottomOf="parent"
|
|
23
|
+
app:layout_constraintEnd_toEndOf="parent"
|
|
24
|
+
app:layout_constraintHorizontal_bias="0.0"
|
|
25
|
+
app:layout_constraintStart_toStartOf="parent"
|
|
26
|
+
app:layout_constraintTop_toTopOf="@+id/overlay"
|
|
27
|
+
app:layout_constraintVertical_bias="0.0">
|
|
28
|
+
|
|
29
|
+
</androidx.camera.view.PreviewView>
|
|
30
|
+
|
|
31
|
+
<!--<ImageView
|
|
32
|
+
android:id="@+id/imageView"
|
|
33
|
+
android:layout_width="wrap_content"
|
|
34
|
+
android:layout_height="wrap_content"
|
|
35
|
+
app:layout_constraintBottom_toBottomOf="parent"
|
|
36
|
+
app:layout_constraintEnd_toEndOf="parent"
|
|
37
|
+
app:layout_constraintStart_toStartOf="parent"
|
|
38
|
+
app:layout_constraintVertical_bias="0.0"
|
|
39
|
+
app:layout_constraintTop_toTopOf="@+id/overlay" />-->
|
|
40
|
+
|
|
41
|
+
<ImageButton
|
|
42
|
+
android:id="@+id/torch_button"
|
|
43
|
+
android:layout_width="50dp"
|
|
44
|
+
android:layout_height="50dp"
|
|
45
|
+
app:layout_constraintBottom_toBottomOf="parent"
|
|
46
|
+
app:layout_constraintEnd_toEndOf="parent"
|
|
47
|
+
android:layout_margin="20dp"
|
|
48
|
+
android:background="@drawable/torch_inactive"
|
|
49
|
+
/>
|
|
50
|
+
|
|
51
|
+
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<?xml version='1.0' encoding='utf-8'?>
|
|
2
|
+
<resources>
|
|
3
|
+
<string name="ok">OK</string>
|
|
4
|
+
<string name="permission_camera_rationale">Zur Erfassung wird Zugriff auf die Kamera benötigt</string>
|
|
5
|
+
<string name="no_camera_permission">Die App kann nicht ausgeführt werden, weil sie keinen Zugriff auf die Kamera hat. Die App wird geschlossen.</string>
|
|
6
|
+
<string name="no_cameras_found">Das Gerät verfügt über keine Kamera.</string>
|
|
7
|
+
<string name="barcode_header">Wählen Sie "Barcode lesen" aus, um einen Barcode zu lesen</string>
|
|
8
|
+
<string name="read_barcode">Barcode lesen</string>
|
|
9
|
+
<string name="auto_focus">Auto-Fokus</string>
|
|
10
|
+
<string name="use_flash">Blitz verwenden</string>
|
|
11
|
+
<string name="barcode_success">Barcode erfolgreich gelesen</string>
|
|
12
|
+
<string name="barcode_failure">Kein Barcode erfasst</string>
|
|
13
|
+
<string name="barcode_error">"Fehler beim Lesen von Barcode: %1$s"</string>
|
|
14
|
+
</resources>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<?xml version='1.0' encoding='utf-8'?>
|
|
2
|
+
<resources>
|
|
3
|
+
<string name="ok">OK</string>
|
|
4
|
+
<string name="permission_camera_rationale">For detection, access to camera is needed</string>
|
|
5
|
+
<string name="no_camera_permission">This application cannot run because it does not have permission to the camera. The application will close.</string>
|
|
6
|
+
<string name="no_cameras_found">The device has no camera.</string>
|
|
7
|
+
<string name="barcode_header">Click "Read Barcode" to read a barcode</string>
|
|
8
|
+
<string name="read_barcode">Read Barcode</string>
|
|
9
|
+
<string name="auto_focus">Auto Focus</string>
|
|
10
|
+
<string name="use_flash">Use Flash</string>
|
|
11
|
+
<string name="barcode_success">Barcode read successfully</string>
|
|
12
|
+
<string name="barcode_failure">No barcode captured</string>
|
|
13
|
+
<string name="barcode_error">"Error reading barcode: %1$s"</string>
|
|
14
|
+
</resources>
|