From 477312ec289cf6e8afdd21cb5e56eec2d5215131 Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Thu, 12 Apr 2018 19:58:10 +0200 Subject: fix choose image --- .../pixart/messenger/ui/ConversationFragment.java | 26 ++++++++++------------ 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java index 70f88b227..e34bebcec 100644 --- a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java +++ b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java @@ -994,18 +994,17 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke selectPresenceToAttachFile(choice); break; case ATTACHMENT_CHOICE_CHOOSE_IMAGE: - List imageUris = AttachmentTool.extractUriFromIntent(data); - int ImageUrisCount = imageUris.size(); - if (activity.xmppConnectionServiceBound) { - if (ImageUrisCount == 1) { - Uri uri = imageUris.get(0); - Log.d(Config.LOGTAG, "ConversationsActivity.onActivityResult() - attaching image to conversations. CHOOSE_IMAGE"); - attachImageToConversation(conversation, uri, false); - } else { - for (Iterator i = imageUris.iterator(); i.hasNext(); i.remove()) { - Log.d(Config.LOGTAG, "ConversationsActivity.onActivityResult() - attaching images to conversations. CHOOSE_IMAGES"); - attachImagesToConversation(conversation, i.next()); - } + final List imageUris = AttachmentTool.extractUriFromIntent(data); + final int ImageUrisCount = imageUris.size(); + Log.d(Config.LOGTAG, "ConversationsActivity.onActivityResult() - attaching image - number of uris: " + ImageUrisCount); + if (ImageUrisCount == 1) { + Uri uri = imageUris.get(0); + Log.d(Config.LOGTAG, "ConversationsActivity.onActivityResult() - attaching image to conversations. CHOOSE_IMAGE"); + attachImageToConversation(conversation, uri, false); + } else { + for (Iterator i = imageUris.iterator(); i.hasNext(); i.remove()) { + Log.d(Config.LOGTAG, "ConversationsActivity.onActivityResult() - attaching images to conversations. CHOOSE_IMAGES"); + attachImagesToConversation(conversation, i.next()); } } break; @@ -2113,8 +2112,7 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke setSelection(pos); } } - // todo add swipe listener --> causes strange scrolling in chats - //this.binding.messagesView.setOnTouchListener(new OnSwipeTouchListener(getContext()) { + gesturesDetector.setOnFingerGestureListener(new SimpleFingerGestures.OnFingerGestureListener() { @Override public boolean onSwipeUp(int fingers, long gestureDuration, double gestureDistance) { -- cgit v1.2.3