use of com.odysee.app.tasks.verification.PhoneNewVerifyTask in project odysee-android by OdyseeTeam.
the class RewardVerificationPhoneFragment method addPhoneNumber.
private void addPhoneNumber() {
PhoneNewVerifyTask task = new PhoneNewVerifyTask(currentCountryCode, currentPhoneNumber, null, newLoading, new GenericTaskHandler() {
@Override
public void beforeStart() {
Helper.setViewEnabled(continueButton, false);
Helper.setViewVisibility(continueButton, View.GONE);
}
@Override
public void onSuccess() {
if (listener != null) {
listener.onPhoneAdded(currentCountryCode, currentPhoneNumber);
}
Helper.setViewText(textVerifyParagraph, getString(R.string.enter_phone_verify_code, countryCodePicker.getFullNumberWithPlus()));
Helper.setViewVisibility(layoutCollect, View.GONE);
Helper.setViewVisibility(layoutVerify, View.VISIBLE);
Helper.setViewEnabled(continueButton, true);
Helper.setViewVisibility(continueButton, View.VISIBLE);
}
@Override
public void onError(Exception error) {
if (error != null && getView() != null) {
Snackbar.make(getView(), error.getMessage(), Snackbar.LENGTH_LONG).setBackgroundTint(Color.RED).setTextColor(Color.WHITE).show();
}
Helper.setViewEnabled(continueButton, true);
Helper.setViewVisibility(continueButton, View.VISIBLE);
}
});
task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
use of com.odysee.app.tasks.verification.PhoneNewVerifyTask in project odysee-android by OdyseeTeam.
the class RewardVerificationPhoneFragment method verifyPhoneNumber.
private void verifyPhoneNumber(String verificationCode) {
PhoneNewVerifyTask task = new PhoneNewVerifyTask(currentCountryCode, currentPhoneNumber, verificationCode, verifyLoading, new GenericTaskHandler() {
@Override
public void beforeStart() {
Helper.setViewEnabled(verifyButton, false);
Helper.setViewEnabled(editButton, false);
}
@Override
public void onSuccess() {
if (listener != null) {
listener.onPhoneVerified();
}
Helper.setViewEnabled(verifyButton, true);
Helper.setViewEnabled(editButton, true);
}
@Override
public void onError(Exception error) {
if (getView() != null && error != null) {
Snackbar.make(getView(), error.getMessage(), Snackbar.LENGTH_LONG).setBackgroundTint(Color.RED).setTextColor(Color.WHITE).show();
}
Helper.setViewEnabled(verifyButton, true);
Helper.setViewEnabled(editButton, true);
}
});
task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
Aggregations