本文整理匯總了TypeScript中react-native.Alert類的典型用法代碼示例。如果您正苦於以下問題:TypeScript Alert類的具體用法?TypeScript Alert怎麽用?TypeScript Alert使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了Alert類的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: lang
let showFinalizeIndoorNavigationCallback = () => {
if (!sphereIsPresent) {
Alert.alert(
lang("Youll_have_to_be_in_the_S"),
lang("If_youre_in_range_of_any_"),
[{text: 'OK'}]
);
}
else if (noRooms) {
Alert.alert(
lang("Lets_create_some_rooms_"),
lang("Tap_the_icon_on_the_botto"),
[{text: 'OK'}]
);
}
else if (enoughCrownstonesInLocationsForIndoorLocalization(state, sphereId)) {
eventBus.emit("showLocalizationSetupStep2", sphereId);
}
else {
Actions.roomOverview({
sphereId: sphereId,
locationId: null,
title: lang("First_things_first___"),
hideRight: true,
usedForIndoorLocalizationSetup: true,
overlayText: lang("Place_your_Crownstones_in"),
explanation: lang("Tap_a_Crownstone_to_see_i")
});
}
};
示例2: Promise
return new Promise((resolve, reject) => {
Alert.alert(
"Can't connect to this Crownstone.",
"Please move a little closer to it and try again.",
[{text:'OK', onPress: reject}]
)
});
示例3:
.catch((err) => {
LOGe.store("StoreManager: failed to initialize.", err);
Alert.alert("Problem with the database.","Please log in again.",[{text:"OK", onPress: () => {
this.persistor.endSession();
this.storeInitialized = true;
eventBus.emit('storeManagerInitialized');
}
}],{cancelable: false});
})
示例4: function
logOut: function(store, message = null) {
if (message) {
Alert.alert(message.title, message.body, [{text:'OK', onPress:() => {
AppUtil._logOut(store, () => {Bluenet.quitApp();});
}}], { cancelable: false });
}
else {
let gracefulExit = () => {
LOG.info("Quit app due to logout");
setTimeout(() => {
Bluenet.quitApp();
}, 3500);
};
AppUtil._logOut(store, gracefulExit);
}
},
示例5: setTimeout
setTimeout(() =>
Alert.alert('App requires location tracking permission', 'Would you like to open app settings?', [
{text: 'Yes', onPress: () => BackgroundGeolocation.showAppSettings()},
{text: 'No', onPress: () => console.log('No Pressed'), style: 'cancel'}
]), 1000);
開發者ID:CNBoland,項目名稱:DefinitelyTyped,代碼行數:5,代碼來源:react-native-mauron85-background-geolocation-tests.ts
示例6:
.catch((err) => {
eventBus.emit('hideLoading');
LOGe.info("Could not create sphere", err);
Alert.alert("Could not create sphere", "Please try again later.", [{text:'OK'}])
})
示例7: lang
.catch((err) => {
Alert.alert(lang("Data_reset_failed___"), lang("Something_went_wrong_in_t"),[{text: lang("OK")}])
})
示例8: lang
.catch((err) => {
LOGe.info("ErrorOverlay: Could not reset errors of Crownstone", err);
let defaultAction = () => { eventBus.emit("hideLoading"); };
Alert.alert(lang("Failed_to_reset_error___"), lang("You_can_move_closer_and_t"),[{text:'OK', onPress: defaultAction}], { onDismiss: defaultAction});
});