use of cx.ring.utils.NameLookupInputHandler in project ring-client-android by savoirfairelinux.
the class RingSearchPresenter method queryTextChanged.
public void queryTextChanged(String query) {
if (query.equals("")) {
getView().clearSearch();
} else {
Account currentAccount = mAccountService.getCurrentAccount();
if (currentAccount == null) {
return;
}
Uri uri = new Uri(query);
if (uri.isRingId()) {
mCallContact = CallContact.buildUnknown(uri);
getView().displayContact(mCallContact);
} else {
getView().clearSearch();
// Ring search
if (mNameLookupInputHandler == null) {
mNameLookupInputHandler = new NameLookupInputHandler(mAccountService, currentAccount.getAccountID());
}
mLastBlockchainQuery = query;
mNameLookupInputHandler.enqueueNextLookup(query);
}
}
}
use of cx.ring.utils.NameLookupInputHandler in project ring-client-android by savoirfairelinux.
the class SmartListPresenter method queryTextChanged.
public void queryTextChanged(String query) {
if (query.equals("")) {
getView().hideSearchRow();
getView().setLoading(false);
} else {
Account currentAccount = mAccountService.getCurrentAccount();
if (currentAccount == null) {
return;
}
if (currentAccount.isSip()) {
// sip search
mCallContact = CallContact.buildUnknown(query, null);
getView().displayContact(mCallContact);
} else {
Uri uri = new Uri(query);
if (uri.isRingId()) {
mCallContact = CallContact.buildUnknown(uri);
getView().displayContact(mCallContact);
} else {
getView().hideSearchRow();
// Ring search
if (mNameLookupInputHandler == null) {
mNameLookupInputHandler = new NameLookupInputHandler(mAccountService, currentAccount.getAccountID());
}
mLastBlockchainQuery = query;
mNameLookupInputHandler.enqueueNextLookup(query);
getView().setLoading(true);
}
}
}
getView().updateList(filter(mSmartListViewModels, query));
}
use of cx.ring.utils.NameLookupInputHandler in project ring-client-android by savoirfairelinux.
the class RingAccountCreationPresenter method userNameChanged.
public void userNameChanged(String userName) {
if (!userName.isEmpty()) {
if (mNameLookupInputHandler == null) {
mNameLookupInputHandler = new NameLookupInputHandler(mAccountService, "");
}
mRingAccountViewModel.setUsername(userName);
mNameLookupInputHandler.enqueueNextLookup(userName);
isRingUserNameCorrect = false;
getView().enableTextError();
} else {
getView().disableTextError();
}
checkForms();
}
Aggregations