From efd6b0088f4cdfbaf2fb6384ee905ddd3b4e4c5b Mon Sep 17 00:00:00 2001 From: Thomas Date: Sat, 12 Dec 2020 14:45:14 +0100 Subject: [PATCH] Fix issue #119 --- .../PeertubeNotificationsListAdapter.java | 38 ++++++++++--------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/app/src/main/java/app/fedilab/fedilabtube/drawer/PeertubeNotificationsListAdapter.java b/app/src/main/java/app/fedilab/fedilabtube/drawer/PeertubeNotificationsListAdapter.java index 6db6a30..5c184b8 100644 --- a/app/src/main/java/app/fedilab/fedilabtube/drawer/PeertubeNotificationsListAdapter.java +++ b/app/src/main/java/app/fedilab/fedilabtube/drawer/PeertubeNotificationsListAdapter.java @@ -68,7 +68,7 @@ public class PeertubeNotificationsListAdapter extends RecyclerView.Adapter= Build.VERSION_CODES.N) holder.peertube_notif_message.setText(Html.fromHtml(message, Html.FROM_HTML_MODE_LEGACY)); else holder.peertube_notif_message.setText(Html.fromHtml(message)); } else if (notification.getAbuse() != null) { + clickableNotification = false; if (notification.getType() == DisplayNotificationsFragment.MY_VIDEO_REPPORT_SUCCESS) { message = context.getString(R.string.peertube_video_report_success, notification.getAbuse().getId()); } @@ -175,22 +177,24 @@ public class PeertubeNotificationsListAdapter extends RecyclerView.Adapter { - Bundle b = new Bundle(); - Intent intent = null; - if (finalAccountAction != null) { - intent = new Intent(context, ShowAccountActivity.class); - b.putParcelable("account", finalAccountAction); - b.putString("accountAcct", finalAccountAction.getUsername() + "@" + finalAccountAction.getHost()); - } else if (finalChannelAction != null) { - intent = new Intent(context, ShowChannelActivity.class); - b.putParcelable("channel", finalChannelAction); - } - if (intent != null) { - intent.putExtras(b); - context.startActivity(intent); - } - }); + if (clickableNotification) { + holder.peertube_notif_pp.setOnClickListener(v -> { + Bundle b = new Bundle(); + Intent intent = null; + if (finalAccountAction != null) { + intent = new Intent(context, ShowAccountActivity.class); + b.putParcelable("account", finalAccountAction); + b.putString("accountAcct", finalAccountAction.getUsername() + "@" + finalAccountAction.getHost()); + } else if (finalChannelAction != null) { + intent = new Intent(context, ShowChannelActivity.class); + b.putParcelable("channel", finalChannelAction); + } + if (intent != null) { + intent.putExtras(b); + context.startActivity(intent); + } + }); + } }