prevent ugly flashes on iOS

This commit is contained in:
Marty Alcala 2016-11-15 11:27:14 -05:00
commit 7a2ee02899
2 changed files with 9 additions and 4 deletions

View file

@ -234,10 +234,11 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun
};
var prevPos;
var screenInactive = true;
function getScrollPosition() {
var scrollPosition = $ionicScrollDelegate.getScrollPosition();
if (!scrollPosition) {
if (!scrollPosition || screenInactive) {
$window.requestAnimationFrame(function() {
getScrollPosition();
});
@ -283,6 +284,9 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun
var scrollWatcherInitialized;
$scope.$on("$ionicView.enter", function(event, data) {
$timeout(function() {
screenInactive = false;
}, 200);
if (scrollWatcherInitialized || !$scope.amountIsCollapsible) {
return;
}
@ -324,6 +328,7 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun
// });
$scope.$on("$ionicView.leave", function(event, data) {
screenInactive = true;
lodash.each(listeners, function(x) {
x();
});

View file

@ -89,7 +89,7 @@
on-refresh="onRefresh()">
</ion-refresher>
<div class="amount-wrapper" ng-show="wallet && wallet.isComplete() && !amountIsCollapsible">
<div class="amount-wrapper" ng-if="wallet && wallet.isComplete() && !amountIsCollapsible">
<div
class="amount-bg"
ng-style="{'background-color':wallet.color}"
@ -139,11 +139,11 @@
</div>
</div> <!-- oh -->
<a class="wallet-not-backed-up-warning" ng-show="!isBackedUp" ui-sref="tabs.wallet.backupWarning({from: 'tabs.wallet', walletId: walletId})">
<a class="wallet-not-backed-up-warning" ng-if="!isBackedUp" ui-sref="tabs.wallet.backupWarning({from: 'tabs.wallet', walletId: walletId})">
Wallet not backed up
</a>
<div class="p60b" ng-show="wallet && wallet.isComplete() && !walletNotRegistered" style="padding-top: 1rem;">
<div class="p60b" ng-if="wallet && wallet.isComplete() && !walletNotRegistered" style="padding-top: 1rem;">
<div class="oh pr m20t" ng-show="wallet.incorrectDerivation">
<div class="text-center text-warning">
<i class="fi-alert"></i>