aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2016-10-05 21:40:04 +0200
committerChristian Schneppe <christian@pix-art.de>2016-10-05 21:40:04 +0200
commit11bddfe2b1fbb3dd02ebe0290e58f842ec28ef16 (patch)
tree4a4e19bcaaf8196da560d8b58a29bb2c89428de3 /src/main/java/de/pixart/messenger
parent28a47fcc2f67e2385a90237e9bdf2d360ee96f75 (diff)
differentiate between pending image and pending photo uris
fix duplicate sendings
Diffstat (limited to 'src/main/java/de/pixart/messenger')
-rw-r--r--src/main/java/de/pixart/messenger/ui/ConversationActivity.java22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ConversationActivity.java b/src/main/java/de/pixart/messenger/ui/ConversationActivity.java
index 478156bea..82be2098c 100644
--- a/src/main/java/de/pixart/messenger/ui/ConversationActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/ConversationActivity.java
@@ -109,7 +109,8 @@ public class ConversationActivity extends XmppActivity
public static final int ATTACHMENT_CHOICE_INVALID = 0x0399;
private static final String STATE_OPEN_CONVERSATION = "state_open_conversation";
private static final String STATE_PANEL_OPEN = "state_panel_open";
- private static final String STATE_PENDING_URI = "state_pending_uri";
+ private static final String STATE_PENDING_IMAGE_URI = "state_pending_image_uri";
+ private static final String STATE_PENDING_PHOTO_URI = "state_pending_photo_uri";
private static final String STATE_FIRST_VISIBLE = "first_visible";
private static final String STATE_OFFSET_FROM_TOP = "offset_from_top";
final private List<Uri> mPendingImageUris = new ArrayList<>();
@@ -204,12 +205,18 @@ public class ConversationActivity extends XmppActivity
} else {
mScrollPosition = null;
}
- String pending = savedInstanceState.getString(STATE_PENDING_URI, null);
- if (pending != null) {
+ String pending_image = savedInstanceState.getString(STATE_PENDING_IMAGE_URI, null);
+ if (pending_image != null) {
Log.d(Config.LOGTAG,"ConversationsActivity.onCreate() - restoring pending image uri");
mPendingImageUris.clear();
- mPendingImageUris.add(Uri.parse(pending));
+ mPendingImageUris.add(Uri.parse(pending_image));
}
+ String pending_photo = savedInstanceState.getString(STATE_PENDING_PHOTO_URI, null);
+ if (pending_photo != null) {
+ Log.d(Config.LOGTAG,"ConversationsActivity.onCreate() - restoring pending photo uri");
+ mPendingPhotoUris.clear();
+ mPendingPhotoUris.add(Uri.parse(pending_photo));
+ }
}
setContentView(R.layout.fragment_conversations_overview);
@@ -1348,11 +1355,12 @@ public class ConversationActivity extends XmppActivity
savedInstanceState.putBoolean(STATE_PANEL_OPEN, isConversationsOverviewVisable());
if (this.mPendingImageUris.size() >= 1) {
Log.d(Config.LOGTAG,"ConversationsActivity.onSaveInstanceState() - saving pending image uri");
- savedInstanceState.putString(STATE_PENDING_URI, this.mPendingImageUris.get(0).toString());
+ savedInstanceState.putString(STATE_PENDING_IMAGE_URI, this.mPendingImageUris.get(0).toString());
} else if (this.mPendingPhotoUris.size() >= 1) {
- savedInstanceState.putString(STATE_PENDING_URI, this.mPendingPhotoUris.get(0).toString());
+ savedInstanceState.putString(STATE_PENDING_PHOTO_URI, this.mPendingPhotoUris.get(0).toString());
} else {
- savedInstanceState.remove(STATE_PENDING_URI);
+ savedInstanceState.remove(STATE_PENDING_IMAGE_URI);
+ savedInstanceState.remove(STATE_PENDING_PHOTO_URI);
}
super.onSaveInstanceState(savedInstanceState);
}