From 2995a7dc8fdc601b7a8e7b660394ef08d46fa4d6 Mon Sep 17 00:00:00 2001 From: Christian Schabesberger Date: Sun, 21 Feb 2016 18:12:00 +0100 Subject: [PATCH] actual fix for androi 6.0 notification problem Notification buttons weren't respondig to clicks. Now they do. --- .../org/schabi/newpipe/BackgroundPlayer.java | 15 +--- .../res/layout-v23/player_notification.xml | 80 ------------------- .../player_notification_expanded.xml | 79 ------------------ .../main/res/layout/player_notification.xml | 6 +- .../layout/player_notification_expanded.xml | 12 +-- 5 files changed, 6 insertions(+), 186 deletions(-) delete mode 100644 app/src/main/res/layout-v23/player_notification.xml delete mode 100644 app/src/main/res/layout-v23/player_notification_expanded.xml diff --git a/app/src/main/java/org/schabi/newpipe/BackgroundPlayer.java b/app/src/main/java/org/schabi/newpipe/BackgroundPlayer.java index dbca70d05..47afac5b1 100644 --- a/app/src/main/java/org/schabi/newpipe/BackgroundPlayer.java +++ b/app/src/main/java/org/schabi/newpipe/BackgroundPlayer.java @@ -305,13 +305,7 @@ public class BackgroundPlayer extends Service /*implements MediaPlayer.OnPrepare view.setTextViewText(R.id.notificationArtist, channelName); view.setOnClickPendingIntent(R.id.notificationStop, stopPI); view.setOnClickPendingIntent(R.id.notificationPlayPause, playPI); - - // todo: fix terrible lazy workaround - // sh*** because android 6.0 f**** around with z order when doing event handling - // Who ever designed android that way wanted to harm humanity. - if(android.os.Build.VERSION.SDK_INT < 23) { - view.setOnClickPendingIntent(R.id.notificationBackgroundButton, openDetailView); - } + view.setOnClickPendingIntent(R.id.notificationContent, openDetailView); //possibly found the expandedView problem, //but can't test it as I don't have a 5.0 device. -medavox @@ -322,13 +316,8 @@ public class BackgroundPlayer extends Service /*implements MediaPlayer.OnPrepare expandedView.setTextViewText(R.id.notificationArtist, channelName); expandedView.setOnClickPendingIntent(R.id.notificationStop, stopPI); expandedView.setOnClickPendingIntent(R.id.notificationPlayPause, playPI); + expandedView.setOnClickPendingIntent(R.id.notificationContent, openDetailView); - // todo: fix terrible lazy workaround - // sh*** because android 6.0 f**** around with z order when doing event handling - // Who ever designed android that way wanted to harm humanity. - if(android.os.Build.VERSION.SDK_INT < 23) { - expandedView.setOnClickPendingIntent(R.id.notificationBackgroundButton, openDetailView); - } noteBuilder.setCategory(Notification.CATEGORY_TRANSPORT); diff --git a/app/src/main/res/layout-v23/player_notification.xml b/app/src/main/res/layout-v23/player_notification.xml deleted file mode 100644 index ea8aa46e5..000000000 --- a/app/src/main/res/layout-v23/player_notification.xml +++ /dev/null @@ -1,80 +0,0 @@ - - - -