vibrate again

This commit is contained in:
AdrianLxM 2018-06-27 19:03:29 +02:00
parent f160a49ef6
commit 15d373f273
2 changed files with 8 additions and 0 deletions

View file

@ -6,6 +6,8 @@
<uses-permission android:name="com.google.android.permission.PROVIDE_BACKGROUND" /> <uses-permission android:name="com.google.android.permission.PROVIDE_BACKGROUND" />
<uses-permission android:name="android.permission.WAKE_LOCK" /> <uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.VIBRATE"/>
<application <application
android:allowBackup="true" android:allowBackup="true"

View file

@ -1,10 +1,12 @@
package info.nightscout.androidaps.interaction.actions; package info.nightscout.androidaps.interaction.actions;
import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.res.Resources; import android.content.res.Resources;
import android.os.Bundle; import android.os.Bundle;
import android.os.SystemClock; import android.os.SystemClock;
import android.os.Vibrator;
import android.support.v4.app.NotificationManagerCompat; import android.support.v4.app.NotificationManagerCompat;
import android.support.wearable.view.DotsPageIndicator; import android.support.wearable.view.DotsPageIndicator;
import android.support.wearable.view.GridPagerAdapter; import android.support.wearable.view.GridPagerAdapter;
@ -54,6 +56,10 @@ public class AcceptActivity extends ViewSelectorActivity {
pager.setAdapter(new MyGridViewPagerAdapter()); pager.setAdapter(new MyGridViewPagerAdapter());
DotsPageIndicator dotsPageIndicator = (DotsPageIndicator) findViewById(R.id.page_indicator); DotsPageIndicator dotsPageIndicator = (DotsPageIndicator) findViewById(R.id.page_indicator);
dotsPageIndicator.setPager(pager); dotsPageIndicator.setPager(pager);
Vibrator v = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
long[] vibratePattern = new long[]{0, 100, 50, 100, 50};
v.vibrate(vibratePattern, -1);
} }