hiding the prepare image toast after error or success

This commit is contained in:
Daniel Gultsch 2014-05-14 18:43:58 +02:00
parent 08a26d2772
commit ca7e24c30d
2 changed files with 15 additions and 3 deletions

View file

@ -384,7 +384,6 @@ public class ConversationActivity extends XmppActivity {
@Override
public void error(int error) {
displayErrorDialog(error);
}
});
} else {
@ -728,22 +727,37 @@ public class ConversationActivity extends XmppActivity {
@Override
public void userInputRequried(PendingIntent pi) {
hidePrepareImageToast();
ConversationActivity.this.runIntent(pi, ConversationActivity.REQUEST_SEND_PGP_IMAGE);
}
@Override
public void success() {
sendPendingImageMessage();
hidePrepareImageToast();
}
@Override
public void error(int error) {
hidePrepareImageToast();
pendingMessage = null;
displayErrorDialog(error);
}
});
}
private void hidePrepareImageToast() {
if (prepareImageToast!=null) {
runOnUiThread(new Runnable() {
@Override
public void run() {
prepareImageToast.cancel();
}
});
}
}
private void sendPendingImageMessage() {
pendingMessage.getConversation().getMessages().add(pendingMessage);
xmppConnectionService.databaseBackend.createMessage(pendingMessage);

View file

@ -1,7 +1,5 @@
package eu.siacs.conversations.ui;
import java.nio.channels.AlreadyConnectedException;
import eu.siacs.conversations.R;
import eu.siacs.conversations.entities.Account;
import eu.siacs.conversations.entities.Conversation;