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


TypeScript ionic-native.Vibration類代碼示例

本文整理匯總了TypeScript中ionic-native.Vibration的典型用法代碼示例。如果您正苦於以下問題:TypeScript Vibration類的具體用法?TypeScript Vibration怎麽用?TypeScript Vibration使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Vibration類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: if

      device => {

        if (device.rssi <= -95) {
          this.vibrationThreshold += 1;
          device.distance = "far";
        } else if (device.rssi > -95 && device.rssi <= -80) {
          this.vibrationThreshold += 1;
          device.distance = "not so close";
        } else if (device.rssi > -80) {
          this.vibrationThreshold = 0;
          device.distance = "close";
        }

        if (this.vibrationThreshold >= 3) {
          console.log("Attempting to vibrate...");
          Vibration.vibrate(2000);
        }

        this.foundDevices.push(device);
        console.log("Found: " + JSON.stringify(device));

        // It seems I need to use the ChangeDetectorRef to get the UI to update whenever a device is detected
        this.cd.detectChanges();

      },
開發者ID:asyncsrc,項目名稱:BLEChild,代碼行數:25,代碼來源:home.ts

示例2: hold

	hold() {
		try {
			if (this.vibration) {
				Vibration.vibrate(20);
			}
		} catch (error) {
			console.error('hold', error);
		}
	}
開發者ID:xuender,項目名稱:family,代碼行數:9,代碼來源:back-service.ts

示例3: saveNotebook

    saveNotebook() {
        console.log(JSON.stringify(this.notebook));
        this.dataService.saveNotebook(this.notebook);
        Vibration.vibrate(1000);//vibrate a second
        console.log("Notebook saved successfully");
        
        this.events.publish('notebooks:refresh', "");

        this.nav.pop();
    }
開發者ID:gopalakrishnan-subramani,項目名稱:ionic-notesapp,代碼行數:10,代碼來源:notebook-edit.ts

示例4: connect

    /* Connect to the given device, and set the peripheral for later */
    connect(peripheral) {
	Vibration.vibrate(100);
	let connectSub = BLE.connect(peripheral.id).subscribe(result => {
	    this.storage.storePeripheral(peripheral.id);
	    this.peripheral = peripheral;
            this.connected(peripheral);
        }, error => {
	    console.log("Peripheral was disconnected.");
	    this.disconnect();
	});
    }
開發者ID:mdash-ursi2016,項目名稱:ionic_code_typescript,代碼行數:12,代碼來源:blservice.ts

示例5: vibrate

 vibrate() {
   Vibration.vibrate(3000);
 }
開發者ID:plinionaves,項目名稱:curso-iniciando-ionic-2-native,代碼行數:3,代碼來源:vibration-test.ts

示例6: vibrate

 vibrate() {
     Vibration.vibrate(1000);
 }
開發者ID:ralphowino,項目名稱:ionic-native-kitchen-sink,代碼行數:3,代碼來源:vibration.ts

示例7:

 platform.ready().then(() => {
   this.voice.start();
   Vibration.vibrate(500);
 });
開發者ID:manekinekko,項目名稱:angularattack2016,代碼行數:4,代碼來源:app.ts


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