1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2025-10-28 13:57:40 +00:00

antifix for android 6.0 notification z order problem

This commit is contained in:
Christian Schabesberger
2016-02-21 17:55:00 +01:00
parent d8281aeb34
commit 819db0a30b
4 changed files with 177 additions and 12 deletions

View File

@@ -294,7 +294,8 @@ public class BackgroundPlayer extends Service /*implements MediaPlayer.OnPrepare
R.string.background_player_time_text), title))
.setContentIntent(PendingIntent.getActivity(getApplicationContext(),
noteID, openDetailViewIntent,
PendingIntent.FLAG_UPDATE_CURRENT));
PendingIntent.FLAG_UPDATE_CURRENT))
.setContentIntent(openDetailView);
RemoteViews view =
@@ -304,18 +305,30 @@ 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);
view.setOnClickPendingIntent(R.id.notificationBackgroundButton, 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) {
view.setOnClickPendingIntent(R.id.notificationBackgroundButton, openDetailView);
}
//possibly found the expandedView problem,
//but can't test it as I don't have a 5.0 device. -medavox
RemoteViews expandedView =
new RemoteViews(BuildConfig.APPLICATION_ID, R.layout.player_notification_expanded);
expandedView.setImageViewBitmap(R.id.notificationCover, videoThumbnail);
expandedView.setImageViewBitmap(R.id.notificationCover, videoThumbnail);
expandedView.setTextViewText(R.id.notificationSongName, title);
expandedView.setTextViewText(R.id.notificationArtist, channelName);
expandedView.setTextViewText(R.id.notificationArtist, channelName);
expandedView.setOnClickPendingIntent(R.id.notificationStop, stopPI);
expandedView.setOnClickPendingIntent(R.id.notificationPlayPause, playPI);
expandedView.setOnClickPendingIntent(R.id.notificationBackgroundButton, 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);