aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/de/pixart')
-rw-r--r--src/main/java/de/pixart/messenger/persistance/FileBackend.java11
-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
3 files changed, 6 insertions, 21 deletions
diff --git a/src/main/java/de/pixart/messenger/persistance/FileBackend.java b/src/main/java/de/pixart/messenger/persistance/FileBackend.java
index 4d9e09d00..e893ea129 100644
--- a/src/main/java/de/pixart/messenger/persistance/FileBackend.java
+++ b/src/main/java/de/pixart/messenger/persistance/FileBackend.java
@@ -595,15 +595,6 @@ public class FileBackend {
return context.getPackageName() + FILE_PROVIDER;
}
- public static Uri getIndexableTakePhotoUri(Uri original) {
- if ("file".equals(original.getScheme())) {
- return original;
- } else {
- List<String> segments = original.getPathSegments();
- return Uri.parse("file://" + getTakeFromCameraPath() + segments.get(segments.size() - 1));
- }
- }
-
public Uri getTakeVideoUri() {
File file = new File(getTakeFromCameraPath() + "VID_" + this.fileDateFormat.format(new Date()) + ".mp4");
file.getParentFile().mkdirs();
@@ -877,7 +868,7 @@ public class FileBackend {
return calcSampleSize(options, size);
}
- public static int calcSampleSize(BitmapFactory.Options options, int size) {
+ private static int calcSampleSize(BitmapFactory.Options options, int size) {
int height = options.outHeight;
int width = options.outWidth;
int inSampleSize = 1;
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;
}