本文整理汇总了TypeScript中ionic-angular.Platform.registerBackButtonAction方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Platform.registerBackButtonAction方法的具体用法?TypeScript Platform.registerBackButtonAction怎么用?TypeScript Platform.registerBackButtonAction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ionic-angular.Platform
的用法示例。
在下文中一共展示了Platform.registerBackButtonAction方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
this.events.subscribe('showPinModalEvent', (action: string) => {
this.ATTEMPT_LIMIT = 3;
this.ATTEMPT_LOCK_OUT_TIME = 5 * 60;
this.currentAttempts = 0;
this.currentPin = '';
this.firstPinEntered = '';
this.confirmingPin = false;
this.action = '';
this.disableButtons = false;
this.expires = '';
this.incorrect = false;
this.showPinModal = true;
this.unregister = this.platform.registerBackButtonAction(() => { });
this.action = action;
if (this.action === 'checkPin' || this.action === 'removeLock') {
this.persistenceProvider.getLockStatus().then((isLocked: string) => {
if (!isLocked) return;
this.showLocktimer();
this.setLockRelease();
});
}
});
示例2: handleBackButton
private handleBackButton() {
let lastTimeBackPress = 0;
const timePeriodToExit = 2000;
this.navPath = [];
this.platform.registerBackButtonAction(() => {
if (this.isMessagesOpened) {
this.isMessagesOpened = false;
return;
}
if (this.navPath.length < 1) {
if (new Date().getTime() - lastTimeBackPress < timePeriodToExit) {
this.platform.exitApp();
} else {
let toast = this.toastCtrl.create({
message: 'Press back again to exit',
duration: 3000,
position: 'bottom'
});
toast.present();
lastTimeBackPress = new Date().getTime();
}
return;
}
this.navPath.pop();
this.slide = this.navPath[this.navPath.length - 1];
this.slides.slideTo(this.slide);
this.isGoingBack = true;
});
}
示例3: setTimeout
this.events.subscribe('showWalletsSelectorEvent', (wallets: any[], selectedWalletId: string, title?: string) => {
this.title = title ? title : null;
this.showWalletsSelector = true;
this.selectedWalletId = selectedWalletId;
setTimeout(() => {
this.showSlideEffect = true;
}, 50);
this.wallets = wallets;
this.separeWallets();
let unregisterBackButtonAction = this.platform.registerBackButtonAction(() => {
unregisterBackButtonAction();
this.backdropDismiss();
}, 0);
});
示例4: constructor
constructor(private nav: NavController, private platform: Platform) {
// this tells the tabs component which Pages
// should be each tab's root Page
this.tab1Root = UsaPage;
this.tab2Root = AboutPage;
this.tab3Root = EuropePage;
this.platform.registerBackButtonAction(() => {
let child: Tab = this.tabs.getSelected();
if(child['_views'].length > 1) {
child.pop();
} else {
navigator['app'].exitApp();
}
});
}
示例5: ionViewWillEnter
// TODO: do this when leaving gameboard.
ionViewWillEnter(): void {
this._networkingHelper.closeConnection();
this.unRegisterBackButtonAction = this._platform.registerBackButtonAction(() => {
this._appMinimize.minimize().then(() => { this.unRegisterBackButtonAction() });
}, 200);
}
示例6: registerBackButton
private registerBackButton() {
this.unregisterBackButton(); //remove any previous handlers
this.unregisterBackButtonAction = this.platform.registerBackButtonAction(() => this.onBackButton(), Number.MAX_VALUE);
}
示例7:
this.events.subscribe('showFingerprintModalEvent', (isCopay) => {
this.isCopay = isCopay;
this.showFingerprintModal = true;
this.unregister = this.platform.registerBackButtonAction(() => { });
this.checkFingerprint();
});
示例8: constructor
constructor(
private platform: Platform,
private http: Http,
private parser: Parser,
private banderas : Banderas,
private translator: Translator,
private _ngZone: NgZone,
public events: Events,
private nav: NavController) {
platform.registerBackButtonAction((event) => {
if(this.viewInScreen){
this.backButtonAction();
}else{
this.nav.pop();
}
}, 100);
this.loading = Loading.create({
content: ''
});
this.nav.present(this.loading);
if(!localStorage.getItem('lang')){
localStorage.setItem('lang','es');
}
if(Network.connection != 'No network connection' ){//Connection.NONE
this.downloadData();
}else{
this.getDBLocal();
}
events.subscribe('lang:changed', (lang) => {
this.ajustes = this.translator_object[lang[0]]['TIT_AJUSTES'];
console.log(this.ajustes);
this.pages = new Array();
this.importancia1 = new Array();
this.importancia2 = new Array();
this.importancia3 = new Array();
var i = 0;
this.typeItems.forEach(typeItem => {
this.pages.push({ idx: i,
idTypeItem: typeItem.idTypeItem,
title: typeItem[lang[0]] || typeItem.type,
section: typeItem.type,
importance: typeItem.importance,
img: typeItem.backgroundImage,
component: Lista,
mostrarType: typeItem.mostrarType });
console.log(this.pages);
i++;
if(i === this.typeItems.length){
for (var _i = 0; _i < this.pages.length; _i++) {
if(this.pages[_i].importance === 1){
this.importancia1.push(new Array(this.pages[_i]));
}else if(this.pages[_i].importance === 2){
this.importancia2.push([this.pages[_i],this.pages[_i+1]]);
_i = _i + 1;
}else{
this.importancia3.push([this.pages[_i],this.pages[_i+1],this.pages[_i+2]]);
_i = _i + 2;
}
}
}
});
});
}