Search in sources :

Example 1 with MobileNumber

use of com.voipgrid.vialer.api.models.MobileNumber in project vialer-android by VoIPGRID.

the class SetupActivity method onUpdateMobileNumber.

@Override
public void onUpdateMobileNumber(Fragment fragment, String mobileNumber) {
    enableProgressBar(true);
    AccountHelper accountHelper = new AccountHelper(this);
    boolean success = createAPIService(accountHelper.getEmail(), accountHelper.getPassword());
    // Post mobileNumber to VoIPGRID platform.
    if (success) {
        Call<MobileNumber> call = mApi.mobileNumber(new MobileNumber(mobileNumber));
        call.enqueue(this);
    }
}
Also used : AccountHelper(com.voipgrid.vialer.util.AccountHelper) PhoneAccountHelper(com.voipgrid.vialer.util.PhoneAccountHelper) MobileNumber(com.voipgrid.vialer.api.models.MobileNumber)

Example 2 with MobileNumber

use of com.voipgrid.vialer.api.models.MobileNumber in project vialer-android by VoIPGRID.

the class AccountActivity method save.

private void save() {
    findViewById(R.id.container).setFocusableInTouchMode(true);
    String number = ((EditText) findViewById(R.id.account_mobile_number_edit_text)).getText().toString();
    number = PhoneNumberUtils.formatMobileNumber(number);
    Api api = ServiceGenerator.createService(this, Api.class, getString(R.string.api_url), getEmail(), getPassword());
    Call<MobileNumber> call = api.mobileNumber(new MobileNumber(number));
    call.enqueue(this);
    mSystemUser.setMobileNumber(number);
    populate();
}
Also used : MobileNumber(com.voipgrid.vialer.api.models.MobileNumber) Api(com.voipgrid.vialer.api.Api)

Aggregations

MobileNumber (com.voipgrid.vialer.api.models.MobileNumber)2 Api (com.voipgrid.vialer.api.Api)1 AccountHelper (com.voipgrid.vialer.util.AccountHelper)1 PhoneAccountHelper (com.voipgrid.vialer.util.PhoneAccountHelper)1