nativescript-barcodescanner
Advanced tools
Comparing version 2.4.1 to 2.5.0
"use strict"; | ||
var appModule = require("application"); | ||
var camera = require("camera"); | ||
var utils = require("utils/utils"); | ||
@@ -45,3 +44,3 @@ var SCANNER_REQUEST_CODE = 444; | ||
try { | ||
resolve(camera.isAvailable()); | ||
resolve(utils.ad.getApplicationContext().getPackageManager().hasSystemFeature(android.content.pm.PackageManager.FEATURE_CAMERA)); | ||
} | ||
@@ -54,3 +53,2 @@ catch (ex) { | ||
}; | ||
; | ||
BarcodeScanner.prototype.hasCameraPermission = function () { | ||
@@ -63,3 +61,2 @@ var self = this; | ||
}; | ||
; | ||
BarcodeScanner.prototype.requestCameraPermission = function () { | ||
@@ -77,3 +74,2 @@ var self = this; | ||
}; | ||
; | ||
BarcodeScanner.prototype.stop = function () { | ||
@@ -100,3 +96,2 @@ var self = this; | ||
}; | ||
; | ||
BarcodeScanner.prototype.scan = function (arg) { | ||
@@ -203,5 +198,4 @@ var self = this; | ||
}; | ||
; | ||
return BarcodeScanner; | ||
}()); | ||
exports.BarcodeScanner = BarcodeScanner; |
@@ -13,2 +13,3 @@ export interface CommonScanOptions { | ||
cancelLabel?: string; | ||
cancelLabelBackgroundColor?: string; | ||
openSettingsIfPermissionWasPreviouslyDenied?: boolean; | ||
@@ -15,0 +16,0 @@ } |
@@ -56,3 +56,2 @@ "use strict"; | ||
}; | ||
; | ||
BarcodeScanner.prototype.hasCameraPermission = function () { | ||
@@ -64,3 +63,2 @@ var self = this; | ||
}; | ||
; | ||
BarcodeScanner.prototype.requestCameraPermission = function () { | ||
@@ -72,3 +70,2 @@ return new Promise(function (resolve) { | ||
}; | ||
; | ||
BarcodeScanner.prototype.stop = function () { | ||
@@ -88,3 +85,2 @@ var self = this; | ||
}; | ||
; | ||
BarcodeScanner.prototype.scan = function (arg) { | ||
@@ -146,3 +142,3 @@ var _this = this; | ||
var startScanningAtLoad = true; | ||
self._scanner = QRCodeReaderViewController.readerWithCancelButtonTitleCodeReaderStartScanningAtLoadShowSwitchCameraButtonShowTorchButton(closeButtonLabel, reader, startScanningAtLoad, flip, torch); | ||
self._scanner = QRCodeReaderViewController.readerWithCancelButtonTitleCodeReaderStartScanningAtLoadShowSwitchCameraButtonShowTorchButtonCancelButtonBackgroundColor(closeButtonLabel, reader, startScanningAtLoad, flip, torch, arg.cancelLabelBackgroundColor); | ||
self._scanner.modalPresentationStyle = 2; | ||
@@ -200,3 +196,2 @@ var delegate_1 = QRCodeReaderDelegateImpl.new().initWithCallback(arg.beepOnScan, isContinuous_1, arg.reportDuplicates, function (reader, text, format) { | ||
}; | ||
; | ||
return BarcodeScanner; | ||
@@ -208,3 +203,3 @@ }()); | ||
function QRCodeReaderDelegateImpl() { | ||
_super.apply(this, arguments); | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
@@ -233,3 +228,2 @@ QRCodeReaderDelegateImpl.new = function () { | ||
}; | ||
; | ||
QRCodeReaderDelegateImpl.prototype.readerDidScanResultForType = function (reader, text, type) { | ||
@@ -254,10 +248,9 @@ if (this._isContinuous) { | ||
}; | ||
; | ||
QRCodeReaderDelegateImpl.ObjCProtocols = [QRCodeReaderDelegate]; | ||
return QRCodeReaderDelegateImpl; | ||
}(NSObject)); | ||
QRCodeReaderDelegateImpl.ObjCProtocols = [QRCodeReaderDelegate]; | ||
var VolumeObserverClass = (function (_super) { | ||
__extends(VolumeObserverClass, _super); | ||
function VolumeObserverClass() { | ||
_super.apply(this, arguments); | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
@@ -264,0 +257,0 @@ VolumeObserverClass.prototype.observeValueForKeyPathOfObjectChangeContext = function (path, obj, change, context) { |
# Change Log | ||
## [2.5.0](https://github.com/EddyVerbruggen/nativescript-barcodescanner/tree/2.5.0) (2017-04-12) | ||
[Full Changelog](https://github.com/EddyVerbruggen/nativescript-barcodescanner/compare/2.4.2...2.5.0) | ||
**Implemented enhancements:** | ||
- nativescript-barcodescanner in NS 3.0 RC [\#80](https://github.com/EddyVerbruggen/nativescript-barcodescanner/issues/80) | ||
- Add the option to change the iOS cancel label background color [\#81](https://github.com/EddyVerbruggen/nativescript-barcodescanner/issues/81) | ||
## [2.4.2](https://github.com/EddyVerbruggen/nativescript-barcodescanner/tree/2.4.2) (2017-03-27) | ||
[Full Changelog](https://github.com/EddyVerbruggen/nativescript-barcodescanner/compare/2.4.1...2.4.2) | ||
**Implemented enhancements:** | ||
- Some Samsung devices have problems reading barcodes [\#79](https://github.com/EddyVerbruggen/nativescript-barcodescanner/issues/79) | ||
## [2.4.1](https://github.com/EddyVerbruggen/nativescript-barcodescanner/tree/2.4.1) (2017-03-25) | ||
@@ -4,0 +21,0 @@ [Full Changelog](https://github.com/EddyVerbruggen/nativescript-barcodescanner/compare/2.4.0...2.4.1) |
{ | ||
"name": "nativescript-barcodescanner", | ||
"version": "2.4.1", | ||
"version": "2.5.0", | ||
"description": "Scan QR/barcodes with a {N} app.", | ||
@@ -18,3 +18,7 @@ "main": "barcodescanner", | ||
"preparedemo": "npm run build && cd demo && tns plugin remove nativescript-barcodescanner && tns plugin add .. && tns install", | ||
"setup": "npm i && cd demo && npm i && cd .. && npm run build && cd demo && tns plugin add .. && cd .." | ||
"prepublish": "npm run build && npm run tslint", | ||
"setup": "npm i && cd demo && npm i && cd .. && npm run build && cd demo && tns plugin add .. && cd ..", | ||
"test": "npm run tslint && npm run tslint.demo && cd demo && tns build ios && tns build android", | ||
"tslint": "tslint *.ts", | ||
"tslint.demo": "tslint demo/app/*.ts" | ||
}, | ||
@@ -61,7 +65,7 @@ "repository": { | ||
"devDependencies": { | ||
"nativescript-dev-typescript": "^0.3.2", | ||
"tns-core-modules": "^2.3.0", | ||
"tns-platform-declarations": "^2.3.0", | ||
"typescript": "~2.0.10" | ||
"tns-core-modules": "^2.5.1", | ||
"tns-platform-declarations": "^2.5.0", | ||
"typescript": "~2.1.0", | ||
"tslint": "^5.0.0" | ||
} | ||
} |
# NativeScript BarcodeScanner | ||
[![Build Status][build-status]][build-url] | ||
[![NPM version][npm-image]][npm-url] | ||
[![Downloads][downloads-image]][npm-url] | ||
[![Twitter Follow][twitter-image]][twitter-url] | ||
[build-status]:https://travis-ci.org/EddyVerbruggen/nativescript-barcodescanner.svg?branch=master | ||
[build-url]:https://travis-ci.org/EddyVerbruggen/nativescript-barcodescanner | ||
[npm-image]:http://img.shields.io/npm/v/nativescript-barcodescanner.svg | ||
[npm-url]:https://npmjs.org/package/nativescript-barcodescanner | ||
[downloads-image]:http://img.shields.io/npm/dm/nativescript-barcodescanner.svg | ||
[twitter-image]:https://img.shields.io/twitter/follow/eddyverbruggen.svg?style=social&label=Follow%20me | ||
[twitter-url]:https://twitter.com/eddyverbruggen | ||
#### Want a quick demo? | ||
@@ -69,2 +82,3 @@ * git clone https://github.com/EddyVerbruggen/nativescript-barcodescanner barcodedemo | ||
cancelLabel: "EXIT. Also, try the volume buttons!", // iOS only, default 'Close' | ||
cancelLabelBackgroundColor: "#333333", // iOS only, default '#000000' (black) | ||
message: "Use the volume buttons for extra light", // Android only, default is 'Place a barcode inside the viewfinder rectangle to scan it.' | ||
@@ -100,2 +114,3 @@ showFlipCameraButton: true, // default false | ||
cancelLabel: "EXIT. Also, try the volume buttons!", // iOS only, default 'Close' | ||
cancelLabelBackgroundColor: "#333333", // iOS only, default '#000000' (black) | ||
message: "Use the volume buttons for extra light", // Android only, default is 'Place a barcode inside the viewfinder rectangle to scan it.' | ||
@@ -102,0 +117,0 @@ showFlipCameraButton: true, // default false |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1678384
30
616
248