diff options
Diffstat (limited to 'src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java b/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java index 745ed67c7..7f9e971d3 100644 --- a/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java +++ b/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java @@ -24,6 +24,7 @@ import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.View.OnClickListener; +import android.view.WindowManager; import android.widget.ImageView; import android.widget.Toast; @@ -66,6 +67,7 @@ import de.pixart.messenger.utils.StylingHelper; import de.pixart.messenger.utils.TimeframeUtils; import de.pixart.messenger.utils.UIHelper; import de.pixart.messenger.utils.XmppUri; +import me.drakeet.support.toast.ToastCompat; import rocks.xmpp.addr.Jid; import static de.pixart.messenger.entities.Bookmark.printableValue; @@ -113,8 +115,8 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers private UiCallback<Conversation> renameCallback = new UiCallback<Conversation>() { @Override public void success(Conversation object) { + displayToast(getString(R.string.your_nick_has_been_changed)); runOnUiThread(() -> { - Toast.makeText(ConferenceDetailsActivity.this, getString(R.string.your_nick_has_been_changed), Toast.LENGTH_SHORT).show(); updateView(); }); @@ -122,7 +124,7 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers @Override public void error(final int errorCode, Conversation object) { - runOnUiThread(() -> Toast.makeText(ConferenceDetailsActivity.this, getString(errorCode), Toast.LENGTH_SHORT).show()); + displayToast(getString(errorCode)); } @Override @@ -466,7 +468,7 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers this.mSelectedUser = user; String name; final Contact contact = user.getContact(); - if (contact != null && contact.showInRoster()) { + if (contact != null && contact.showInContactList()) { name = contact.getDisplayName(); } else if (user.getRealJid() != null) { name = user.getRealJid().asBareJid().toString(); @@ -785,7 +787,12 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers } private void displayToast(final String msg) { - runOnUiThread(() -> Toast.makeText(ConferenceDetailsActivity.this, msg, Toast.LENGTH_SHORT).show()); + runOnUiThread(() -> { + if (isFinishing()) { + return; + } + ToastCompat.makeText(this, msg, Toast.LENGTH_SHORT).show(); + }); } public void loadAvatar(User user, ImageView imageView) { |