diff --git a/notifyApp/app/src/main/java/me/notify/notifyinfo/MyReceiver.java b/notifyApp/app/src/main/java/me/notify/notifyinfo/MyReceiver.java index a7599e4..c18fb6e 100644 --- a/notifyApp/app/src/main/java/me/notify/notifyinfo/MyReceiver.java +++ b/notifyApp/app/src/main/java/me/notify/notifyinfo/MyReceiver.java @@ -117,18 +117,23 @@ //send msg to MainActivity private void processCustomMessage(Context context, String msg) { Vibrator vibrator = (Vibrator) context.getSystemService(VIBRATOR_SERVICE); + + int space = 400; + int longT = 600; + int shortT = 300; + if ("1".equals(msg)){ - vibrator.vibrate(800); + vibrator.vibrate(longT); } else if ("2".equals(msg)){ - vibrator.vibrate(new long[]{0,800,600,800}, -1); + vibrator.vibrate(new long[]{0,longT,space,longT}, -1); } else if ("3".equals(msg)){ - vibrator.vibrate(new long[]{0,800,600,800,600,800}, -1); + vibrator.vibrate(new long[]{0,longT,space,longT,space,longT}, -1); } else if ("4".equals(msg)){ - vibrator.vibrate(new long[]{0,400,400,800,400,400,400,400}, -1); + vibrator.vibrate(new long[]{0,shortT,space,shortT,space,longT,space,shortT}, -1); } else if ("5".equals(msg)){ - vibrator.vibrate(new long[]{0,400,300,400,300,400,300,400,300,800}, -1); + vibrator.vibrate(new long[]{0,shortT,space,shortT,space,shortT,space,shortT,space,longT}, -1); } else if ("6".equals(msg)){ - vibrator.vibrate(new long[]{0,300,300,300,300,300,300,300,300,300,300,300}, -1); + vibrator.vibrate(new long[]{0,shortT,space,shortT,space,shortT,space,shortT,space,shortT,space,shortT}, -1); } // vibrator.cancel(); }