From 50780debf7271f4913fec0b624a608e7bd809df5 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Tue, 18 Oct 2016 11:16:43 +0200 Subject: don't trigger context menu in message adapter manually. fixes #2077 --- .../eu/siacs/conversations/ui/adapter/MessageAdapter.java | 13 ------------- src/main/res/layout/message_received.xml | 3 +++ src/main/res/layout/message_sent.xml | 3 +++ 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java b/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java index 4505e632..e9f4bf13 100644 --- a/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java +++ b/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java @@ -77,14 +77,6 @@ public class MessageAdapter extends ArrayAdapter { private OnContactPictureClicked mOnContactPictureClickedListener; private OnContactPictureLongClicked mOnContactPictureLongClickedListener; - private OnLongClickListener openContextMenu = new OnLongClickListener() { - - @Override - public boolean onLongClick(View v) { - v.showContextMenu(); - return true; - } - }; private boolean mIndicateReceived = false; private boolean mUseGreenBackground = false; @@ -374,7 +366,6 @@ public class MessageAdapter extends ArrayAdapter { viewHolder.messageBody.setLinkTextColor(this.getMessageTextColor(darkBackground, true)); viewHolder.messageBody.setHighlightColor(activity.getResources().getColor(darkBackground ? (type == SENT || !mUseGreenBackground ? R.color.black26 : R.color.grey800) : R.color.grey500)); viewHolder.messageBody.setTypeface(null, Typeface.NORMAL); - viewHolder.messageBody.setOnLongClickListener(openContextMenu); } private void displayDownloadableMessage(ViewHolder viewHolder, @@ -390,7 +381,6 @@ public class MessageAdapter extends ArrayAdapter { activity.startDownloadable(message); } }); - viewHolder.download_button.setOnLongClickListener(openContextMenu); } private void displayOpenableMessage(ViewHolder viewHolder,final Message message) { @@ -405,7 +395,6 @@ public class MessageAdapter extends ArrayAdapter { openDownloadable(message); } }); - viewHolder.download_button.setOnLongClickListener(openContextMenu); } private void displayLocationMessage(ViewHolder viewHolder, final Message message) { @@ -420,7 +409,6 @@ public class MessageAdapter extends ArrayAdapter { showLocation(message); } }); - viewHolder.download_button.setOnLongClickListener(openContextMenu); } private void displayImageMessage(ViewHolder viewHolder, @@ -458,7 +446,6 @@ public class MessageAdapter extends ArrayAdapter { openDownloadable(message); } }); - viewHolder.image.setOnLongClickListener(openContextMenu); } private void loadMoreMessages(Conversation conversation) { diff --git a/src/main/res/layout/message_received.xml b/src/main/res/layout/message_received.xml index 466dd045..18f753af 100644 --- a/src/main/res/layout/message_received.xml +++ b/src/main/res/layout/message_received.xml @@ -45,6 +45,7 @@ android:layout_marginTop="8dp" android:layout_marginBottom="4dp" android:adjustViewBounds="true" + android:longClickable="true" android:background="@color/black87" android:scaleType="centerCrop" /> @@ -53,6 +54,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:autoLink="web" + android:longClickable="true" android:textColorLink="@color/white" android:textColor="@color/white" android:textColorHighlight="@color/grey800" @@ -61,6 +63,7 @@