From 851f7b073db781281a85fd369ea92ff0bc31ce7e Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Fri, 31 Jan 2020 15:02:33 +0100 Subject: use ToastCompat instead of Toast --- .../java/de/pixart/messenger/ui/ManageAccountActivity.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/main/java/de/pixart/messenger/ui/ManageAccountActivity.java') diff --git a/src/main/java/de/pixart/messenger/ui/ManageAccountActivity.java b/src/main/java/de/pixart/messenger/ui/ManageAccountActivity.java index f464cc6ae..67201ba03 100644 --- a/src/main/java/de/pixart/messenger/ui/ManageAccountActivity.java +++ b/src/main/java/de/pixart/messenger/ui/ManageAccountActivity.java @@ -33,6 +33,7 @@ import de.pixart.messenger.services.XmppConnectionService.OnAccountUpdate; import de.pixart.messenger.ui.adapter.AccountAdapter; import de.pixart.messenger.utils.MenuDoubleTabUtil; import de.pixart.messenger.xmpp.XmppConnection; +import me.drakeet.support.toast.ToastCompat; import rocks.xmpp.addr.Jid; import static de.pixart.messenger.utils.PermissionUtils.allGranted; @@ -220,7 +221,7 @@ public class ManageAccountActivity extends XmppActivity implements OnAccountUpda break; } } else { - Toast.makeText(this, R.string.no_storage_permission, Toast.LENGTH_SHORT).show(); + ToastCompat.makeText(this, R.string.no_storage_permission, Toast.LENGTH_SHORT).show(); } } if (readGranted(grantResults, permissions)) { @@ -264,7 +265,7 @@ public class ManageAccountActivity extends XmppActivity implements OnAccountUpda try { KeyChain.choosePrivateKeyAlias(this, this, null, null, null, -1, null); } catch (ActivityNotFoundException e) { - Toast.makeText(this, R.string.device_does_not_support_certificates, Toast.LENGTH_LONG).show(); + ToastCompat.makeText(this, R.string.device_does_not_support_certificates, Toast.LENGTH_LONG).show(); } } @@ -329,7 +330,7 @@ public class ManageAccountActivity extends XmppActivity implements OnAccountUpda private void disableAccount(Account account) { account.setOption(Account.OPTION_DISABLED, true); if (!xmppConnectionService.updateAccount(account)) { - Toast.makeText(this, R.string.unable_to_update_account, Toast.LENGTH_SHORT).show(); + ToastCompat.makeText(this, R.string.unable_to_update_account, Toast.LENGTH_SHORT).show(); } } @@ -340,7 +341,7 @@ public class ManageAccountActivity extends XmppActivity implements OnAccountUpda connection.resetEverything(); } if (!xmppConnectionService.updateAccount(account)) { - Toast.makeText(this, R.string.unable_to_update_account, Toast.LENGTH_SHORT).show(); + ToastCompat.makeText(this, R.string.unable_to_update_account, Toast.LENGTH_SHORT).show(); } } @@ -423,6 +424,6 @@ public class ManageAccountActivity extends XmppActivity implements OnAccountUpda @Override public void informUser(final int r) { - runOnUiThread(() -> Toast.makeText(ManageAccountActivity.this, r, Toast.LENGTH_LONG).show()); + runOnUiThread(() -> ToastCompat.makeText(ManageAccountActivity.this, r, Toast.LENGTH_LONG).show()); } } -- cgit v1.2.3