本文整理汇总了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();
},
示例2: hold
hold() {
try {
if (this.vibration) {
Vibration.vibrate(20);
}
} catch (error) {
console.error('hold', error);
}
}
示例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();
}
示例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();
});
}
示例5: vibrate
vibrate() {
Vibration.vibrate(3000);
}
示例6: vibrate
vibrate() {
Vibration.vibrate(1000);
}
示例7:
platform.ready().then(() => {
this.voice.start();
Vibration.vibrate(500);
});