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);
373 final int index = mCallback.indexOfChild(view);
374 if (index == -1) {
380 if (mBucket.get(index)) {
381 mBucket.remove(index);
386 mCallback.removeViewAt(index);
405 void set(int index) {
406 if (index >= BITS_PER_WORD) {
408 mNext.set(index - BITS_PER_WORD);
410 mData |= 1L << index;
420 void clear(int index) {
421 if (index >= BITS_PER_WORD) {
423 mNext.clear(index - BITS_PER_WORD);
426 mData &= ~(1L << index);
431 boolean get(int index) {
432 if (index >= BITS_PER_WORD) {
434 return mNext.get(index - BITS_PER_WORD);
436 return (mData & (1L << index)) != 0;
447 void insert(int index, boolean value) {
448 if (index >= BITS_PER_WORD) {
450 mNext.insert(index - BITS_PER_WORD, value);
453 long mask = (1L << index) - 1;
458 set(index);
460 clear(index);
469 boolean remove(int index) {
470 if (index >= BITS_PER_WORD) {
472 return mNext.remove(index - BITS_PER_WORD);
474 long mask = (1L << index);
492 int countOnesBefore(int index) {
494 if (index >= BITS_PER_WORD) {
497 return Long.bitCount(mData & ((1L << index) - 1));
499 if (index < BITS_PER_WORD) {
500 return Long.bitCount(mData & ((1L << index) - 1));
502 return mNext.countOnesBefore(index - BITS_PER_WORD) + Long.bitCount(mData);
517 void addView(View child, int index);
521 void removeViewAt(int index);
529 void attachViewToParent(View child, int index, ViewGroup.LayoutParams layoutParams);