當前位置: 首頁>>代碼示例>>Java>>正文


Java ContactsLoaded類代碼示例

本文整理匯總了Java中com.onegravity.contactpicker.contact.ContactsLoaded的典型用法代碼示例。如果您正苦於以下問題:Java ContactsLoaded類的具體用法?Java ContactsLoaded怎麽用?Java ContactsLoaded使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ContactsLoaded類屬於com.onegravity.contactpicker.contact包,在下文中一共展示了ContactsLoaded類的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onContactChecked

import com.onegravity.contactpicker.contact.ContactsLoaded; //導入依賴的package包/類
@Override
public void onContactChecked(Contact contact, boolean wasChecked, boolean isChecked) {
    if (!wasChecked && isChecked && mSelectContactsLimit > 0 &&
            mNrOfSelectedContacts + 1 > mSelectContactsLimit) {
        contact.setChecked(false, true);
        ContactsLoaded.post(mContacts);
        Toast.makeText(ContactPickerActivity.this, mLimitReachedMessage,
                Toast.LENGTH_LONG).show();
    } else if (wasChecked != isChecked) {
        mNrOfSelectedContacts += isChecked ? 1 : -1;
        mNrOfSelectedContacts = Math.min(mContacts.size(), Math.max(0, mNrOfSelectedContacts));
        updateTitle();

        if (!isChecked) {
            processGroupSelection();
        }
    }
}
 
開發者ID:hwding,項目名稱:templated-messaging,代碼行數:19,代碼來源:ContactPickerActivity.java

示例2: processContactSelection

import com.onegravity.contactpicker.contact.ContactsLoaded; //導入依賴的package包/類
/**
 * Check/un-check contacts for a group that has been selected/deselected.
 * Call this when a group has been selected/deselected or after a ContactSelectionChanged event.
 */
private void processContactSelection(Group group, boolean isChecked) {
    if (group == null || mContacts == null) return;

    // check/un-check contacts
    boolean hasChanged = false;
    for (Contact contact : group.getContacts()) {
        if (contact.isChecked() != isChecked) {
            contact.setChecked(isChecked, true);
            hasChanged = true;
        }
    }

    if (hasChanged) {
        ContactsLoaded.post(mContacts);
        calcNrOfSelectedContacts();
    }
}
 
開發者ID:hwding,項目名稱:templated-messaging,代碼行數:22,代碼來源:ContactPickerActivity.java

示例3: processContactSelection

import com.onegravity.contactpicker.contact.ContactsLoaded; //導入依賴的package包/類
/**
 * Check/un-check contacts for a group that has been selected/deselected.
 * Call this when a group has been selected/deselected or after a ContactSelectionChanged event.
 */
private void processContactSelection(Group group, boolean isChecked) {
    if (group == null || mContacts == null) return;

    updateSelectedGroupIds(mSelectedGroupIds, group.getId(), isChecked);

    // check/un-check contacts
    boolean hasChanged = false;
    for (Contact contact : group.getContacts()) {
        if (contact.isChecked() != isChecked) {
            contact.setChecked(isChecked, true);
            hasChanged = true;
        }
    }

    if (hasChanged) {
        updateSelectContacts();
        ContactsLoaded.post(mContacts);
    }
}
 
開發者ID:1gravity,項目名稱:Android-ContactPicker,代碼行數:24,代碼來源:ContactPickerActivity.java

示例4: onContactChecked

import com.onegravity.contactpicker.contact.ContactsLoaded; //導入依賴的package包/類
@Override
public void onContactChecked(Contact contact, boolean wasChecked, boolean isChecked) {
    if (!wasChecked && isChecked && mSelectContactsLimit > 0 &&
            mNrOfSelectedContacts + 1 > mSelectContactsLimit) {
        contact.setChecked(false, true);
        ContactsLoaded.post(mContacts);
        Toast.makeText(ContactPickerActivity.this, mLimitReachedMessage,
                Toast.LENGTH_LONG).show();
    } else if (wasChecked != isChecked) {
        mNrOfSelectedContacts += isChecked ? 1 : -1;
        mNrOfSelectedContacts = Math.min(mContacts.size(), Math.max(0, mNrOfSelectedContacts));
        updateTitle();
    }
}
 
開發者ID:adithya321,項目名稱:SOS-The-Healthcare-Companion,代碼行數:15,代碼來源:ContactPickerActivity.java

示例5: sortAndPostCopy

import com.onegravity.contactpicker.contact.ContactsLoaded; //導入依賴的package包/類
/**
 * For concurrency reasons we create a copy of the contacts list before it's sorted and sent to
 * the ContactFragment. Note: this affects only the list itself, individual contacts are still
 * shared between the Activity and the Fragment (and its adapter).
 */
private void sortAndPostCopy(List<ContactImpl> contacts) {
    List<ContactImpl> copy = new ArrayList<>();
    copy.addAll(contacts);
    Collections.sort(copy, mContactComparator);
    ContactsLoaded.post(copy);
}
 
開發者ID:adithya321,項目名稱:SOS-The-Healthcare-Companion,代碼行數:12,代碼來源:ContactPickerActivity.java

示例6: onContactChecked

import com.onegravity.contactpicker.contact.ContactsLoaded; //導入依賴的package包/類
@Override
public void onContactChecked(Contact contact, boolean wasChecked, boolean isChecked) {
    if (isAboveContactLimit(1, wasChecked, isChecked)){
        contact.setChecked(false, true);
        ContactsLoaded.post(mContacts);
        Toast.makeText(ContactPickerActivity.this, mLimitReachedMessage,
                Toast.LENGTH_LONG).show();
    } else {
        updateSelectContacts();

        if (!isChecked) {
            processGroupSelection();
        }
    }
}
 
開發者ID:1gravity,項目名稱:Android-ContactPicker,代碼行數:16,代碼來源:ContactPickerActivity.java

示例7: onLoaderReset

import com.onegravity.contactpicker.contact.ContactsLoaded; //導入依賴的package包/類
@Override
public void onLoaderReset(Loader<Cursor> loader) {
    ContactsLoaded.post(null);
}
 
開發者ID:adithya321,項目名稱:SOS-The-Healthcare-Companion,代碼行數:5,代碼來源:ContactPickerActivity.java

示例8: onLoaderReset

import com.onegravity.contactpicker.contact.ContactsLoaded; //導入依賴的package包/類
@Override
public void onLoaderReset(Loader<Cursor> loader) {
    ContactsLoaded.post(null);
    GroupsLoaded.post(null);
}
 
開發者ID:hwding,項目名稱:templated-messaging,代碼行數:6,代碼來源:ContactPickerActivity.java


注:本文中的com.onegravity.contactpicker.contact.ContactsLoaded類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。