aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger/ui
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-06-16 23:29:52 +0200
committerChristian Schneppe <christian@pix-art.de>2018-06-16 23:29:52 +0200
commit1d86e28360c26984d1d329919dcf9d4be8f0523a (patch)
treea32f3f084d778cadedbe903d1b9ad3b1a9bdf607 /src/main/java/de/pixart/messenger/ui
parent85545cdd1f88f10b344dc85c2bdf0d96ee8c117b (diff)
attach editor content as file
Diffstat (limited to 'src/main/java/de/pixart/messenger/ui')
-rw-r--r--src/main/java/de/pixart/messenger/ui/ConversationFragment.java8
-rw-r--r--src/main/java/de/pixart/messenger/ui/widget/EditMessage.java8
2 files changed, 5 insertions, 11 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
index e966ad109..59098f541 100644
--- a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
+++ b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
@@ -313,7 +313,7 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
}
}
if (hasPermissions(REQUEST_ADD_EDITOR_CONTENT, Manifest.permission.WRITE_EXTERNAL_STORAGE)) {
- attachImageToConversation(inputContentInfo.getContentUri());
+ attachEditorContentToConversation(inputContentInfo.getContentUri());
} else {
mPendingEditorContent = inputContentInfo.getContentUri();
}
@@ -785,8 +785,8 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
});
}
- public void attachImageToConversation(Uri uri) {
- this.attachImageToConversation(conversation, uri, true);
+ public void attachEditorContentToConversation(Uri uri) {
+ this.attachFileToConversation(conversation, uri, null);
}
private void attachImageToConversation(Conversation conversation, Uri uri, boolean sendAsIs) {
@@ -1607,7 +1607,7 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
}
} else if (requestCode == REQUEST_ADD_EDITOR_CONTENT) {
if (this.mPendingEditorContent != null) {
- attachImageToConversation(this.mPendingEditorContent);
+ attachEditorContentToConversation(this.mPendingEditorContent);
}
} else {
attachFile(requestCode);
diff --git a/src/main/java/de/pixart/messenger/ui/widget/EditMessage.java b/src/main/java/de/pixart/messenger/ui/widget/EditMessage.java
index d9d7abfde..6a34c1540 100644
--- a/src/main/java/de/pixart/messenger/ui/widget/EditMessage.java
+++ b/src/main/java/de/pixart/messenger/ui/widget/EditMessage.java
@@ -135,13 +135,7 @@ public class EditMessage extends EmojiAppCompatEditText {
if (mimeTypes != null && mCommitContentListener != null) {
EditorInfoCompat.setContentMimeTypes(editorInfo, mimeTypes);
- return InputConnectionCompat.createWrapper(ic, editorInfo, new InputConnectionCompat.OnCommitContentListener() {
-
- @Override
- public boolean onCommitContent(InputContentInfoCompat inputContentInfo, int flags, Bundle opts) {
- return EditMessage.this.mCommitContentListener.onCommitContent(inputContentInfo, flags, opts, mimeTypes);
- }
- });
+ return InputConnectionCompat.createWrapper(ic, editorInfo, (inputContentInfo, flags, opts) -> EditMessage.this.mCommitContentListener.onCommitContent(inputContentInfo, flags, opts, mimeTypes));
} else {
return ic;
}