From 6cb2aa00fb8eeb5f421733ad661a37c397ee0c26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20Schw=C3=B6rer?= Date: Mon, 12 Nov 2018 17:23:19 +0100 Subject: [PATCH] intermed --- android/app/src/main/AndroidManifest.xml | 1 + .../service/NotificationService.java | 93 +++++++++++++++---- android/app/src/main/res/values/strings.xml | 6 +- web/css/style.css | 5 + 4 files changed, 83 insertions(+), 22 deletions(-) diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 4b19eb6..cf2b50d 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -6,6 +6,7 @@ + = Build.VERSION_CODES.P) rt.setLooping(false); + rt.play(); + new Thread(() -> { try { Thread.sleep(2*1000); } catch (InterruptedException e) { /* */ } rt.stop(); }).start(); + } + + if (ns.EnableVibration) + { + Vibrator v = (Vibrator) SCNApp.getContext().getSystemService(Context.VIBRATOR_SERVICE); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + v.vibrate(VibrationEffect.createOneShot(500, VibrationEffect.DEFAULT_AMPLITUDE)); + } else { + v.vibrate(500); + } + } + } + catch (Exception e) + { + e.printStackTrace(); + } } public void showBackground(CMessage msg) @@ -109,13 +164,13 @@ public class NotificationService if (msg.Priority == PriorityEnum.LOW) mBuilder.setPriority(NotificationCompat.PRIORITY_LOW); if (msg.Priority == PriorityEnum.NORMAL) mBuilder.setPriority(NotificationCompat.PRIORITY_DEFAULT); if (msg.Priority == PriorityEnum.HIGH) mBuilder.setPriority(NotificationCompat.PRIORITY_HIGH); - if (ns.EnableVibration) mBuilder.setVibrate(new long[]{200}); + if (ns.EnableVibration) mBuilder.setVibrate(new long[]{500}); if (ns.EnableLED) mBuilder.setLights(ns.LEDColor, 500, 500); } if (ns.EnableSound && !ns.SoundSource.isEmpty()) { - mBuilder.setSound(Uri.parse(ns.SoundSource), AudioManager.STREAM_ALARM); + mBuilder.setSound(Uri.parse(ns.SoundSource), AudioManager.STREAM_NOTIFICATION); } Intent intent = new Intent(ctxt, MainActivity.class); diff --git a/android/app/src/main/res/values/strings.xml b/android/app/src/main/res/values/strings.xml index 678e18d..0a43c75 100644 --- a/android/app/src/main/res/values/strings.xml +++ b/android/app/src/main/res/values/strings.xml @@ -18,9 +18,9 @@ Common Settings Enabled Remember the last x notifications locally - Notifications (priority 0) - Notifications (priority 1) - Notifications (priority 2) + Notifications (priority 0 - Low) + Notifications (priority 1 - Normal) + Notifications (priority 2 - High) Enable notification sound Notification sound Repeat notification sound diff --git a/web/css/style.css b/web/css/style.css index e0dee93..878835f 100644 --- a/web/css/style.css +++ b/web/css/style.css @@ -193,6 +193,11 @@ input::-webkit-inner-spin-button { pointer-events: none; } +.fullcenterflex .card +{ + pointer-events: auto; +} + a.card, a.card:active, a.card:visited,