diff options
Diffstat (limited to 'src/main/java/de/pixart/messenger/ui/EditAccountActivity.java')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/EditAccountActivity.java | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java b/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java index 26ebf5d4b..530180fae 100644 --- a/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java +++ b/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java @@ -79,6 +79,7 @@ import de.pixart.messenger.xmpp.XmppConnection; import de.pixart.messenger.xmpp.XmppConnection.Features; import de.pixart.messenger.xmpp.forms.Data; import de.pixart.messenger.xmpp.pep.Avatar; +import me.drakeet.support.toast.ToastCompat; import rocks.xmpp.addr.Jid; import static de.pixart.messenger.utils.PermissionUtils.allGranted; @@ -125,7 +126,7 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat if (mAccount != null && mAccount.getStatus() == Account.State.DISABLED && !accountInfoEdited) { mAccount.setOption(Account.OPTION_DISABLED, false); if (!xmppConnectionService.updateAccount(mAccount)) { - Toast.makeText(EditAccountActivity.this, R.string.unable_to_update_account, Toast.LENGTH_SHORT).show(); + ToastCompat.makeText(EditAccountActivity.this, R.string.unable_to_update_account, Toast.LENGTH_SHORT).show(); } return; } @@ -155,7 +156,7 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat if (inNeedOfSaslAccept()) { mAccount.setKey(Account.PINNED_MECHANISM_KEY, String.valueOf(-1)); if (!xmppConnectionService.updateAccount(mAccount)) { - Toast.makeText(EditAccountActivity.this, R.string.unable_to_update_account, Toast.LENGTH_SHORT).show(); + ToastCompat.makeText(EditAccountActivity.this, R.string.unable_to_update_account, Toast.LENGTH_SHORT).show(); } return; } @@ -169,7 +170,7 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat overridePendingTransition(R.animator.fade_in, R.animator.fade_out); return; } catch (ActivityNotFoundException e) { - Toast.makeText(EditAccountActivity.this, R.string.application_found_to_open_website, Toast.LENGTH_SHORT).show(); + ToastCompat.makeText(EditAccountActivity.this, R.string.application_found_to_open_website, Toast.LENGTH_SHORT).show(); return; } } @@ -241,7 +242,7 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat } if (registerNewAccount) { if (XmppConnection.errorMessage != null) { - Toast.makeText(EditAccountActivity.this, XmppConnection.errorMessage, Toast.LENGTH_LONG).show(); + ToastCompat.makeText(EditAccountActivity.this, XmppConnection.errorMessage, Toast.LENGTH_LONG).show(); } } if (mAccount != null) { @@ -259,7 +260,7 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat mAccount.setPassword(password); mAccount.setOption(Account.OPTION_REGISTER, registerNewAccount); if (!xmppConnectionService.updateAccount(mAccount)) { - Toast.makeText(EditAccountActivity.this, R.string.unable_to_update_account, Toast.LENGTH_SHORT).show(); + ToastCompat.makeText(EditAccountActivity.this, R.string.unable_to_update_account, Toast.LENGTH_SHORT).show(); return; } } else { @@ -505,11 +506,11 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat protected void processFingerprintVerification(XmppUri uri, boolean showWarningToast) { if (mAccount != null && mAccount.getJid().asBareJid().equals(uri.getJid()) && uri.hasFingerprints()) { if (xmppConnectionService.verifyFingerprints(mAccount, uri.getFingerprints())) { - Toast.makeText(this, R.string.verified_fingerprints, Toast.LENGTH_SHORT).show(); + ToastCompat.makeText(this, R.string.verified_fingerprints, Toast.LENGTH_SHORT).show(); updateAccountInformation(false); } } else if (showWarningToast) { - Toast.makeText(this, R.string.invalid_barcode, Toast.LENGTH_SHORT).show(); + ToastCompat.makeText(this, R.string.invalid_barcode, Toast.LENGTH_SHORT).show(); } } @@ -1310,7 +1311,7 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat this.binding.actionCopyToClipboard.setVisibility(View.VISIBLE); this.binding.actionCopyToClipboard.setOnClickListener(v -> { if (copyTextToClipboard(CryptoHelper.prettifyFingerprint(otrFingerprint), R.string.otr_fingerprint)) { - Toast.makeText( + ToastCompat.makeText( EditAccountActivity.this, R.string.toast_message_otr_fingerprint, Toast.LENGTH_SHORT).show(); @@ -1446,7 +1447,7 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat try { startActivityForResult(intent, REQUEST_DATA_SAVER); } catch (ActivityNotFoundException e) { - Toast.makeText(EditAccountActivity.this, R.string.device_does_not_support_data_saver, Toast.LENGTH_SHORT).show(); + ToastCompat.makeText(EditAccountActivity.this, R.string.device_does_not_support_data_saver, Toast.LENGTH_SHORT).show(); } }); } else if (showBatteryWarning && android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) { @@ -1460,7 +1461,7 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat try { startActivityForResult(intent, REQUEST_BATTERY_OP); } catch (ActivityNotFoundException e) { - Toast.makeText(EditAccountActivity.this, R.string.device_does_not_support_battery_op, Toast.LENGTH_SHORT).show(); + ToastCompat.makeText(EditAccountActivity.this, R.string.device_does_not_support_battery_op, Toast.LENGTH_SHORT).show(); } }); } @@ -1478,7 +1479,7 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat } private void editMamPrefs() { - this.mFetchingMamPrefsToast = Toast.makeText(this, R.string.fetching_mam_prefs, Toast.LENGTH_LONG); + this.mFetchingMamPrefsToast = ToastCompat.makeText(this, R.string.fetching_mam_prefs, Toast.LENGTH_LONG); this.mFetchingMamPrefsToast.show(); xmppConnectionService.fetchMamPreferences(mAccount, this); } @@ -1548,7 +1549,7 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat runOnUiThread(new Runnable() { @Override public void run() { - Toast.makeText(EditAccountActivity.this, resId, Toast.LENGTH_SHORT).show(); + ToastCompat.makeText(EditAccountActivity.this, resId, Toast.LENGTH_SHORT).show(); } }); } @@ -1580,7 +1581,7 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat if (mFetchingMamPrefsToast != null) { mFetchingMamPrefsToast.cancel(); } - Toast.makeText(EditAccountActivity.this, R.string.unable_to_fetch_mam_prefs, Toast.LENGTH_LONG).show(); + ToastCompat.makeText(EditAccountActivity.this, R.string.unable_to_fetch_mam_prefs, Toast.LENGTH_LONG).show(); }); } @@ -1594,7 +1595,7 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat 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)) { |