don't trigger context menu in message adapter manually. fixes #2077
This commit is contained in:
parent
f8c21caec9
commit
50780debf7
|
@ -77,14 +77,6 @@ public class MessageAdapter extends ArrayAdapter<Message> {
|
||||||
private OnContactPictureClicked mOnContactPictureClickedListener;
|
private OnContactPictureClicked mOnContactPictureClickedListener;
|
||||||
private OnContactPictureLongClicked mOnContactPictureLongClickedListener;
|
private OnContactPictureLongClicked mOnContactPictureLongClickedListener;
|
||||||
|
|
||||||
private OnLongClickListener openContextMenu = new OnLongClickListener() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onLongClick(View v) {
|
|
||||||
v.showContextMenu();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
private boolean mIndicateReceived = false;
|
private boolean mIndicateReceived = false;
|
||||||
private boolean mUseGreenBackground = false;
|
private boolean mUseGreenBackground = false;
|
||||||
|
|
||||||
|
@ -374,7 +366,6 @@ public class MessageAdapter extends ArrayAdapter<Message> {
|
||||||
viewHolder.messageBody.setLinkTextColor(this.getMessageTextColor(darkBackground, true));
|
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.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.setTypeface(null, Typeface.NORMAL);
|
||||||
viewHolder.messageBody.setOnLongClickListener(openContextMenu);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void displayDownloadableMessage(ViewHolder viewHolder,
|
private void displayDownloadableMessage(ViewHolder viewHolder,
|
||||||
|
@ -390,7 +381,6 @@ public class MessageAdapter extends ArrayAdapter<Message> {
|
||||||
activity.startDownloadable(message);
|
activity.startDownloadable(message);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
viewHolder.download_button.setOnLongClickListener(openContextMenu);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void displayOpenableMessage(ViewHolder viewHolder,final Message message) {
|
private void displayOpenableMessage(ViewHolder viewHolder,final Message message) {
|
||||||
|
@ -405,7 +395,6 @@ public class MessageAdapter extends ArrayAdapter<Message> {
|
||||||
openDownloadable(message);
|
openDownloadable(message);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
viewHolder.download_button.setOnLongClickListener(openContextMenu);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void displayLocationMessage(ViewHolder viewHolder, final Message message) {
|
private void displayLocationMessage(ViewHolder viewHolder, final Message message) {
|
||||||
|
@ -420,7 +409,6 @@ public class MessageAdapter extends ArrayAdapter<Message> {
|
||||||
showLocation(message);
|
showLocation(message);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
viewHolder.download_button.setOnLongClickListener(openContextMenu);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void displayImageMessage(ViewHolder viewHolder,
|
private void displayImageMessage(ViewHolder viewHolder,
|
||||||
|
@ -458,7 +446,6 @@ public class MessageAdapter extends ArrayAdapter<Message> {
|
||||||
openDownloadable(message);
|
openDownloadable(message);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
viewHolder.image.setOnLongClickListener(openContextMenu);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void loadMoreMessages(Conversation conversation) {
|
private void loadMoreMessages(Conversation conversation) {
|
||||||
|
|
|
@ -45,6 +45,7 @@
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
android:layout_marginBottom="4dp"
|
android:layout_marginBottom="4dp"
|
||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true"
|
||||||
|
android:longClickable="true"
|
||||||
android:background="@color/black87"
|
android:background="@color/black87"
|
||||||
android:scaleType="centerCrop" />
|
android:scaleType="centerCrop" />
|
||||||
|
|
||||||
|
@ -53,6 +54,7 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:autoLink="web"
|
android:autoLink="web"
|
||||||
|
android:longClickable="true"
|
||||||
android:textColorLink="@color/white"
|
android:textColorLink="@color/white"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:textColorHighlight="@color/grey800"
|
android:textColorHighlight="@color/grey800"
|
||||||
|
@ -61,6 +63,7 @@
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/download_button"
|
android:id="@+id/download_button"
|
||||||
style="?android:attr/buttonStyleSmall"
|
style="?android:attr/buttonStyleSmall"
|
||||||
|
android:longClickable="true"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
|
|
|
@ -47,6 +47,7 @@
|
||||||
android:layout_marginBottom="4dp"
|
android:layout_marginBottom="4dp"
|
||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true"
|
||||||
android:background="@color/black87"
|
android:background="@color/black87"
|
||||||
|
android:longClickable="true"
|
||||||
android:scaleType="centerCrop" />
|
android:scaleType="centerCrop" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
@ -54,6 +55,7 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:autoLink="web"
|
android:autoLink="web"
|
||||||
|
android:longClickable="true"
|
||||||
android:textColorLink="@color/black87"
|
android:textColorLink="@color/black87"
|
||||||
android:textColor="?attr/color_text_primary"
|
android:textColor="?attr/color_text_primary"
|
||||||
android:textColorHighlight="@color/grey500"
|
android:textColorHighlight="@color/grey500"
|
||||||
|
@ -64,6 +66,7 @@
|
||||||
style="?android:attr/buttonStyleSmall"
|
style="?android:attr/buttonStyleSmall"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:longClickable="true"
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
|
Loading…
Reference in a new issue