Search in sources :

Example 16 with Account

use of cx.ring.model.Account in project ring-client-android by savoirfairelinux.

the class SharePresenter method loadContactInformation.

public void loadContactInformation() {
    if (getView() == null) {
        return;
    }
    // ask for the current account
    Account currentAccount = mAccountService.getCurrentAccount();
    // let the view display the ViewModel
    getView().showViewModel(new ShareViewModel(currentAccount));
}
Also used : Account(cx.ring.model.Account)

Example 17 with Account

use of cx.ring.model.Account in project ring-client-android by savoirfairelinux.

the class SmartListPresenter method loadConversations.

private void loadConversations() {
    if (mAccountService.getCurrentAccount() == null) {
        Log.w(TAG, "loadConversations: Not able to get current account");
        return;
    }
    getView().setLoading(true);
    Account currentAccount = mAccountService.getCurrentAccount();
    if (currentAccount == null) {
        Log.e(TAG, "loadConversations: Not able to get currentAccount");
        return;
    }
    if (currentAccount.isSip()) {
        loadContacts();
    } else {
        loadHistory();
    }
}
Also used : Account(cx.ring.model.Account)

Example 18 with Account

use of cx.ring.model.Account 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));
}
Also used : Account(cx.ring.model.Account) NameLookupInputHandler(cx.ring.utils.NameLookupInputHandler) Uri(cx.ring.model.Uri)

Example 19 with Account

use of cx.ring.model.Account in project ring-client-android by savoirfairelinux.

the class RingNavigationViewModel method getVcard.

public VCard getVcard(File filesDir) {
    Account account = mAccount.get();
    if (account == null) {
        return null;
    }
    String accountId = isAccountValid() ? account.getAccountID() : null;
    return VCardUtils.loadLocalProfileFromDisk(filesDir, accountId);
}
Also used : Account(cx.ring.model.Account)

Example 20 with Account

use of cx.ring.model.Account in project ring-client-android by savoirfairelinux.

the class RingAccountSummaryPresenter method handleKnownDevices.

private void handleKnownDevices(ServiceEvent event) {
    String accountId = event.getEventInput(ServiceEvent.EventInput.ACCOUNT_ID, String.class);
    Account currentAccount = mAccountService.getAccount(mAccountID);
    if (currentAccount == null || !mAccountID.equals(accountId) || getView() == null) {
        return;
    }
    final StringMap devices = event.getEventInput(ServiceEvent.EventInput.DEVICES, StringMap.class);
    getView().updateDeviceList(devices.toNative(), currentAccount.getDeviceId());
}
Also used : Account(cx.ring.model.Account) StringMap(cx.ring.daemon.StringMap)

Aggregations

Account (cx.ring.model.Account)39 ServiceEvent (cx.ring.model.ServiceEvent)13 CallContact (cx.ring.model.CallContact)7 Uri (cx.ring.model.Uri)6 StringMap (cx.ring.daemon.StringMap)5 ArrayList (java.util.ArrayList)5 Conversation (cx.ring.model.Conversation)4 TrustRequest (cx.ring.model.TrustRequest)4 HashMap (java.util.HashMap)3 List (java.util.List)3 Map (java.util.Map)3 Conference (cx.ring.model.Conference)2 SecureSipCall (cx.ring.model.SecureSipCall)2 SipCall (cx.ring.model.SipCall)2 NameLookupInputHandler (cx.ring.utils.NameLookupInputHandler)2 Drawable (android.graphics.drawable.Drawable)1 LayoutInflater (android.view.LayoutInflater)1 View (android.view.View)1 ImageView (android.widget.ImageView)1 TextView (android.widget.TextView)1