From 298e5757cdfcdeacdd1d219ce314d52089fc2823 Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Fri, 29 Jun 2018 22:14:21 +0200 Subject: show toast before finishing publish activity --- .../ui/PublishGroupChatProfilePictureActivity.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/main/java/de/pixart/messenger') diff --git a/src/main/java/de/pixart/messenger/ui/PublishGroupChatProfilePictureActivity.java b/src/main/java/de/pixart/messenger/ui/PublishGroupChatProfilePictureActivity.java index a4bf6b440..0a8ec2e7f 100644 --- a/src/main/java/de/pixart/messenger/ui/PublishGroupChatProfilePictureActivity.java +++ b/src/main/java/de/pixart/messenger/ui/PublishGroupChatProfilePictureActivity.java @@ -51,12 +51,8 @@ import de.pixart.messenger.ui.util.PendingItem; public class PublishGroupChatProfilePictureActivity extends XmppActivity implements OnAvatarPublication { - private static final int REQUEST_CHOOSE_FILE = 0xac24; - - private ActivityPublishProfilePictureBinding binding; - private final PendingItem pendingConversationUuid = new PendingItem<>(); - + private ActivityPublishProfilePictureBinding binding; private Conversation conversation; private Uri uri; @@ -110,6 +106,8 @@ public class PublishGroupChatProfilePictureActivity extends XmppActivity impleme private void publish(View view) { + binding.publishButton.setText(R.string.publishing); + binding.publishButton.setEnabled(false); xmppConnectionService.publishMucAvatar(conversation, uri, this); } @@ -141,13 +139,16 @@ public class PublishGroupChatProfilePictureActivity extends XmppActivity impleme @Override public void onAvatarPublicationSucceeded() { - finish(); + runOnUiThread(() -> { + Toast.makeText(this, R.string.avatar_has_been_published, Toast.LENGTH_SHORT).show(); + finish(); + }); } @Override public void onAvatarPublicationFailed(@StringRes int res) { runOnUiThread(() -> { - Toast.makeText(this,res,Toast.LENGTH_SHORT).show(); + Toast.makeText(this, res, Toast.LENGTH_SHORT).show(); this.binding.publishButton.setText(R.string.publish); this.binding.publishButton.setEnabled(true); }); -- cgit v1.2.3