aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-07-09 21:48:01 +0200
committerChristian Schneppe <christian@pix-art.de>2018-07-09 21:48:01 +0200
commit9b779b4456c402723dc559477d3d8d87a25d6265 (patch)
treea7ee9221fa740bbf34d6c65f7d9af96ca0945e16
parent83e627ca1c4d91d31025deaf7357fa1cea686255 (diff)
offer paste as quote for html clips
-rw-r--r--src/main/java/de/pixart/messenger/ui/util/EditMessageActionModeCallback.java5
1 files changed, 4 insertions, 1 deletions
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;
}