本文整理匯總了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();
}
}
}
示例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();
}
}
示例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);
}
}
示例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();
}
}
示例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);
}
示例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();
}
}
}
示例7: onLoaderReset
import com.onegravity.contactpicker.contact.ContactsLoaded; //導入依賴的package包/類
@Override
public void onLoaderReset(Loader<Cursor> loader) {
ContactsLoaded.post(null);
}
示例8: onLoaderReset
import com.onegravity.contactpicker.contact.ContactsLoaded; //導入依賴的package包/類
@Override
public void onLoaderReset(Loader<Cursor> loader) {
ContactsLoaded.post(null);
GroupsLoaded.post(null);
}