當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript react-native.Alert類代碼示例

本文整理匯總了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")
     });
   }
 };
開發者ID:crownstone,項目名稱:CrownstoneApp,代碼行數:30,代碼來源:SphereUtil.ts

示例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}]
   )
 });
開發者ID:crownstone,項目名稱:CrownstoneApp,代碼行數:7,代碼來源:BluenetPromise.ts

示例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});
 })
開發者ID:crownstone,項目名稱:CrownstoneApp,代碼行數:9,代碼來源:storeManager.ts

示例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);
    }
  },
開發者ID:crownstone,項目名稱:CrownstoneApp,代碼行數:17,代碼來源:AppUtil.ts

示例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'}])
 })
開發者ID:crownstone,項目名稱:CrownstoneApp,代碼行數:5,代碼來源:CreateSphere.ts

示例7: lang

 .catch((err) => {
   Alert.alert(lang("Data_reset_failed___"), lang("Something_went_wrong_in_t"),[{text: lang("OK")}])
 })
開發者ID:crownstone,項目名稱:CrownstoneApp,代碼行數:3,代碼來源:AppUtil.ts

示例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});
 });
開發者ID:crownstone,項目名稱:CrownstoneApp,代碼行數:5,代碼來源:StoneUtil.ts


注:本文中的react-native.Alert類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。