Vibratissimo: clear queue when setting vibration

This commit is contained in:
Andreas Shimokawa 2016-09-20 21:49:27 +02:00
parent 6a18d90fee
commit 1f8cfa5a68
3 changed files with 5 additions and 2 deletions

View File

@ -44,7 +44,9 @@ public class VibrationActivity extends GBActivity {
seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() { seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override @Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
LOG.info("changed to:" + progress); if (progress > 0) { // 1-16
progress = progress * 16 - 1; // max 255
}
GBApplication.deviceService().onSetConstantVibration(progress); GBApplication.deviceService().onSetConstantVibration(progress);
} }

View File

@ -215,6 +215,7 @@ public class VibratissimoSupport extends AbstractBTLEDeviceSupport {
@Override @Override
public void onSetConstantVibration(int intensity) { public void onSetConstantVibration(int intensity) {
getQueue().clear();
BluetoothGattCharacteristic characteristic2 = getCharacteristic(UUID.fromString("00001526-1212-efde-1523-785feabcd123")); BluetoothGattCharacteristic characteristic2 = getCharacteristic(UUID.fromString("00001526-1212-efde-1523-785feabcd123"));
BluetoothGattCharacteristic characteristic1 = getCharacteristic(UUID.fromString("00001524-1212-efde-1523-785feabcd123")); BluetoothGattCharacteristic characteristic1 = getCharacteristic(UUID.fromString("00001524-1212-efde-1523-785feabcd123"));

View File

@ -10,7 +10,7 @@
<SeekBar <SeekBar
android:layout_width="match_parent" android:layout_width="match_parent"
android:id="@+id/vibration_seekbar" android:id="@+id/vibration_seekbar"
android:max="256" android:max="16"
android:scaleY="4.0" android:scaleY="4.0"
android:layout_height="wrap_content" /> android:layout_height="wrap_content" />
</LinearLayout> </LinearLayout>