From dd25901d191e228d9a7bf50bbdf98aa65e1799e6 Mon Sep 17 00:00:00 2001 From: Andy Phillipson Date: Thu, 15 Dec 2016 15:38:15 -0500 Subject: [PATCH] Fixes Android presentation of the balance button. --- src/js/controllers/walletDetails.js | 22 +++++++++++++++------- www/views/walletDetails.html | 21 ++++++++++++++++++++- 2 files changed, 35 insertions(+), 8 deletions(-) diff --git a/src/js/controllers/walletDetails.js b/src/js/controllers/walletDetails.js index 710bf3545..a00f93184 100644 --- a/src/js/controllers/walletDetails.js +++ b/src/js/controllers/walletDetails.js @@ -269,6 +269,16 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun }; function refreshAmountSection(scrollPos) { + $scope.showBalanceButton = false; + if ($scope.wallet.status) { + $scope.showBalanceButton = ($scope.wallet.status.totalBalanceSat != $scope.wallet.status.spendableAmount); + } + if (!$scope.amountIsCollapsible) { + var t = ($scope.showBalanceButton ? 15 : 45); + $scope.amountScale = 'translateY(' + t + 'px)'; + return; + } + scrollPos = scrollPos || 0; var amountHeight = 210 - scrollPos; if (amountHeight < 80) { @@ -290,18 +300,16 @@ 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_NO_BALANCE_BUTTON = 115; + var TOP_BALANCE_BUTTON = 30; 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; + var amountTop = ((amountScale - 0.7) / 0.7) * top; + if (amountTop < -10) { + amountTop = -10; } if (amountTop > top) { amountTop = top; diff --git a/www/views/walletDetails.html b/www/views/walletDetails.html index d89023f4e..2a1b22670 100644 --- a/www/views/walletDetails.html +++ b/www/views/walletDetails.html @@ -46,7 +46,7 @@ ng-show="!updateStatusError && wallet.walletScanStatus != 'error' && !wallet.balanceHidden" on-hold="hideToggle()" ng-style="{'transform': amountScale}" - class="amount__balance"> + ng-class="{amount__balance: amountIsCollapsible}"> {{status.totalBalanceStr}}
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}}
+
+ +
+ +
+
[Balance Hidden]