feat: Long click to open channel in send as select

Co-authored-by: tehcneko <chsqwyx@gmail.com>
This commit is contained in:
xtaodada 2023-09-29 12:56:28 +08:00
parent d8646eb0f4
commit 35f1abb348
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659

View File

@ -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);