From 41479dc37c4947f84665b806c57142416be7e657 Mon Sep 17 00:00:00 2001 From: polymorphicshade Date: Sat, 18 Jul 2020 19:47:56 -0600 Subject: [PATCH] SponsorBlock: Changed normal app notification to be a simple toast notification --- .../org/schabi/newpipe/player/BasePlayer.java | 16 ++-------------- app/src/main/res/values/strings.xml | 2 +- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/player/BasePlayer.java b/app/src/main/java/org/schabi/newpipe/player/BasePlayer.java index 2222870c9..6ecb39393 100644 --- a/app/src/main/java/org/schabi/newpipe/player/BasePlayer.java +++ b/app/src/main/java/org/schabi/newpipe/player/BasePlayer.java @@ -34,8 +34,6 @@ import android.widget.Toast; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import androidx.core.app.NotificationCompat; -import androidx.core.app.NotificationManagerCompat; import com.google.android.exoplayer2.C; import com.google.android.exoplayer2.DefaultRenderersFactory; @@ -678,18 +676,8 @@ public abstract class BasePlayer implements seekTo(skipTo); if (mPrefs.getBoolean(context.getString(R.string.sponsorblock_notifications), false)) { - NotificationCompat.Builder notificationBuilder = new NotificationCompat - .Builder(context, context.getString(R.string.notification_channel_id)) - .setOngoing(false) - .setSmallIcon(R.drawable.ic_sponsor_block_white_96dp) - .setVisibility(NotificationCompat.VISIBILITY_PUBLIC) - .setContentTitle(context.getString(R.string.settings_category_sponsorblock)) - .setContentText(context.getString(R.string.sponsorblock_skipped_sponsor) - + " \uD83D\uDC4D"); - - NotificationManagerCompat notificationManager = NotificationManagerCompat - .from(App.getApp()); - notificationManager.notify(0, notificationBuilder.build()); + String toastText = context.getString(R.string.sponsorblock_skipped_sponsor); + Toast.makeText(context, toastText, Toast.LENGTH_SHORT).show(); } if (DEBUG) { diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 0e028fb17..1c5320c55 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -666,7 +666,7 @@ Custom API Url The url to use when querying the SponsorBlock API. Leave empty to use the default. Notify when sponsors are skipped - Send a notification to your device when a sponsor is automatically skipped. + Show a toast notification when a sponsor is automatically skipped. View Privacy Policy View the privacy policy of the SponsorBlock service. \ No newline at end of file