Lines Matching defs:partition

80      * Registers a partition. The cursor for that partition can be set later.
88 public void addPartition(Partition partition) {
89 mPartitions.add(partition);
94 public void addPartition(int location, Partition partition) {
95 mPartitions.add(location, partition);
117 for (Partition partition : mPartitions) {
118 partition.cursor = null;
128 for (Partition partition : mPartitions) {
129 Cursor cursor = partition.cursor;
167 for (Partition partition : mPartitions) {
168 Cursor cursor = partition.cursor;
170 if (partition.hasHeader) {
171 if (count != 0 || partition.showIfEmpty) {
175 partition.count = count;
183 * Returns true if the specified partition was configured to have a header.
185 public boolean hasHeader(int partition) {
186 return mPartitions.get(partition).hasHeader;
198 * Returns the cursor for the given partition
200 public Cursor getCursor(int partition) {
201 return mPartitions.get(partition).cursor;
205 * Changes the cursor for an individual partition.
207 public void changeCursor(int partition, Cursor cursor) {
208 Cursor prevCursor = mPartitions.get(partition).cursor;
213 mPartitions.get(partition).cursor = cursor;
215 mPartitions.get(partition).idColumnIndex = cursor.getColumnIndex("_id");
223 * Returns true if the specified partition has no cursor or an empty cursor.
225 public boolean isPartitionEmpty(int partition) {
226 Cursor cursor = mPartitions.get(partition).cursor;
231 * Given a list position, returns the index of the corresponding partition.
248 * partition. The header, if any, will have offset -1.
253 for (Partition partition : mPartitions) {
254 int end = start + partition.count;
257 if (partition.hasHeader) {
268 * Returns the first list position for the specified partition.
270 public int getPositionForPartition(int partition) {
273 for (int i = 0; i < partition; i++) {
295 * specified partition.
297 protected int getItemViewType(int partition, int position) {
345 throw new NullPointerException("View should not be null, partition: " + i
357 * Returns the header view for the specified partition, creating one if needed.
359 protected View getHeaderView(int partition, Cursor cursor, View convertView,
363 : newHeaderView(mContext, partition, cursor, parent);
364 bindHeaderView(view, partition, cursor);
369 * Creates the header view for the specified partition.
371 protected View newHeaderView(Context context, int partition, Cursor cursor,
377 * Binds the header view for the specified partition.
379 protected void bindHeaderView(View view, int partition, Cursor cursor) {
383 * Returns an item view for the specified partition, creating one if needed.
385 protected View getView(int partition, Cursor cursor, int position, View convertView,
391 view = newView(mContext, partition, cursor, position, parent);
393 bindView(view, partition, cursor, position);
398 * Creates an item view for the specified partition and position. Position
401 protected abstract View newView(Context context, int partition, Cursor cursor, int position,
405 * Binds an item view for the specified partition and position. Position
408 protected abstract void bindView(View v, int partition, Cursor cursor, int position);
469 * Returns false if any partition has a header.
506 * partition is selectable and clickable.
508 protected boolean isEnabled(int partition, int position) {