diff options
author | steckbrief <steckbrief@chefmail.de> | 2015-11-03 21:09:36 +0100 |
---|---|---|
committer | steckbrief <steckbrief@chefmail.de> | 2015-11-03 21:09:36 +0100 |
commit | b22d863c362bb6492240700c0f69f1a5d926f46b (patch) | |
tree | acf185af5312a97f18819efd3927c46b12a797d1 /src/main/java/de/thedevstack/conversationsplus/ui/ConversationActivity.java | |
parent | 11659eadb02b382804845d4e01a8536e02698468 (diff) |
Implements FS#26: Introduction of dialog to choose whether to resize a picture or not
Diffstat (limited to 'src/main/java/de/thedevstack/conversationsplus/ui/ConversationActivity.java')
-rw-r--r-- | src/main/java/de/thedevstack/conversationsplus/ui/ConversationActivity.java | 28 |
1 files changed, 5 insertions, 23 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/ui/ConversationActivity.java b/src/main/java/de/thedevstack/conversationsplus/ui/ConversationActivity.java index 64d4b521..3ae2a07a 100644 --- a/src/main/java/de/thedevstack/conversationsplus/ui/ConversationActivity.java +++ b/src/main/java/de/thedevstack/conversationsplus/ui/ConversationActivity.java @@ -30,6 +30,8 @@ import android.widget.Toast; import net.java.otr4j.session.SessionStatus; import de.thedevstack.conversationsplus.ConversationsPlusPreferences; +import de.thedevstack.conversationsplus.ui.dialogs.UserDecisionDialog; +import de.thedevstack.conversationsplus.ui.listeners.ResizePictureUserDecisionListener; import de.timroes.android.listview.EnhancedListView; import java.util.ArrayList; @@ -1129,29 +1131,9 @@ public class ConversationActivity extends XmppActivity if (conversation == null) { return; } - //TODO Resize setting - prepareFileToast = Toast.makeText(getApplicationContext(),getText(R.string.preparing_image), Toast.LENGTH_LONG); - prepareFileToast.show(); - xmppConnectionService.attachImageToConversation(conversation, uri, - new UiCallback<Message>() { - - @Override - public void userInputRequried(PendingIntent pi, - Message object) { - hidePrepareFileToast(); - } - - @Override - public void success(Message message) { - xmppConnectionService.sendMessage(message); - } - - @Override - public void error(int error, Message message) { - hidePrepareFileToast(); - displayErrorDialog(error); - } - }); + ResizePictureUserDecisionListener userDecisionListener = new ResizePictureUserDecisionListener(this, conversation, uri, xmppConnectionService); + UserDecisionDialog userDecisionDialog = new UserDecisionDialog(this, R.string.userdecision_question_resize_picture, userDecisionListener); + userDecisionDialog.decide(ConversationsPlusPreferences.resizePicture()); } private void hidePrepareFileToast() { |