Fields Summary |
---|
public static final String[] | CONTACT_PROJECTION |
public static final int | CONTACT_ID_COLUMN |
public static final int | CONTACT_NAME_COLUMN |
public static final int | CONTACT_NOTES_COLUMN |
public static final int | CONTACT_PREFERRED_PHONE_COLUMN |
public static final int | CONTACT_SERVER_STATUS_COLUMN |
public static final int | CONTACT_STARRED_COLUMN |
public static final int | CONTACT_CUSTOM_RINGTONE_COLUMN |
public static final int | CONTACT_SEND_TO_VOICEMAIL_COLUMN |
public static final int | CONTACT_PHONETIC_NAME_COLUMN |
public static final String[] | PHONES_PROJECTION |
public static final int | PHONES_ID_COLUMN |
public static final int | PHONES_NUMBER_COLUMN |
public static final int | PHONES_TYPE_COLUMN |
public static final int | PHONES_LABEL_COLUMN |
public static final int | PHONES_ISPRIMARY_COLUMN |
public static final String[] | METHODS_PROJECTION |
public static final String[] | METHODS_WITH_PRESENCE_PROJECTION |
public static final int | METHODS_ID_COLUMN |
public static final int | METHODS_KIND_COLUMN |
public static final int | METHODS_DATA_COLUMN |
public static final int | METHODS_TYPE_COLUMN |
public static final int | METHODS_LABEL_COLUMN |
public static final int | METHODS_ISPRIMARY_COLUMN |
public static final int | METHODS_AUX_DATA_COLUMN |
public static final int | METHODS_STATUS_COLUMN |
public static final String[] | ORGANIZATIONS_PROJECTION |
public static final int | ORGANIZATIONS_ID_COLUMN |
public static final int | ORGANIZATIONS_TYPE_COLUMN |
public static final int | ORGANIZATIONS_LABEL_COLUMN |
public static final int | ORGANIZATIONS_COMPANY_COLUMN |
public static final int | ORGANIZATIONS_TITLE_COLUMN |
public static final int | ORGANIZATIONS_ISPRIMARY_COLUMN |
protected ArrayList | mSections |
protected android.view.LayoutInflater | mInflater |
protected android.content.Context | mContext |
protected boolean | mSeparators |
Methods Summary |
---|
public final boolean | areAllItemsEnabled()
return mSeparators == false;
|
protected abstract void | bindView(android.view.View view, E entry)Binds the data from an entry to a view.
|
public static int | countEntries(java.util.ArrayList sections, boolean separators)Get the count of entries in all sections
int count = 0;
int numSections = sections.size();
for (int i = 0; i < numSections; i++) {
ArrayList<T> section = sections.get(i);
int sectionSize = section.size();
if (separators && sectionSize == 1) {
// The section only contains a separator and nothing else, skip it
continue;
}
count += sections.get(i).size();
}
return count;
|
public final int | getCount()
return countEntries(mSections, mSeparators);
|
public static final T | getEntry(java.util.ArrayList sections, int position, boolean separators)Get the entry for the given position.
int numSections = sections.size();
for (int i = 0; i < numSections; i++) {
ArrayList<T> section = sections.get(i);
int sectionSize = section.size();
if (separators && sectionSize == 1) {
// The section only contains a separator and nothing else, skip it
continue;
}
if (position < section.size()) {
return section.get(position);
}
position -= section.size();
}
return null;
|
public final java.lang.Object | getItem(int position)
return getEntry(mSections, position, mSeparators);
|
public final long | getItemId(int position)
Entry entry = getEntry(mSections, position, mSeparators);
if (entry != null) {
return entry.id;
} else {
return -1;
}
|
public android.view.View | getView(int position, android.view.View convertView, android.view.ViewGroup parent)
View v;
if (convertView == null) {
v = newView(position, parent);
} else {
v = convertView;
}
bindView(v, getEntry(mSections, position, mSeparators));
return v;
|
public final boolean | isEnabled(int position)
if (!mSeparators) {
return true;
}
int numSections = mSections.size();
for (int i = 0; i < numSections; i++) {
ArrayList<E> section = mSections.get(i);
int sectionSize = section.size();
if (sectionSize == 1) {
// The section only contains a separator and nothing else, skip it
continue;
}
if (position == 0) {
// The first item in a section is always the separator
return false;
}
position -= sectionSize;
}
return true;
|
protected abstract android.view.View | newView(int position, android.view.ViewGroup parent)Create a new view for an entry.
|
public final void | setSections(java.util.ArrayList sections, boolean separators)Resets the section data.
mSections = sections;
mSeparators = separators;
notifyDataSetChanged();
|
public final int | setSections(java.util.ArrayList sections, E entry)Resets the section data and returns the position of the given entry.
mSections = sections;
notifyDataSetChanged();
int numSections = mSections.size();
int position = 0;
for (int i = 0; i < numSections; i++) {
ArrayList<E> section = mSections.get(i);
int sectionSize = section.size();
for (int j = 0; j < sectionSize; j++) {
E e = section.get(j);
if (e.equals(entry)) {
position += j;
return position;
}
}
position += sectionSize;
}
return -1;
|