当前位置: 首页>>代码示例>>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;未经允许,请勿转载。