From 8b89dbbfbe27f6d55c2b2d5bf340e3ee5ca35594 Mon Sep 17 00:00:00 2001 From: deltazefiro Date: Wed, 12 Feb 2025 09:01:22 +0800 Subject: [PATCH] feat: Click to hide for notifications (close #154) --- .../java/deltazero/amarok/QuickHideService.java | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/app/src/main/java/deltazero/amarok/QuickHideService.java b/app/src/main/java/deltazero/amarok/QuickHideService.java index f8e27947..7ca93012 100644 --- a/app/src/main/java/deltazero/amarok/QuickHideService.java +++ b/app/src/main/java/deltazero/amarok/QuickHideService.java @@ -24,7 +24,6 @@ import com.hjq.window.draggable.SpringBackDraggable; import deltazero.amarok.receivers.ActionReceiver; -import deltazero.amarok.ui.MainActivity; public class QuickHideService extends LifecycleService { @@ -32,7 +31,6 @@ public class QuickHideService extends LifecycleService { private ImageView ivPanicButton; private PendingIntent activityPendingIntent; - private NotificationCompat.Action action; private static final String CHANNEL_ID = "QUICK_HIDE_CHANNEL"; private static final int NOTIFICATION_ID = 1; @@ -49,15 +47,7 @@ public void onCreate() { Intent actionIntent = new Intent(this, ActionReceiver.class); actionIntent.setAction("deltazero.amarok.HIDE"); - PendingIntent actionPendingIntent = PendingIntent.getBroadcast(this, 1, - actionIntent, PendingIntent.FLAG_IMMUTABLE); - action = new NotificationCompat.Action.Builder( - R.drawable.ic_paw, - getString(R.string.hide), actionPendingIntent).build(); - - activityPendingIntent = PendingIntent.getActivity(this, 0, - new Intent(this, MainActivity.class), PendingIntent.FLAG_IMMUTABLE); - + activityPendingIntent = PendingIntent.getBroadcast(this, 1, actionIntent, PendingIntent.FLAG_IMMUTABLE); } @Override @@ -80,7 +70,6 @@ public int onStartCommand(Intent intent, int flags, int startId) { .setSmallIcon(R.drawable.ic_paw) .setContentIntent(activityPendingIntent) .setOngoing(true) - .addAction(action) .build(); if (Build.VERSION.SDK_INT >= 34) {