Lines Matching refs:index

65      * Add a view to the ViewGroup at an index
68 * @param index Index of the child from the regular perspective (excluding hidden views).
69 * ChildHelper offsets this index to actual ViewGroup index.
72 void addView(View child, int index, boolean hidden) {
74 if (index < 0) {
77 offset = getOffset(index);
85 Log.d(TAG, "addViewAt " + index + ",h:" + hidden + ", " + this);
89 private int getOffset(int index) {
90 if (index < 0) {
94 int offset = index;
97 final int diff = index - (offset - removedBefore);
116 int index = mCallback.indexOfChild(view);
117 if (index < 0) {
120 mCallback.removeViewAt(index);
121 if (mBucket.remove(index)) {
125 Log.d(TAG, "remove View off:" + index + "," + this);
130 * Removes the view at the provided index from RecyclerView.
132 * @param index Index of the child from the regular perspective (excluding hidden views).
133 * ChildHelper offsets this index to actual ViewGroup index.
135 void removeViewAt(int index) {
136 final int offset = getOffset(index);
146 Log.d(TAG, "removeViewAt " + index + ", off:" + offset + ", " + this);
151 * Returns the child at provided index.
153 * @param index Index of the child to return in regular perspective.
155 View getChildAt(int index) {
156 final int offset = getOffset(index);
196 * @param index Index of the child to attach in regular perspective.
200 void attachViewToParent(View child, int index, ViewGroup.LayoutParams layoutParams,
203 if (index < 0) {
206 offset = getOffset(index);
214 Log.d(TAG, "attach view to parent index:" + index + ",off:" + offset + "," +
240 * Returns a child by ViewGroup offset. ChildHelper won't offset this index.
242 * @param index ViewGroup index of the child to return.
243 * @return The view in the provided index.
245 View getUnfilteredChildAt(int index) {
246 return mCallback.getChildAt(index);
250 * Detaches the view at the provided index.
252 * @param index Index of the child to return in regular perspective.
254 void detachViewFromParent(int index) {
255 final int offset = getOffset(index);
259 Log.d(TAG, "detach view from parent " + index + ", off:" + offset);
264 * Returns the index of the child in regular perspective.
266 * @param child The child whose index will be returned.
267 * @return The regular perspective index of the child or -1 if it does not exists.
270 final int index = mCallback.indexOfChild(child);
271 if (index == -1) {
274 if (mBucket.get(index)) {
276 throw new IllegalArgumentException("cannot get index of a hidden child");
281 // reverse the index
282 return index - mBucket.countOnesBefore(index);
327 final int index = mCallback.indexOfChild(view);
328 if (index == -1) {
334 if (mBucket.get(index)) {
335 mBucket.remove(index);
336 mCallback.removeViewAt(index);
359 void set(int index) {
360 if (index >= BITS_PER_WORD) {
362 next.set(index - BITS_PER_WORD);
364 mData |= 1L << index;
374 void clear(int index) {
375 if (index >= BITS_PER_WORD) {
377 next.clear(index - BITS_PER_WORD);
380 mData &= ~(1L << index);
385 boolean get(int index) {
386 if (index >= BITS_PER_WORD) {
388 return next.get(index - BITS_PER_WORD);
390 return (mData & (1L << index)) != 0;
401 void insert(int index, boolean value) {
402 if (index >= BITS_PER_WORD) {
404 next.insert(index - BITS_PER_WORD, value);
407 long mask = (1L << index) - 1;
412 set(index);
414 clear(index);
423 boolean remove(int index) {
424 if (index >= BITS_PER_WORD) {
426 return next.remove(index - BITS_PER_WORD);
428 long mask = (1L << index);
446 int countOnesBefore(int index) {
448 if (index >= BITS_PER_WORD) {
451 return Long.bitCount(mData & ((1L << index) - 1));
453 if (index < BITS_PER_WORD) {
454 return Long.bitCount(mData & ((1L << index) - 1));
456 return next.countOnesBefore(index - BITS_PER_WORD) + Long.bitCount(mData);
471 void addView(View child, int index);
475 void removeViewAt(int index);
483 void attachViewToParent(View child, int index, ViewGroup.LayoutParams layoutParams);