diff --git a/src/js/controllers/tab-receive.js b/src/js/controllers/tab-receive.js index c51b4133d..4a56d565b 100644 --- a/src/js/controllers/tab-receive.js +++ b/src/js/controllers/tab-receive.js @@ -98,6 +98,8 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi var selectedWallet = checkSelectedWallet($scope.wallet, $scope.wallets); $scope.onWalletSelect(selectedWallet); + $scope.showShareButton = platformInfo.isCordova ? (platformInfo.isIOS ? 'iOS' : 'Android') : null; + listeners = [ $rootScope.$on('bwsEvent', function(e, walletId, type, n) { // Update current address @@ -132,8 +134,8 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi $scope.showWallets = true; }; - $scope.copyToClipboard = function() { - if ($scope.isCordova) return 'bitcoin:' + $scope.addr; - else return $scope.addr; + $scope.shareAddress = function() { + if (!$scope.isCordova) return; + window.plugins.socialsharing.share('bitcoin:' + $scope.addr, null, null, null); } }); diff --git a/src/js/directives/copyToClipboard.js b/src/js/directives/copyToClipboard.js index a06b2743d..5de40f23e 100644 --- a/src/js/directives/copyToClipboard.js +++ b/src/js/directives/copyToClipboard.js @@ -21,18 +21,18 @@ angular.module('copayApp.directives') if (!data) return; if (isCordova) { - window.plugins.socialsharing.share(data, null, null, null); + cordova.plugins.clipboard.copy(data); } else if (isNW) { nodeWebkitService.writeToClipboard(data); - scope.$apply(function() { - ionicToast.show(msg, 'bottom', false, 1000); - }); } else if (clipboard.supported) { clipboard.copyText(data); - scope.$apply(function() { - ionicToast.show(msg, 'bottom', false, 1000); - }); + } else { + // No supported + return; } + scope.$apply(function() { + ionicToast.show(msg, 'bottom', false, 1000); + }); }); } } diff --git a/src/sass/views/tab-receive.scss b/src/sass/views/tab-receive.scss index f573744ee..4757e3cc2 100644 --- a/src/sass/views/tab-receive.scss +++ b/src/sass/views/tab-receive.scss @@ -1,5 +1,26 @@ #tab-receive { @extend .deflash-blue; + .button-share { + color: #fff; + box-shadow: none; + border-color: transparent; + background: transparent; + padding: 0 10px; + .icon:before { + font-size: 26px; + } + } + .button-request { + margin-top: 15px; + background: transparent; + border: none; + font-size: 12px; + color: $v-text-accent-color; + i.icon { + vertical-align: middle; + padding-left: 5px; + } + } .address { background: #fff; overflow: auto; @@ -21,9 +42,6 @@ margin-top: 5%; font-size: 13px; } - .request-button { - padding-top: 20px; - } } .incomplete { .title { diff --git a/www/views/tab-receive.html b/www/views/tab-receive.html index 3612ec51c..3da92d152 100644 --- a/www/views/tab-receive.html +++ b/www/views/tab-receive.html @@ -1,6 +1,15 @@ {{'Receive' | translate}} + + +
@@ -19,7 +28,7 @@
-
+
-
- -
+