use of com.odysee.app.tasks.verification.EmailResendTask in project odysee-android by OdyseeTeam.
the class EmailVerificationFragment method resendEmail.
private void resendEmail() {
EmailResendTask task = new EmailResendTask(currentEmail, null, new GenericTaskHandler() {
@Override
public void beforeStart() {
Helper.setViewEnabled(buttonResend, false);
}
@Override
public void onSuccess() {
View view = getView();
if (view != null) {
Snackbar.make(view, R.string.please_follow_instructions, Snackbar.LENGTH_LONG).show();
}
Helper.setViewEnabled(buttonResend, true);
}
@Override
public void onError(Exception error) {
View view = getView();
if (view != null && error != null) {
Snackbar.make(view, error.getMessage(), Snackbar.LENGTH_LONG).setBackgroundTint(Color.RED).setTextColor(Color.WHITE).show();
}
Helper.setViewEnabled(buttonResend, true);
}
});
task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
Aggregations