From b5b47f8d7d50130d678f932f3e5b9c0fb0904964 Mon Sep 17 00:00:00 2001 From: kosyak Date: Mon, 30 Oct 2023 19:59:37 +0100 Subject: [PATCH] fix expandable contact clicks handling --- .../ui/StartConversationActivity.java | 27 +++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java index 8a1ca7b2a..99d3676da 100644 --- a/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java @@ -1575,6 +1575,27 @@ public class StartConversationActivity extends XmppActivity implements XmppConne super.setAdapter(adapter); } } + + @Override + public void setOnItemClickListener(OnItemClickListener l) { + setOnChildClickListener((parent, v, groupPosition, childPosition, id) -> { + ExpandableListAdapter expandableAdapter = getExpandableListAdapter(); + + if (!(expandableAdapter instanceof ExpandableListItemAdapter)) return false; + + ExpandableListItemAdapter adapter = (ExpandableListItemAdapter) expandableAdapter; + + Object child = expandableAdapter.getChild(groupPosition, childPosition); + for(int i=0;i