onboarding - disable scroll - skip notification view on android

This commit is contained in:
Gabriel Bazán 2016-09-13 17:12:17 -03:00
commit 3d927267bc
12 changed files with 44 additions and 33 deletions

View file

@ -1,5 +1,5 @@
<ion-view id="onboarding-backup-request" class="onboarding">
<ion-content ng-controller="backupRequestController">
<ion-content ng-controller="backupRequestController" scroll="false">
<div class="row">
<img src="img/onboarding-warning.svg" class="col col-75 warning">
</div>

View file

@ -6,7 +6,7 @@
</button>
</ion-nav-buttons>
</ion-nav-bar>
<ion-content>
<ion-content scroll="false">
<div class="row text-center">
<h3 translate class="col col-80">
Are you being watched?

View file

@ -40,7 +40,7 @@
</div>
</div>
<div class="overlay collect-overlay">
<button class="button button-stable button-clear" ng-click="onboardingMailSkip()">
<button class="button button-stable button-clear" ng-click="goNextView()">
{{'Skip' | translate}}
</button>
</div>

View file

@ -1,5 +1,5 @@
<ion-view id="onboarding-disclaimer" class="onboarding">
<ion-content ng-controller="disclaimerController" ng-init=init()>
<ion-content ng-controller="disclaimerController" ng-init=init() scroll="false">
<div class="row text-center">
<h3 translate class="col-75 col">Almost done! Let's review</h3>
</div>

View file

@ -1,5 +1,5 @@
<ion-view>
<ion-content ng-controller="notificationsController">
<ion-content ng-controller="notificationsController" scroll="false">
<div class="text-center">
<h1 translate>
Push Notifications

View file

@ -14,7 +14,7 @@
</ion-nav-bar>
<ion-slides class="slides" options="options" slider="data.slider">
<ion-slide-page>
<ion-content id="onboard-tour-secure">
<ion-content id="onboard-tour-secure" scroll="false">
<div class="text-center row">
<h2 class="col col-60" translate>Bitcoin is secure, digital money</h2>
</div>
@ -38,7 +38,7 @@
</ion-content>
</ion-slide-page>
<ion-slide-page>
<ion-content id="onboard-tour-currency">
<ion-content id="onboard-tour-currency" scroll="false">
<div class="text-center row">
<h2 class="col col-75" translate>Bitcoin is a currency</h2>
</div>
@ -62,7 +62,7 @@
</ion-content>
</ion-slide-page>
<ion-slide-page>
<ion-content id="onboard-tour-control">
<ion-content id="onboard-tour-control" scroll="false">
<div class="text-center row">
<h2 translate class="col col-75">You control your bitcoin</h2>
</div>

View file

@ -1,5 +1,5 @@
<ion-view id="onboard-welcome" class="onboarding">
<ion-content ng-controller="welcomeController" ng-init="createProfile()">
<ion-content ng-controller="welcomeController" ng-init="createProfile()" scroll="false">
<qr-scanner id="shopping-24" on-scan="goImport(data)"></qr-scanner>
<article id="logo-tagline">
<div class="row text-center">

View file

@ -1,6 +1,6 @@
'use strict';
angular.module('copayApp.controllers').controller('backupWarningController', function($scope, $state, $stateParams, $ionicPopup, profileService) {
angular.module('copayApp.controllers').controller('backupWarningController', function($scope, $state, $timeout, $stateParams, $ionicPopup, profileService) {
$scope.walletId = $stateParams.walletId;
$scope.openPopup = function() {
@ -11,7 +11,10 @@ angular.module('copayApp.controllers').controller('backupWarningController', fun
$scope.close = function() {
backupWarningPopup.close();
$state.go('onboarding.backup', {walletId: $stateParams.walletId, fromOnboarding: true});
$state.go('onboarding.backup', {
walletId: $stateParams.walletId,
fromOnboarding: true
});
};
}
});

View file

@ -5,6 +5,7 @@ angular.module('copayApp.controllers').controller('collectEmailController', func
var isCordova = platformInfo.isCordova;
var isWP = platformInfo.isWP;
var usePushNotifications = isCordova && !isWP;
var requiresOptIn = platformInfo.isIOS;
var wallet = profileService.getWallet($stateParams.walletId);
var walletId = wallet.credentials.walletId;
@ -21,16 +22,29 @@ angular.module('copayApp.controllers').controller('collectEmailController', func
if (err) $log.warn(err);
configService.set(opts, function(err) {
if (err) $log.warn(err);
if (!usePushNotifications) $state.go('onboarding.backupRequest', {
walletId: walletId
});
else $state.go('onboarding.notifications', {
walletId: walletId
});
goNextView();
});
});
};
var goNextView = function() {
if (!usePushNotifications) {
$state.go('onboarding.backupRequest', {
walletId: walletId
});
}
else if (requiresOptIn) {
$state.go('onboarding.notifications', {
walletId: walletId
});
} else {
profileService.pushNotificationsInit();
$state.go('onboarding.backupRequest', {
walletId: walletId
});
}
};
$scope.confirm = function(emailForm) {
if (emailForm.$invalid) return;
$scope.confirmation = true;
@ -44,9 +58,4 @@ angular.module('copayApp.controllers').controller('collectEmailController', func
}, 1);
};
$scope.onboardingMailSkip = function() {
$state.go('onboarding.backupRequest', {
walletId: walletId
});
};
});

View file

@ -5,7 +5,9 @@ angular.module('copayApp.controllers').controller('notificationsController', fun
$scope.walletId = $stateParams.walletId;
$scope.allowNotif = function() {
profileService.pushNotificationsInit();
$state.go('onboarding.backupRequest');
$state.go('onboarding.backupRequest', {
walletId: $scope.walletId
});
}
});

View file

@ -490,14 +490,14 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
}
})
/*
*
* Addressbook
*
*/
/*
*
* Addressbook
*
*/
.state('tabs.addressbook', {
.state('tabs.addressbook', {
url: '/addressbook',
views: {
'tab-settings': {
@ -761,7 +761,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
}
});
})
.run(function($rootScope, $state, $location, $log, $timeout, $ionicHistory, $ionicPlatform, lodash, platformInfo, profileService, uxLanguage, gettextCatalog, openURLService, storageService) {
.run(function($rootScope, $state, $location, $log, $timeout, $ionicHistory, $ionicPlatform, $ionicScrollDelegate, lodash, platformInfo, profileService, uxLanguage, gettextCatalog, openURLService, storageService) {
uxLanguage.init();
openURLService.init();

View file

@ -268,9 +268,6 @@ angular.module('copayApp.services')
if (!val) {
return cb(new Error('NONAGREEDDISCLAIMER: Non agreed disclaimer'));
}
if (usePushNotifications)
root.pushNotificationsInit();
$rootScope.$emit('disclaimerAccepted');
return cb();
});
});