Merge pull request #936 from yemel/feature/android-cordova

Android - Migration to Cordova + Crosswalk Framework
This commit is contained in:
Matias Alejo Garcia 2014-07-25 16:40:13 -03:00
commit 560702df58
51 changed files with 4706 additions and 12 deletions

View file

@ -32,6 +32,7 @@ angular.module('copayApp.controllers').controller('SendController',
// Detect protocol
$scope.isHttp = ($window.location.protocol.indexOf('http') === 0);
$scope.isCordova = typeof(window.cordova) != 'undefined';
navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia;
window.URL = window.URL || window.webkitURL || window.mozURL || window.msURL;
@ -194,6 +195,25 @@ angular.module('copayApp.controllers').controller('SendController',
}, 500);
};
$scope.scannerIntent = function() {
cordova.plugins.barcodeScanner.scan(
function onSuccess(result) {
if (result.cancelled) return;
var bip21 = copay.Structure.parseBitcoinURI(result.text);
$scope.address = bip21.address;
if (bip21.amount) {
$scope.amount = bip21.amount * bitcore.util.COIN * satToUnit;
}
$rootScope.$digest();
},
function onError(error) {
alert('Scanning error');
});
}
$scope.toggleAddressBookEntry = function(key) {
var w = $rootScope.wallet;
w.toggleAddressBookEntry(key);