From 4d3ff6c2f0dadca7ef1e18b2d8a9ba9cfe0a8a7c Mon Sep 17 00:00:00 2001 From: Andy Phillipson Date: Fri, 9 Dec 2016 16:42:11 -0500 Subject: [PATCH 01/17] Initial implementation for balance modal. --- src/js/controllers/modals/walletBalance.js | 24 ++++++ src/js/controllers/walletDetails.js | 17 +++- src/js/services/walletService.js | 17 ++-- src/sass/views/views.scss | 1 + src/sass/views/walletBalance.scss | 94 ++++++++++++++++++++++ src/sass/views/walletDetails.scss | 15 +++- www/img/icon-sigma.svg | 15 ++++ www/views/modals/wallet-balance.html | 91 +++++++++++++++++++++ www/views/walletDetails.html | 33 ++++---- 9 files changed, 273 insertions(+), 34 deletions(-) create mode 100644 src/js/controllers/modals/walletBalance.js create mode 100644 src/sass/views/walletBalance.scss create mode 100644 www/img/icon-sigma.svg create mode 100644 www/views/modals/wallet-balance.html diff --git a/src/js/controllers/modals/walletBalance.js b/src/js/controllers/modals/walletBalance.js new file mode 100644 index 000000000..55fdef7f6 --- /dev/null +++ b/src/js/controllers/modals/walletBalance.js @@ -0,0 +1,24 @@ +'use strict'; + +angular.module('copayApp.controllers').controller('walletBalanceController', function($scope, $timeout, $ionicHistory, gettextCatalog, configService, feeService, ongoingProcess, popupService) { + + ongoingProcess.set('gettingFeeLevels', true); + feeService.getFeeLevels(function(err, levels) { + ongoingProcess.set('gettingFeeLevels', false); + if (err) { + popupService.showAlert(gettextCatalog.getString('Error'), err); + return; + } + $scope.feeLevels = levels; + $scope.$apply(); + }); + + $scope.close = function() { + $scope.walletBalanceModal.hide(); + }; + + $scope.$on("$ionicView.enter", function(event, data) { + $scope.feeOpts = feeService.feeOpts; + $scope.currentFeeLevel = feeService.getCurrentFeeLevel(); + }); +}); diff --git a/src/js/controllers/walletDetails.js b/src/js/controllers/walletDetails.js index d7d90ea83..aa905eed1 100644 --- a/src/js/controllers/walletDetails.js +++ b/src/js/controllers/walletDetails.js @@ -107,6 +107,15 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun }); }; + $scope.openBalanceModal = function() { + $ionicModal.fromTemplateUrl('views/modals/wallet-balance.html', { + scope: $scope + }).then(function(modal) { + $scope.walletBalanceModal = modal; + $scope.walletBalanceModal.show(); + }); + }; + $scope.recreate = function() { walletService.recreate($scope.wallet, function(err) { if (err) return; @@ -252,16 +261,16 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun return; } prevPos = pos; - var amountHeight = 180 - pos; + var amountHeight = 210 - pos; if (amountHeight < 80) { amountHeight = 80; } var contentMargin = amountHeight; - if (contentMargin > 180) { - contentMargin = 180; + if (contentMargin > 210) { + contentMargin = 210; } - var amountScale = (amountHeight / 180); + var amountScale = (amountHeight / 210); if (amountScale < 0.5) { amountScale = 0.5; } diff --git a/src/js/services/walletService.js b/src/js/services/walletService.js index d7c7519f9..a03dd3873 100644 --- a/src/js/services/walletService.js +++ b/src/js/services/walletService.js @@ -166,13 +166,15 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim cache.lockedBalanceSat = balance.lockedAmount; cache.availableBalanceSat = balance.availableAmount; cache.totalBytesToSendMax = balance.totalBytesToSendMax; - cache.pendingAmount = null; + cache.pendingAmount = 0; + cache.spendableAmount = balance.totalAmount - balance.lockedAmount; } else { cache.totalBalanceSat = balance.totalConfirmedAmount; cache.lockedBalanceSat = balance.lockedConfirmedAmount; cache.availableBalanceSat = balance.availableConfirmedAmount; cache.totalBytesToSendMax = balance.totalBytesToSendConfirmedMax; cache.pendingAmount = balance.totalAmount - balance.totalConfirmedAmount; + cache.spendableAmount = balance.totalConfirmedAmount - balance.lockedAmount; } // Selected unit @@ -184,13 +186,8 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim cache.totalBalanceStr = txFormatService.formatAmount(cache.totalBalanceSat) + ' ' + cache.unitName; cache.lockedBalanceStr = txFormatService.formatAmount(cache.lockedBalanceSat) + ' ' + cache.unitName; cache.availableBalanceStr = txFormatService.formatAmount(cache.availableBalanceSat) + ' ' + cache.unitName; - cache.pendingBalanceStr = txFormatService.formatAmount(cache.totalBalanceSat + (cache.pendingAmount === null ? 0 : cache.pendingAmount)) + ' ' + cache.unitName; - - if (cache.pendingAmount !== null && cache.pendingAmount !== 0) { - cache.pendingAmountStr = txFormatService.formatAmount(cache.pendingAmount) + ' ' + cache.unitName; - } else { - cache.pendingAmountStr = null; - } + cache.spendableBalanceStr = txFormatService.formatAmount(cache.spendableAmount) + ' ' + cache.unitName; + cache.pendingBalanceStr = txFormatService.formatAmount(cache.pendingAmount) + ' ' + cache.unitName; cache.alternativeName = config.settings.alternativeName; cache.alternativeIsoCode = config.settings.alternativeIsoCode; @@ -209,11 +206,15 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim rateService.whenAvailable(function() { var totalBalanceAlternative = rateService.toFiat(cache.totalBalanceSat, cache.alternativeIsoCode); + var pendingBalanceAlternative = rateService.toFiat(cache.pendingAmount, cache.alternativeIsoCode); var lockedBalanceAlternative = rateService.toFiat(cache.lockedBalanceSat, cache.alternativeIsoCode); + var spendableBalanceAlternative = rateService.toFiat(cache.spendableAmount, cache.alternativeIsoCode); var alternativeConversionRate = rateService.toFiat(100000000, cache.alternativeIsoCode); cache.totalBalanceAlternative = $filter('formatFiatAmount')(totalBalanceAlternative); + cache.pendingBalanceAlternative = $filter('formatFiatAmount')(pendingBalanceAlternative); cache.lockedBalanceAlternative = $filter('formatFiatAmount')(lockedBalanceAlternative); + cache.spendableBalanceAlternative = $filter('formatFiatAmount')(spendableBalanceAlternative); cache.alternativeConversionRate = $filter('formatFiatAmount')(alternativeConversionRate); cache.alternativeBalanceAvailable = true; diff --git a/src/sass/views/views.scss b/src/sass/views/views.scss index 1e88f8af0..8e241aba7 100644 --- a/src/sass/views/views.scss +++ b/src/sass/views/views.scss @@ -9,6 +9,7 @@ @import "tab-scan"; @import "tab-send"; @import "tab-settings"; +@import "walletBalance"; @import "walletDetails"; @import "advancedSettings"; @import "bitpayCard"; diff --git a/src/sass/views/walletBalance.scss b/src/sass/views/walletBalance.scss new file mode 100644 index 000000000..f9502c750 --- /dev/null +++ b/src/sass/views/walletBalance.scss @@ -0,0 +1,94 @@ +.wallet-balance { + + &__amount { + + font-size: 16px; + + &--available { + color: $mid-gray; + font-weight: bold; + } + + &--confirming { + color: #09C286; + } + + &--locked { + color: $dark-gray; + } + + } + + &__title { + flex-grow: 1; + color: $dark-gray; + overflow: hidden; + } + + &__icon { + float: left; + margin-right: 1rem; + color: $light-gray; + font-size: 24px; + } + + &__list { + background: #f5f5f5; + } + + .item { + display: flex; + align-items: center; + background: #fff; + padding-left: 1rem; + } + + &__item { + display: flex; + align-items: center; + background: #fff; + padding: 0; + margin: 0; + border: 0; + padding-left: 1rem; + } + + &__content { + display: flex; + align-items: center; + flex-grow: 1; + padding: 0.6rem 0; + padding-right: 1rem; + border-bottom: 1px solid rgb(245, 245, 245); + overflow: hidden; + + &.no-border { + border: 0; + } + } + + &__amount { + white-space: nowrap; + } + + &__heading { + font-size: 17px; + color: #445; + margin: 1rem 1rem 0 1rem; + } + + &__description { + font-size: 15px; + color: #667; + margin: 1rem; + } + +} + +#wallet-balance { + + ion-content { + background: #F5F5F5; + } + +} diff --git a/src/sass/views/walletDetails.scss b/src/sass/views/walletDetails.scss index f6220c524..83a980538 100644 --- a/src/sass/views/walletDetails.scss +++ b/src/sass/views/walletDetails.scss @@ -168,9 +168,9 @@ width: 100%; text-align: center; color: #fff; - height: 180px; + height: 210px; padding-top: 40px; - display: flex; + display: block; align-items: center; justify-content: center; @@ -195,6 +195,15 @@ strong { line-height: 100%; } + + &__top { + margin-top: 45px; + } + + &__button-balance { + background-color: transparent; + border: 1px solid rgba(255,255,255,0.25); + } } .item.item-footer { font-weight: lighter; @@ -214,7 +223,7 @@ position: absolute; top: inherit; left: 10px; - bottom: 15px; + bottom: 5px; font-size: 20px; color: #fff; } diff --git a/www/img/icon-sigma.svg b/www/img/icon-sigma.svg new file mode 100644 index 000000000..0baf24a13 --- /dev/null +++ b/www/img/icon-sigma.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + diff --git a/www/views/modals/wallet-balance.html b/www/views/modals/wallet-balance.html new file mode 100644 index 000000000..04633ef3c --- /dev/null +++ b/www/views/modals/wallet-balance.html @@ -0,0 +1,91 @@ + + + +
+ Balance +
+
+ + +
All of your bitcoin wallet balance may not be available for immediate spending.
+ +
+ +
Total is the total amount of bitcoin stored in this wallet. It is the sum of Available, Confirming, and Locked balances.
+
+ +
+
Total
+ + + {{status.totalBalanceStr}} + +
+ + {{status.totalBalanceAlternative}} {{status.alternativeIsoCode}} + +
+
+
+
+ +
Available is the immediatley spendable amount of bitcoin stored in this wallet. It is the Total less Confirming and Locked balances. If you have enabled Use Unconfirmed Funds setting then the Available amount is the Total less Locked balance.
+
+ +
+
Available
+ + + {{status.spendableBalanceStr}} + +
+ + {{status.spendableBalanceAlternative}} {{status.alternativeIsoCode}} + +
+
+
+
+ +
Confirming is the amount of bitcoin stored in this wallet with fewer than 3 block chain confirmations.
+
+ +
+
Confirming
+ + + {{status.pendingBalanceStr}} + +
+ + {{status.pendingBalanceAlternative}} {{status.alternativeIsoCode}} + +
+
+
+
+ +
Locked is the amount of bitcoin stored in this wallet that is allocated as inputs to pending transaction proposals. This amount is determined using unspent transaction outputs associated with the wallet and may be more than the actual amounts associated with your pending transaction proposals.
+
+ +
+
Locked
+ + + {{status.lockedBalanceStr}} + +
+ + {{status.lockedBalanceAlternative}} {{status.alternativeIsoCode}} + +
+
+
+
+ +
+ +
+
diff --git a/www/views/walletDetails.html b/www/views/walletDetails.html index feed55b79..dd66b7d0c 100644 --- a/www/views/walletDetails.html +++ b/www/views/walletDetails.html @@ -46,22 +46,16 @@ on-hold="hideToggle()" ng-style="{'transform': amountScale}" class="amount__balance" - > - {{status.totalBalanceStr}} + ng-class="{amount__top: status.totalBalanceSat == status.spendableAmount}"> + {{status.totalBalanceStr}}
{{status.totalBalanceAlternative}} {{status.alternativeIsoCode}}
-
-
Available: {{status.totalBalanceStr}}
-
Confirming: {{status.pendingAmountStr}}
-
-
+
+ +
@@ -78,7 +84,6 @@
-
@@ -113,16 +118,6 @@ This wallet is not registered at the given Bitcore Wallet Service (BWS). You can recreate it from the local information. Recreate - -
- {{status.totalBalanceStr}} -
{{status.totalBalanceAlternative}} {{status.alternativeIsoCode}}
-
-
Available: {{status.totalBalanceStr}}
-
Confirming: {{status.pendingAmountStr}}
-
-
-
[Balance Hidden]
From 7851188979396905ff20648b5664b38b32794ff0 Mon Sep 17 00:00:00 2001 From: Andy Phillipson Date: Mon, 12 Dec 2016 09:49:21 -0500 Subject: [PATCH 02/17] Code cleanup. --- src/js/controllers/modals/walletBalance.js | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/src/js/controllers/modals/walletBalance.js b/src/js/controllers/modals/walletBalance.js index 55fdef7f6..37d38d5ce 100644 --- a/src/js/controllers/modals/walletBalance.js +++ b/src/js/controllers/modals/walletBalance.js @@ -1,24 +1,9 @@ 'use strict'; -angular.module('copayApp.controllers').controller('walletBalanceController', function($scope, $timeout, $ionicHistory, gettextCatalog, configService, feeService, ongoingProcess, popupService) { - - ongoingProcess.set('gettingFeeLevels', true); - feeService.getFeeLevels(function(err, levels) { - ongoingProcess.set('gettingFeeLevels', false); - if (err) { - popupService.showAlert(gettextCatalog.getString('Error'), err); - return; - } - $scope.feeLevels = levels; - $scope.$apply(); - }); +angular.module('copayApp.controllers').controller('walletBalanceController', function($scope) { $scope.close = function() { $scope.walletBalanceModal.hide(); }; - $scope.$on("$ionicView.enter", function(event, data) { - $scope.feeOpts = feeService.feeOpts; - $scope.currentFeeLevel = feeService.getCurrentFeeLevel(); - }); }); From cd3677b57cee64ecc1b941160c93f1d68d6e765d Mon Sep 17 00:00:00 2001 From: Andy Phillipson Date: Mon, 12 Dec 2016 10:48:43 -0500 Subject: [PATCH 03/17] Fixes balance display on home tab (displays total). Adds (!) icon next to balance on home tab when total is not equal to available balance. --- src/sass/views/tab-home.scss | 6 ++++++ www/img/icon-important.svg | 11 +++++++++++ www/views/modals/wallet-balance.html | 8 -------- www/views/tab-home.html | 3 ++- 4 files changed, 19 insertions(+), 9 deletions(-) create mode 100644 www/img/icon-important.svg diff --git a/src/sass/views/tab-home.scss b/src/sass/views/tab-home.scss index 80ed81634..43c613bd9 100644 --- a/src/sass/views/tab-home.scss +++ b/src/sass/views/tab-home.scss @@ -111,6 +111,12 @@ font-weight: 300; color: $light-gray; } + &__icon { + width: 20px; + position: relative; + top: 4px; + color: $light-gray; + } } } .release { diff --git a/www/img/icon-important.svg b/www/img/icon-important.svg new file mode 100644 index 000000000..4f113aaf2 --- /dev/null +++ b/www/img/icon-important.svg @@ -0,0 +1,11 @@ + + + + + + diff --git a/www/views/modals/wallet-balance.html b/www/views/modals/wallet-balance.html index 04633ef3c..8d147df97 100644 --- a/www/views/modals/wallet-balance.html +++ b/www/views/modals/wallet-balance.html @@ -7,12 +7,9 @@ Balance
-
All of your bitcoin wallet balance may not be available for immediate spending.
-
-
Total is the total amount of bitcoin stored in this wallet. It is the sum of Available, Confirming, and Locked balances.
@@ -30,7 +27,6 @@
-
Available is the immediatley spendable amount of bitcoin stored in this wallet. It is the Total less Confirming and Locked balances. If you have enabled Use Unconfirmed Funds setting then the Available amount is the Total less Locked balance.
@@ -48,7 +44,6 @@
-
Confirming is the amount of bitcoin stored in this wallet with fewer than 3 block chain confirmations.
@@ -66,7 +61,6 @@
-
Locked is the amount of bitcoin stored in this wallet that is allocated as inputs to pending transaction proposals. This amount is determined using unspent transaction outputs associated with the wallet and may be more than the actual amounts associated with your pending transaction proposals.
@@ -84,8 +78,6 @@
- - diff --git a/www/views/tab-home.html b/www/views/tab-home.html index c91668670..4d87b3efb 100644 --- a/www/views/tab-home.html +++ b/www/views/tab-home.html @@ -80,7 +80,8 @@ Incomplete - {{wallet.status.pendingBalanceStr}} + {{wallet.status.totalBalanceStr}} + [Balance Hidden] {{wallet.m}}-of-{{wallet.n}} From 3a85aed05df34eec004c7f54ad4a9542fefbe2e5 Mon Sep 17 00:00:00 2001 From: Andy Phillipson Date: Mon, 12 Dec 2016 10:51:40 -0500 Subject: [PATCH 04/17] Fix logic for balance warning icon (was set for debug). --- www/views/tab-home.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/views/tab-home.html b/www/views/tab-home.html index 4d87b3efb..e7dc6d0bc 100644 --- a/www/views/tab-home.html +++ b/www/views/tab-home.html @@ -81,7 +81,7 @@ {{wallet.status.totalBalanceStr}} - + [Balance Hidden] {{wallet.m}}-of-{{wallet.n}} From 0e5e4275903135764c5610a884b6fd96c3f9c3c7 Mon Sep 17 00:00:00 2001 From: Andy Phillipson Date: Mon, 12 Dec 2016 10:55:38 -0500 Subject: [PATCH 05/17] Update icon size and position. --- src/sass/views/tab-home.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sass/views/tab-home.scss b/src/sass/views/tab-home.scss index 43c613bd9..fa6356347 100644 --- a/src/sass/views/tab-home.scss +++ b/src/sass/views/tab-home.scss @@ -112,9 +112,9 @@ color: $light-gray; } &__icon { - width: 20px; + width: 15px; position: relative; - top: 4px; + top: 3px; color: $light-gray; } } From 326ce26126999fe4504281bfbc5f3183d76db3f2 Mon Sep 17 00:00:00 2001 From: Andy Phillipson Date: Mon, 12 Dec 2016 11:20:30 -0500 Subject: [PATCH 06/17] Fix ng-class which wasn't applying the style. --- www/views/walletDetails.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/views/walletDetails.html b/www/views/walletDetails.html index dd66b7d0c..3400baf78 100644 --- a/www/views/walletDetails.html +++ b/www/views/walletDetails.html @@ -46,7 +46,7 @@ on-hold="hideToggle()" ng-style="{'transform': amountScale}" class="amount__balance" - ng-class="{amount__top: status.totalBalanceSat == status.spendableAmount}"> + ng-class="{'amount__top': status.totalBalanceSat == status.spendableAmount}"> {{status.totalBalanceStr}}
Date: Tue, 13 Dec 2016 12:30:28 -0500 Subject: [PATCH 07/17] Fixes layouts and improves appearance of balance page. --- src/js/controllers/modals/walletBalance.js | 9 ------ src/js/controllers/walletDetails.js | 37 ++++++++++++++++------ src/sass/views/tab-home.scss | 6 ++-- src/sass/views/walletBalance.scss | 34 ++++++++++++++++---- src/sass/views/walletDetails.scss | 10 ++---- www/img/icon-confirming-clear.svg | 18 +++++++++++ www/views/modals/wallet-balance.html | 33 +++++++++++-------- www/views/tab-home.html | 5 +-- www/views/walletDetails.html | 15 +++++---- 9 files changed, 111 insertions(+), 56 deletions(-) delete mode 100644 src/js/controllers/modals/walletBalance.js create mode 100644 www/img/icon-confirming-clear.svg diff --git a/src/js/controllers/modals/walletBalance.js b/src/js/controllers/modals/walletBalance.js deleted file mode 100644 index 37d38d5ce..000000000 --- a/src/js/controllers/modals/walletBalance.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; - -angular.module('copayApp.controllers').controller('walletBalanceController', function($scope) { - - $scope.close = function() { - $scope.walletBalanceModal.hide(); - }; - -}); diff --git a/src/js/controllers/walletDetails.js b/src/js/controllers/walletDetails.js index aa905eed1..bf24645b2 100644 --- a/src/js/controllers/walletDetails.js +++ b/src/js/controllers/walletDetails.js @@ -114,6 +114,10 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun $scope.walletBalanceModal = modal; $scope.walletBalanceModal.show(); }); + + $scope.close = function() { + $scope.walletBalanceModal.hide(); + }; }; $scope.recreate = function() { @@ -243,11 +247,10 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun }; var prevPos; - var screenInactive = true; function getScrollPosition() { var scrollPosition = $ionicScrollDelegate.getScrollPosition(); - if (!scrollPosition || screenInactive) { + if (!scrollPosition) { $window.requestAnimationFrame(function() { getScrollPosition(); }); @@ -280,11 +283,31 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun var s = amountScale; + // Make space for the balance button when it needs to display. + var TOP_NO_BALANCE_BUTTON = 45; + var TOP_BALANCE_BUTTON = 10; + var top = TOP_NO_BALANCE_BUTTON; + $scope.showBalanceButton = ($scope.wallet.status.totalBalanceSat != $scope.wallet.status.spendableAmount); + if ($scope.showBalanceButton) { + top = TOP_BALANCE_BUTTON; + $scope.showBalanceButton = true; + } + + var amountTop = ((amountScale - 0.5) / 0.5) * top; + if (amountTop < 5) { + amountTop = 5; + } + if (amountTop > top) { + amountTop = top; + } + + var t = amountTop; + $scope.altAmountOpacity = (amountHeight - 100) / 80; $window.requestAnimationFrame(function() { $scope.amountHeight = amountHeight + 'px'; $scope.contentMargin = contentMargin + 'px'; - $scope.amountScale = 'scale3d(' + s + ',' + s + ',' + s + ')'; + $scope.amountScale = 'scale3d(' + s + ',' + s + ',' + s + ') translateY(' + t + 'px)'; $scope.$digest(); getScrollPosition(); }); @@ -294,16 +317,10 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun $scope.$on("$ionicView.enter", function(event, data) { setAndroidStatusBarColor(); - $timeout(function() { - screenInactive = false; - }, 200); if (scrollWatcherInitialized || !$scope.amountIsCollapsible) { return; } scrollWatcherInitialized = true; - $timeout(function() { - getScrollPosition(); - }, 100); }); $scope.$on("$ionicView.beforeEnter", function(event, data) { @@ -317,6 +334,7 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun }); $scope.updateAll(); + getScrollPosition(); listeners = [ $rootScope.$on('bwsEvent', function(e, walletId) { @@ -337,7 +355,6 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun }); $scope.$on("$ionicView.leave", function(event, data) { - screenInactive = true; lodash.each(listeners, function(x) { x(); }); diff --git a/src/sass/views/tab-home.scss b/src/sass/views/tab-home.scss index fa6356347..3f1f9a911 100644 --- a/src/sass/views/tab-home.scss +++ b/src/sass/views/tab-home.scss @@ -111,10 +111,10 @@ font-weight: 300; color: $light-gray; } - &__icon { - width: 15px; + &__status-icon { + font-size: 18px; position: relative; - top: 3px; + top: 1px; color: $light-gray; } } diff --git a/src/sass/views/walletBalance.scss b/src/sass/views/walletBalance.scss index f9502c750..7dffa0f8b 100644 --- a/src/sass/views/walletBalance.scss +++ b/src/sass/views/walletBalance.scss @@ -4,17 +4,28 @@ font-size: 16px; - &--available { + &--total { color: $mid-gray; font-weight: bold; } + &--available { + color: #09C286;; + font-weight: bold; + } + &--confirming { - color: #09C286; + color: #FF9900; + font-weight: bold; } &--locked { - color: $dark-gray; + color: #FF9900; + font-weight: bold; + } + + &--alternative { + color: $light-gray; } } @@ -74,18 +85,29 @@ &__heading { font-size: 17px; color: #445; - margin: 1rem 1rem 0 1rem; + margin: 1rem 1rem 1rem 1rem; } &__description { - font-size: 15px; + font-size: 12.5px; color: #667; - margin: 1rem; + margin: 0.7rem; + line-height: 16px; } } #wallet-balance { + .bar-header { + border: 0; + background: none; + .title, .button { + color: #fff; + } + .button { + background-color: transparent; + } + } ion-content { background: #F5F5F5; diff --git a/src/sass/views/walletDetails.scss b/src/sass/views/walletDetails.scss index 83a980538..b556f5549 100644 --- a/src/sass/views/walletDetails.scss +++ b/src/sass/views/walletDetails.scss @@ -130,7 +130,7 @@ ion-content { &.collapsible { - margin-top: 180px; + margin-top: 210px; } padding-top: 0; @@ -179,8 +179,7 @@ } &__balance { - transform: scale3d(1, 1, 1); - margin-top: 5px; + transform: scale3d(1, 1, 1) translateY(45px); } &__updating { @@ -196,14 +195,11 @@ line-height: 100%; } - &__top { - margin-top: 45px; - } - &__button-balance { background-color: transparent; border: 1px solid rgba(255,255,255,0.25); } + } .item.item-footer { font-weight: lighter; diff --git a/www/img/icon-confirming-clear.svg b/www/img/icon-confirming-clear.svg new file mode 100644 index 000000000..e7cf58529 --- /dev/null +++ b/www/img/icon-confirming-clear.svg @@ -0,0 +1,18 @@ + + + + +Group 2 +Created with Sketch. + + + + + + + + + diff --git a/www/views/modals/wallet-balance.html b/www/views/modals/wallet-balance.html index 8d147df97..98474578b 100644 --- a/www/views/modals/wallet-balance.html +++ b/www/views/modals/wallet-balance.html @@ -1,22 +1,28 @@ - - + +
- Balance + {{wallet.name}}
+
+ + + +
All of your bitcoin wallet balance may not be available for immediate spending.
-
Total is the total amount of bitcoin stored in this wallet. It is the sum of Available, Confirming, and Locked balances.
- +
Total
- + {{status.totalBalanceStr}}
@@ -27,7 +33,7 @@
-
Available is the immediatley spendable amount of bitcoin stored in this wallet. It is the Total less Confirming and Locked balances. If you have enabled Use Unconfirmed Funds setting then the Available amount is the Total less Locked balance.
+
Total is the total amount of bitcoin stored in this wallet. It is the sum of Available, Confirming, and Locked amounts.
@@ -44,13 +50,13 @@
-
Confirming is the amount of bitcoin stored in this wallet with fewer than 3 block chain confirmations.
+
Available is the immediatley spendable amount of bitcoin stored in this wallet. It is the Total less Confirming and Locked amounts. If you have enabled Use Unconfirmed Funds setting then the Available amount is the Total less Locked amount.
- +
Confirming
- + {{status.pendingBalanceStr}}
@@ -61,13 +67,13 @@
-
Locked is the amount of bitcoin stored in this wallet that is allocated as inputs to pending transaction proposals. This amount is determined using unspent transaction outputs associated with the wallet and may be more than the actual amounts associated with your pending transaction proposals.
+
Confirming is the amount of bitcoin stored in this wallet with fewer than 6 block chain confirmations.
- +
Locked
- + {{status.lockedBalanceStr}}
@@ -78,6 +84,7 @@
+
Locked is the amount of bitcoin stored in this wallet that is allocated as inputs to pending transaction proposals. This amount is determined using unspent transaction outputs associated with the wallet and may be more than the actual amounts associated with your pending transaction proposals.
diff --git a/www/views/tab-home.html b/www/views/tab-home.html index e7dc6d0bc..e648d02e7 100644 --- a/www/views/tab-home.html +++ b/www/views/tab-home.html @@ -80,8 +80,9 @@ Incomplete - {{wallet.status.totalBalanceStr}} - + {{wallet.status.totalBalanceStr}} + + [Balance Hidden] {{wallet.m}}-of-{{wallet.n}} diff --git a/www/views/walletDetails.html b/www/views/walletDetails.html index 3400baf78..59c265045 100644 --- a/www/views/walletDetails.html +++ b/www/views/walletDetails.html @@ -27,11 +27,12 @@
+ {{updateStatusError}} Tap to retry
- This wallet is not registered at the given Bitcore Wallet Service (BWS). You can recreate it from the local information. + This wallet is not registered at the given Bitcore Wallet Service (BWS). You can recreate it from the local information. Recreate
@@ -45,8 +46,7 @@ ng-show="!updateStatusError && wallet.walletScanStatus != 'error' && !wallet.balanceHidden" on-hold="hideToggle()" ng-style="{'transform': amountScale}" - class="amount__balance" - ng-class="{'amount__top': status.totalBalanceSat == status.spendableAmount}"> + class="amount__balance"> {{status.totalBalanceStr}}
+
-
+ +
+
@@ -110,12 +113,12 @@
- {{updateStatusError}} + {{updateStatusError}} Tap to retry
- This wallet is not registered at the given Bitcore Wallet Service (BWS). You can recreate it from the local information. + This wallet is not registered at the given Bitcore Wallet Service (BWS). You can recreate it from the local information. Recreate
From 0f351ddf77c41152b6909627479a8825af7abf15 Mon Sep 17 00:00:00 2001 From: Andy Phillipson Date: Tue, 13 Dec 2016 12:36:43 -0500 Subject: [PATCH 08/17] Add translate attribute. --- www/views/modals/wallet-balance.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/www/views/modals/wallet-balance.html b/www/views/modals/wallet-balance.html index 98474578b..4b87ea8f5 100644 --- a/www/views/modals/wallet-balance.html +++ b/www/views/modals/wallet-balance.html @@ -20,7 +20,7 @@
-
Total
+
Total
{{status.totalBalanceStr}} @@ -37,7 +37,7 @@
-
Available
+
Available
{{status.spendableBalanceStr}} @@ -54,7 +54,7 @@
-
Confirming
+
Confirming
{{status.pendingBalanceStr}} @@ -71,7 +71,7 @@
-
Locked
+
Locked
{{status.lockedBalanceStr}} From 718741595e48439394867a4741fa76e71fc4a3ff Mon Sep 17 00:00:00 2001 From: Andy Phillipson Date: Tue, 13 Dec 2016 12:49:23 -0500 Subject: [PATCH 09/17] Add more translate attributes. --- www/views/modals/wallet-balance.html | 2 +- www/views/walletDetails.html | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/www/views/modals/wallet-balance.html b/www/views/modals/wallet-balance.html index 4b87ea8f5..946f9db39 100644 --- a/www/views/modals/wallet-balance.html +++ b/www/views/modals/wallet-balance.html @@ -1,6 +1,6 @@ -
diff --git a/www/views/walletDetails.html b/www/views/walletDetails.html index 59c265045..462481c61 100644 --- a/www/views/walletDetails.html +++ b/www/views/walletDetails.html @@ -140,7 +140,7 @@
- + Wallet not backed up @@ -194,7 +194,7 @@
- + Recent @@ -236,8 +236,8 @@
- Sending - Receiving + Sending + Receiving
From ddeced76cfdb37ac3e2e12352f9a79f6d7a6b948 Mon Sep 17 00:00:00 2001 From: Andy Phillipson Date: Tue, 13 Dec 2016 12:53:28 -0500 Subject: [PATCH 10/17] Remove errant translate attribute. --- www/views/modals/wallet-balance.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/views/modals/wallet-balance.html b/www/views/modals/wallet-balance.html index 946f9db39..a5507fff3 100644 --- a/www/views/modals/wallet-balance.html +++ b/www/views/modals/wallet-balance.html @@ -3,7 +3,7 @@ -
+
{{wallet.name}}
From c99c4379a5b479fe21f8735a0a7861d5815e01c3 Mon Sep 17 00:00:00 2001 From: Javier Date: Tue, 13 Dec 2016 15:16:49 -0300 Subject: [PATCH 11/17] show timer icon properly --- src/sass/views/tab-home.scss | 1 + www/views/tab-home.html | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sass/views/tab-home.scss b/src/sass/views/tab-home.scss index 3f1f9a911..692224cf2 100644 --- a/src/sass/views/tab-home.scss +++ b/src/sass/views/tab-home.scss @@ -113,6 +113,7 @@ } &__status-icon { font-size: 18px; + margin-left: 5px; position: relative; top: 1px; color: $light-gray; diff --git a/www/views/tab-home.html b/www/views/tab-home.html index e648d02e7..375ed4dcf 100644 --- a/www/views/tab-home.html +++ b/www/views/tab-home.html @@ -80,12 +80,11 @@ Incomplete - {{wallet.status.totalBalanceStr}} - - + {{wallet.status.totalBalanceStr}} [Balance Hidden] {{wallet.m}}-of-{{wallet.n}} + {{wallet.error}} From 8d01607c4a65d2160139c9548015b615eb66c113 Mon Sep 17 00:00:00 2001 From: Javier Date: Tue, 13 Dec 2016 15:45:21 -0300 Subject: [PATCH 12/17] add amount margin bottom --- src/sass/views/walletDetails.scss | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/sass/views/walletDetails.scss b/src/sass/views/walletDetails.scss index b556f5549..52dd836bc 100644 --- a/src/sass/views/walletDetails.scss +++ b/src/sass/views/walletDetails.scss @@ -191,10 +191,6 @@ line-height: 36px; } - strong { - line-height: 100%; - } - &__button-balance { background-color: transparent; border: 1px solid rgba(255,255,255,0.25); From ffa8d7a5764d2e2c0fe6e89d559e27921a88ad42 Mon Sep 17 00:00:00 2001 From: Andy Phillipson Date: Tue, 13 Dec 2016 17:42:49 -0500 Subject: [PATCH 13/17] Display timer icon for all m of n wallets. Use cards on balance view. Minor text explanation changes. --- www/views/modals/wallet-balance.html | 14 ++++++++++---- www/views/tab-home.html | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/www/views/modals/wallet-balance.html b/www/views/modals/wallet-balance.html index a5507fff3..58c5d38a0 100644 --- a/www/views/modals/wallet-balance.html +++ b/www/views/modals/wallet-balance.html @@ -16,7 +16,7 @@
All of your bitcoin wallet balance may not be available for immediate spending.
-
+
@@ -33,7 +33,9 @@
-
Total is the total amount of bitcoin stored in this wallet. It is the sum of Available, Confirming, and Locked amounts.
+
Total is the total amount of bitcoin stored in this wallet; the sum of Available, Confirming, and Locked amounts.
+
+
@@ -50,7 +52,9 @@
-
Available is the immediatley spendable amount of bitcoin stored in this wallet. It is the Total less Confirming and Locked amounts. If you have enabled Use Unconfirmed Funds setting then the Available amount is the Total less Locked amount.
+
Available is the immediatley spendable amount of bitcoin stored in this wallet; the Total less Confirming and Locked amounts.
+
+
@@ -67,7 +71,9 @@
-
Confirming is the amount of bitcoin stored in this wallet with fewer than 6 block chain confirmations.
+
Confirming is the amount of bitcoin stored in this wallet with less than 1 block chain confirmation.
+
+
diff --git a/www/views/tab-home.html b/www/views/tab-home.html index 375ed4dcf..f1a6522bc 100644 --- a/www/views/tab-home.html +++ b/www/views/tab-home.html @@ -84,8 +84,8 @@ [Balance Hidden] {{wallet.m}}-of-{{wallet.n}} - + {{wallet.error}}   From dfda5861037c212fddf8e90c28d73c32662fb087 Mon Sep 17 00:00:00 2001 From: Andy Phillipson Date: Tue, 13 Dec 2016 18:02:23 -0500 Subject: [PATCH 14/17] Balance view text updates. --- www/views/modals/wallet-balance.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/www/views/modals/wallet-balance.html b/www/views/modals/wallet-balance.html index 58c5d38a0..c5661720a 100644 --- a/www/views/modals/wallet-balance.html +++ b/www/views/modals/wallet-balance.html @@ -33,7 +33,7 @@
-
Total is the total amount of bitcoin stored in this wallet; the sum of Available, Confirming, and Locked amounts.
+
Total is the total amount of bitcoin stored in this wallet.
@@ -52,7 +52,7 @@
-
Available is the immediatley spendable amount of bitcoin stored in this wallet; the Total less Confirming and Locked amounts.
+
Available is the immediately spendable amount of bitcoin stored in this wallet.
From bee7b212886b629922c003926d128e983afff2d1 Mon Sep 17 00:00:00 2001 From: Andy Phillipson Date: Tue, 13 Dec 2016 18:16:14 -0500 Subject: [PATCH 15/17] Additional text changes on balance view. --- www/views/modals/wallet-balance.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/www/views/modals/wallet-balance.html b/www/views/modals/wallet-balance.html index c5661720a..beadb1960 100644 --- a/www/views/modals/wallet-balance.html +++ b/www/views/modals/wallet-balance.html @@ -33,7 +33,7 @@
-
Total is the total amount of bitcoin stored in this wallet.
+
The total amount of bitcoin stored in this wallet.
@@ -52,7 +52,7 @@
-
Available is the immediately spendable amount of bitcoin stored in this wallet.
+
The immediately spendable amount of bitcoin stored in this wallet.
@@ -71,7 +71,7 @@
-
Confirming is the amount of bitcoin stored in this wallet with less than 1 block chain confirmation.
+
The amount of bitcoin stored in this wallet with less than 1 block chain confirmation.
@@ -90,7 +90,7 @@
-
Locked is the amount of bitcoin stored in this wallet that is allocated as inputs to pending transaction proposals. This amount is determined using unspent transaction outputs associated with the wallet and may be more than the actual amounts associated with your pending transaction proposals.
+
The amount of bitcoin stored in this wallet that is allocated as inputs to your pending transaction proposals. The amount is determined using unspent transaction outputs associated with this wallet and may be more than the actual amounts associated with your pending transaction proposals.
From 86ee84395fadfb37985c0eccf837529feb45b421 Mon Sep 17 00:00:00 2001 From: Andy Phillipson Date: Wed, 14 Dec 2016 12:29:09 -0500 Subject: [PATCH 16/17] Fixes detection of spendable vs. total balance. Implements refresh logic for updating view when use unconfirmed setting changes. --- src/js/controllers/walletDetails.js | 10 ++++++++-- src/js/services/walletService.js | 5 +++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/js/controllers/walletDetails.js b/src/js/controllers/walletDetails.js index 6110b0d62..710bf3545 100644 --- a/src/js/controllers/walletDetails.js +++ b/src/js/controllers/walletDetails.js @@ -67,6 +67,7 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun setPendingTxps(status.pendingTxps); $scope.status = status; } + refreshAmountSection(); $timeout(function() { $scope.$apply(); }); @@ -264,7 +265,12 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun return; } prevPos = pos; - var amountHeight = 210 - pos; + refreshAmountSection(pos); + }; + + function refreshAmountSection(scrollPos) { + scrollPos = scrollPos || 0; + var amountHeight = 210 - scrollPos; if (amountHeight < 80) { amountHeight = 80; } @@ -334,7 +340,7 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun }); $scope.updateAll(); - getScrollPosition(); + refreshAmountSection(); listeners = [ $rootScope.$on('bwsEvent', function(e, walletId) { diff --git a/src/js/services/walletService.js b/src/js/services/walletService.js index fc3c0261d..9ca86ae54 100644 --- a/src/js/services/walletService.js +++ b/src/js/services/walletService.js @@ -160,16 +160,17 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim // Address with Balance cache.balanceByAddress = balance.byAddress; + // Total wallet balance is same regardless of 'spend unconfirmed funds' setting. + cache.totalBalanceSat = balance.totalAmount; + // Spend unconfirmed funds if (config.spendUnconfirmed) { - cache.totalBalanceSat = balance.totalAmount; cache.lockedBalanceSat = balance.lockedAmount; cache.availableBalanceSat = balance.availableAmount; cache.totalBytesToSendMax = balance.totalBytesToSendMax; cache.pendingAmount = 0; cache.spendableAmount = balance.totalAmount - balance.lockedAmount; } else { - cache.totalBalanceSat = balance.totalConfirmedAmount; cache.lockedBalanceSat = balance.lockedConfirmedAmount; cache.availableBalanceSat = balance.availableConfirmedAmount; cache.totalBytesToSendMax = balance.totalBytesToSendConfirmedMax; From 4e3bc918fc61f5bc5d95fc25285d2a7ce2ebeabf Mon Sep 17 00:00:00 2001 From: Andy Phillipson Date: Thu, 15 Dec 2016 11:50:40 -0500 Subject: [PATCH 17/17] Minor text and font changes. --- src/sass/views/walletBalance.scss | 5 +---- www/views/modals/wallet-balance.html | 4 ++-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/sass/views/walletBalance.scss b/src/sass/views/walletBalance.scss index 7dffa0f8b..84ec41109 100644 --- a/src/sass/views/walletBalance.scss +++ b/src/sass/views/walletBalance.scss @@ -6,26 +6,23 @@ &--total { color: $mid-gray; - font-weight: bold; } &--available { color: #09C286;; - font-weight: bold; } &--confirming { color: #FF9900; - font-weight: bold; } &--locked { color: #FF9900; - font-weight: bold; } &--alternative { color: $light-gray; + font-size: 14px; } } diff --git a/www/views/modals/wallet-balance.html b/www/views/modals/wallet-balance.html index beadb1960..d68109fa3 100644 --- a/www/views/modals/wallet-balance.html +++ b/www/views/modals/wallet-balance.html @@ -52,7 +52,7 @@
-
The immediately spendable amount of bitcoin stored in this wallet.
+
The amount of bitcoin immediately spendable from this wallet.
@@ -71,7 +71,7 @@
-
The amount of bitcoin stored in this wallet with less than 1 block chain confirmation.
+
The amount of bitcoin stored in this wallet with less than 1 blockchain confirmation.