本文整理汇总了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);
}