diff options
author | Christian Schneppe <christian@pix-art.de> | 2018-07-09 21:48:01 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2018-07-09 21:48:01 +0200 |
commit | 9b779b4456c402723dc559477d3d8d87a25d6265 (patch) | |
tree | a7ee9221fa740bbf34d6c65f7d9af96ca0945e16 /src/main/java/de/pixart/messenger/ui/util | |
parent | 83e627ca1c4d91d31025deaf7357fa1cea686255 (diff) |
offer paste as quote for html clips
Diffstat (limited to 'src/main/java/de/pixart/messenger/ui/util')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/util/EditMessageActionModeCallback.java | 5 |
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; } |