From 9b779b4456c402723dc559477d3d8d87a25d6265 Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Mon, 9 Jul 2018 21:48:01 +0200 Subject: offer paste as quote for html clips --- .../de/pixart/messenger/ui/util/EditMessageActionModeCallback.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/main/java/de/pixart') diff --git a/src/main/java/de/pixart/messenger/ui/util/EditMessageActionModeCallback.java b/src/main/java/de/pixart/messenger/ui/util/EditMessageActionModeCallback.java index d7e2ca347..d22db8fa9 100644 --- a/src/main/java/de/pixart/messenger/ui/util/EditMessageActionModeCallback.java +++ b/src/main/java/de/pixart/messenger/ui/util/EditMessageActionModeCallback.java @@ -55,7 +55,10 @@ public class EditMessageActionModeCallback implements ActionMode.Callback { MenuInflater inflater = mode.getMenuInflater(); inflater.inflate(R.menu.edit_message_actions, menu); MenuItem pasteAsQuote = menu.findItem(R.id.paste_as_quote); - pasteAsQuote.setVisible(clipboardManager.hasPrimaryClip() && clipboardManager.getPrimaryClipDescription().hasMimeType("text/plain")); + ClipData primaryClip = clipboardManager.getPrimaryClip(); + if (primaryClip != null && primaryClip.getItemCount() >= 0) { + pasteAsQuote.setVisible(primaryClip.getDescription().getMimeType(0).startsWith("text/") && primaryClip.getItemAt(0).getText() != null); + } return true; } -- cgit v1.2.3