From 35f1abb348fd2c24d598c4df9a9a8079a0d92efb Mon Sep 17 00:00:00 2001 From: xtaodada Date: Fri, 29 Sep 2023 12:56:28 +0800 Subject: [PATCH] feat: Long click to open channel in send as select Co-authored-by: tehcneko --- .../org/telegram/ui/Components/SenderSelectPopup.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/SenderSelectPopup.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/SenderSelectPopup.java index cb8dcbb6c..e27c348b8 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Components/SenderSelectPopup.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/SenderSelectPopup.java @@ -11,6 +11,7 @@ import android.graphics.Rect; import android.graphics.Typeface; import android.graphics.drawable.Drawable; import android.os.Build; +import android.os.Bundle; import android.text.Spannable; import android.text.SpannableString; import android.text.TextUtils; @@ -323,6 +324,15 @@ public class SenderSelectPopup extends ActionBarPopupWindow { clicked = true; selectCallback.onPeerSelected(recyclerView, (SenderView) view, peerObj.peer); }); + recyclerView.setOnItemLongClickListener((view, position) -> { + TLRPC.TL_sendAsPeer peerObj = peers.get(position); + if (peerObj.peer.channel_id != 0) { + Bundle args = new Bundle(); + args.putLong("chat_id", peerObj.peer.channel_id); + parentFragment.presentFragment(new ChatActivity(args)); + } + return true; + }); recyclerView.setOverScrollMode(View.OVER_SCROLL_NEVER); recyclerFrameLayout.addView(recyclerView);