Lines Matching refs:index

89      * Add a view to the ViewGroup at an index
92 * @param index Index of the child from the regular perspective (excluding hidden views).
93 * ChildHelper offsets this index to actual ViewGroup index.
96 void addView(View child, int index, boolean hidden) {
98 if (index < 0) {
101 offset = getOffset(index);
109 Log.d(TAG, "addViewAt " + index + ",h:" + hidden + ", " + this);
113 private int getOffset(int index) {
114 if (index < 0) {
118 int offset = index;
121 final int diff = index - (offset - removedBefore);
140 int index = mCallback.indexOfChild(view);
141 if (index < 0) {
144 if (mBucket.remove(index)) {
147 mCallback.removeViewAt(index);
149 Log.d(TAG, "remove View off:" + index + "," + this);
154 * Removes the view at the provided index from RecyclerView.
156 * @param index Index of the child from the regular perspective (excluding hidden views).
157 * ChildHelper offsets this index to actual ViewGroup index.
159 void removeViewAt(int index) {
160 final int offset = getOffset(index);
170 Log.d(TAG, "removeViewAt " + index + ", off:" + offset + ", " + this);
175 * Returns the child at provided index.
177 * @param index Index of the child to return in regular perspective.
179 View getChildAt(int index) {
180 final int offset = getOffset(index);
223 * @param index Index of the child to attach in regular perspective.
227 void attachViewToParent(View child, int index, ViewGroup.LayoutParams layoutParams,
230 if (index < 0) {
233 offset = getOffset(index);
241 Log.d(TAG, "attach view to parent index:" + index + ",off:" + offset + "," +
267 * Returns a child by ViewGroup offset. ChildHelper won't offset this index.
269 * @param index ViewGroup index of the child to return.
270 * @return The view in the provided index.
272 View getUnfilteredChildAt(int index) {
273 return mCallback.getChildAt(index);
277 * Detaches the view at the provided index.
279 * @param index Index of the child to return in regular perspective.
281 void detachViewFromParent(int index) {
282 final int offset = getOffset(index);
286 Log.d(TAG, "detach view from parent " + index + ", off:" + offset);
291 * Returns the index of the child in regular perspective.
293 * @param child The child whose index will be returned.
294 * @return The regular perspective index of the child or -1 if it does not exists.
297 final int index = mCallback.indexOfChild(child);
298 if (index == -1) {
301 if (mBucket.get(index)) {
303 throw new IllegalArgumentException("cannot get index of a hidden child");
308 // reverse the index
309 return index - mBucket.countOnesBefore(index);
354 final int index = mCallback.indexOfChild(view);
355 if (index == -1) {
361 if (mBucket.get(index)) {
362 mBucket.remove(index);
367 mCallback.removeViewAt(index);
386 void set(int index) {
387 if (index >= BITS_PER_WORD) {
389 next.set(index - BITS_PER_WORD);
391 mData |= 1L << index;
401 void clear(int index) {
402 if (index >= BITS_PER_WORD) {
404 next.clear(index - BITS_PER_WORD);
407 mData &= ~(1L << index);
412 boolean get(int index) {
413 if (index >= BITS_PER_WORD) {
415 return next.get(index - BITS_PER_WORD);
417 return (mData & (1L << index)) != 0;
428 void insert(int index, boolean value) {
429 if (index >= BITS_PER_WORD) {
431 next.insert(index - BITS_PER_WORD, value);
434 long mask = (1L << index) - 1;
439 set(index);
441 clear(index);
450 boolean remove(int index) {
451 if (index >= BITS_PER_WORD) {
453 return next.remove(index - BITS_PER_WORD);
455 long mask = (1L << index);
473 int countOnesBefore(int index) {
475 if (index >= BITS_PER_WORD) {
478 return Long.bitCount(mData & ((1L << index) - 1));
480 if (index < BITS_PER_WORD) {
481 return Long.bitCount(mData & ((1L << index) - 1));
483 return next.countOnesBefore(index - BITS_PER_WORD) + Long.bitCount(mData);
498 void addView(View child, int index);
502 void removeViewAt(int index);
510 void attachViewToParent(View child, int index, ViewGroup.LayoutParams layoutParams);