本文整理匯總了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);
});