better balance collapse animation performance on android
This commit is contained in:
parent
d02affadd1
commit
f80f2b8775
2 changed files with 30 additions and 6 deletions
|
|
@ -10,6 +10,7 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun
|
|||
$scope.openTxpModal = txpModalService.open;
|
||||
$scope.isCordova = platformInfo.isCordova;
|
||||
$scope.isAndroid = platformInfo.isAndroid;
|
||||
$scope.isIOS = platformInfo.isIOS;
|
||||
|
||||
$scope.openExternalLink = function(url, target) {
|
||||
externalLinkService.open(url, target);
|
||||
|
|
@ -239,8 +240,13 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun
|
|||
$scope.amountHeight = '180px';
|
||||
$scope.amountScale = 'scale3d(' + 1 + ',' + 1 + ',' + 1+ ')';
|
||||
|
||||
var prevPos;
|
||||
$scope.getScrollPosition = function(){
|
||||
var pos = $ionicScrollDelegate.getScrollPosition().top;
|
||||
if(pos === prevPos) {
|
||||
return;
|
||||
}
|
||||
prevPos = pos;
|
||||
var amountHeight = 180 - pos;
|
||||
if(amountHeight < 80) {
|
||||
amountHeight = 80;
|
||||
|
|
@ -262,16 +268,30 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun
|
|||
|
||||
$scope.altAmountOpacity = (amountHeight - 100)/80;
|
||||
|
||||
$window.requestAnimationFrame(function() {
|
||||
//$window.requestAnimationFrame(function() {
|
||||
$scope.amountHeight = amountHeight + 'px';
|
||||
$scope.contentMargin = contentMargin + 'px';
|
||||
$scope.amountScale = 'scale3d(' + s + ',' + s + ',' + s+ ')';
|
||||
$scope.$evalAsync(angular.noop);
|
||||
});
|
||||
//$scope.$evalAsync(angular.noop);
|
||||
//});
|
||||
};
|
||||
|
||||
$scope.$on("$ionicView.beforeEnter", function(event, data) {
|
||||
// $scope.getScrollPosition();
|
||||
|
||||
// $timeout(function() {
|
||||
//
|
||||
// }, 300);
|
||||
|
||||
var scrollInterval;
|
||||
|
||||
$scope.$on("$ionicView.enter", function(event, data) {
|
||||
scrollInterval = $interval(function(){
|
||||
$scope.getScrollPosition();
|
||||
}, 10);
|
||||
});
|
||||
|
||||
|
||||
$scope.$on("$ionicView.beforeEnter", function(event, data) {
|
||||
$scope.walletId = data.stateParams.walletId;
|
||||
storageService.getBackupFlag($scope.walletId, function(err, flag) {
|
||||
$scope.isBackedUp = flag ? true : false;
|
||||
|
|
@ -298,6 +318,10 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun
|
|||
];
|
||||
});
|
||||
|
||||
$scope.$on("$ionicView.beforeLeave", function(event, data) {
|
||||
$interval.cancel(scrollInterval);
|
||||
});
|
||||
|
||||
$scope.$on("$ionicView.leave", function(event, data) {
|
||||
lodash.each(listeners, function(x) {
|
||||
x();
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
</ion-nav-buttons>
|
||||
</ion-nav-bar>
|
||||
|
||||
<div class="bp-content" ng-class="{'status-bar': isCordova}">
|
||||
<div class="bp-content" ng-class="{'status-bar': isCordova && isIOS}">
|
||||
|
||||
<div class="amount-wrapper" ng-show="wallet && wallet.isComplete()" ng-style="{'background-color':wallet.color}">
|
||||
<div
|
||||
|
|
@ -76,7 +76,7 @@
|
|||
<span ng-include="'views/includes/walletInfo.html'"></span>
|
||||
</div>
|
||||
</div> <!-- oh -->
|
||||
<ion-content on-scroll="getScrollPosition()" ng-style="{'margin-top': contentMargin}">
|
||||
<ion-content ng-style="{'margin-top': contentMargin}">
|
||||
<ion-refresher
|
||||
ng-if="isAndroid"
|
||||
pulling-icon="ion-ios-refresh"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue