当前位置: 首页>>代码示例>>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;未经允许,请勿转载。