Lines Matching defs:partition

84      * Registers a partition. The cursor for that partition can be set later.
92 public void addPartition(Partition partition) {
93 mPartitions.add(partition);
98 public void addPartition(int location, Partition partition) {
99 mPartitions.add(location, partition);
121 for (Partition partition : mPartitions) {
122 partition.cursor = null;
132 for (Partition partition : mPartitions) {
133 Cursor cursor = partition.cursor;
171 for (Partition partition : mPartitions) {
172 Cursor cursor = partition.cursor;
179 if (partition.hasHeader) {
180 if (count != 0 || partition.showIfEmpty) {
184 partition.count = count;
192 * Returns true if the specified partition was configured to have a header.
194 public boolean hasHeader(int partition) {
195 return mPartitions.get(partition).hasHeader;
207 * Returns the cursor for the given partition
209 public Cursor getCursor(int partition) {
210 return mPartitions.get(partition).cursor;
214 * Changes the cursor for an individual partition.
216 public void changeCursor(int partition, Cursor cursor) {
217 Cursor prevCursor = mPartitions.get(partition).cursor;
222 mPartitions.get(partition).cursor = cursor;
224 mPartitions.get(partition).idColumnIndex = cursor.getColumnIndex("_id");
232 * Returns true if the specified partition has no cursor or an empty cursor.
234 public boolean isPartitionEmpty(int partition) {
235 Cursor cursor = mPartitions.get(partition).cursor;
240 * Given a list position, returns the index of the corresponding partition.
257 * partition. The header, if any, will have offset -1.
262 for (Partition partition : mPartitions) {
263 int end = start + partition.count;
266 if (partition.hasHeader) {
277 * Returns the first list position for the specified partition.
279 public int getPositionForPartition(int partition) {
282 for (int i = 0; i < partition; i++) {
304 * specified partition.
306 protected int getItemViewType(int partition, int position) {
354 throw new NullPointerException("View should not be null, partition: " + i
366 * Returns the header view for the specified partition, creating one if needed.
368 protected View getHeaderView(int partition, Cursor cursor, View convertView,
372 : newHeaderView(mContext, partition, cursor, parent);
373 bindHeaderView(view, partition, cursor);
378 * Creates the header view for the specified partition.
380 protected View newHeaderView(Context context, int partition, Cursor cursor,
386 * Binds the header view for the specified partition.
388 protected void bindHeaderView(View view, int partition, Cursor cursor) {
392 * Returns an item view for the specified partition, creating one if needed.
394 protected View getView(int partition, Cursor cursor, int position, View convertView,
400 view = newView(mContext, partition, cursor, position, parent);
402 bindView(view, partition, cursor, position);
407 * Creates an item view for the specified partition and position. Position
410 protected abstract View newView(Context context, int partition, Cursor cursor, int position,
414 * Binds an item view for the specified partition and position. Position
417 protected abstract void bindView(View v, int partition, Cursor cursor, int position);
480 * Returns false if any partition has a header.
517 * partition is selectable and clickable.
519 protected boolean isEnabled(int partition, int position) {