Lines Matching refs:child

45  * You can also specify gravity, which specifies the alignment of all the child elements by
104 * use the child at this index as the baseline.
112 * The additional offset to the child's baseline.
297 final View child = getVirtualChildAt(i);
299 if (child != null && child.getVisibility() != GONE) {
301 final LayoutParams lp = (LayoutParams) child.getLayoutParams();
302 final int top = child.getTop() - lp.topMargin - mDividerHeight;
309 final View child = getVirtualChildAt(count - 1);
311 if (child == null) {
314 final LayoutParams lp = (LayoutParams) child.getLayoutParams();
315 bottom = child.getBottom() + lp.bottomMargin;
325 final View child = getVirtualChildAt(i);
327 if (child != null && child.getVisibility() != GONE) {
329 final LayoutParams lp = (LayoutParams) child.getLayoutParams();
332 position = child.getRight() + lp.rightMargin;
334 position = child.getLeft() - lp.leftMargin - mDividerWidth;
342 final View child = getVirtualChildAt(count - 1);
344 if (child == null) {
351 final LayoutParams lp = (LayoutParams) child.getLayoutParams();
353 position = child.getLeft() - lp.leftMargin - mDividerWidth;
355 position = child.getRight() + lp.rightMargin;
397 * the minimum size of the largest child. If false, all children are
401 * size of the largest child, false otherwise.
409 * the minimum size of the largest child. If false, all children are
415 * minimum size of the largest child, false otherwise.
432 final View child = getChildAt(mBaselineAlignedChildIndex);
433 final int childBaseline = child.getBaseline();
451 // getLocationOffset(child)
470 LinearLayoutCompat.LayoutParams lp = (LinearLayoutCompat.LayoutParams) child.getLayoutParams();
475 * @return The index of the child that will be used if this layout is
484 * @param i The index of the child that will be used if this layout is
489 throw new IllegalArgumentException("base aligned child index out "
501 * @param index the child's index
502 * @return the child at the specified index
534 * at layout time by adding the layout_weight of each child.
536 * This can be used for instance to give a single child 50% of the total
560 * @param childIndex Index of child to check for preceding divider
561 * @return true if there should be a divider before the child at childIndex
617 final View child = getVirtualChildAt(i);
619 if (child == null) {
624 if (child.getVisibility() == View.GONE) {
625 i += getChildrenSkipCount(child, i);
633 LinearLayoutCompat.LayoutParams lp = (LinearLayoutCompat.LayoutParams) child.getLayoutParams();
649 // child wanted to stretch to fill available space.
656 // Determine how big this child would like to be. If this or
661 child, i, widthMeasureSpec, 0, heightMeasureSpec,
668 final int childHeight = child.getMeasuredHeight();
671 lp.bottomMargin + getNextLocationOffset(child));
679 * If applicable, compute the additional offset to the child's baseline
686 // if we are trying to use a child index for our baseline, the above
690 throw new RuntimeException("A child of LinearLayout with index "
699 // child said it wanted to match our width. Set a flag
707 final int measuredWidth = child.getMeasuredWidth() + margin;
710 ViewCompat.getMeasuredState(child));
725 i += getChildrenSkipCount(child, i);
737 final View child = getVirtualChildAt(i);
739 if (child == null) {
744 if (child.getVisibility() == GONE) {
745 i += getChildrenSkipCount(child, i);
750 child.getLayoutParams();
754 lp.topMargin + lp.bottomMargin + getNextLocationOffset(child));
780 final View child = getVirtualChildAt(i);
782 if (child.getVisibility() == View.GONE) {
786 LinearLayoutCompat.LayoutParams lp = (LinearLayoutCompat.LayoutParams) child.getLayoutParams();
800 // child has been previously measured
802 // child was measured once already above...
804 int childHeight = child.getMeasuredHeight() + share;
809 child.measure(childWidthMeasureSpec,
812 // child was skipped in the loop above.
814 child.measure(childWidthMeasureSpec,
821 ViewCompat.getMeasuredState(child) & (ViewCompat.MEASURED_STATE_MASK
826 final int measuredWidth = child.getMeasuredWidth() + margin;
838 mTotalLength = Math.max(totalLength, totalLength + child.getMeasuredHeight() +
839 lp.topMargin + lp.bottomMargin + getNextLocationOffset(child));
850 // We have no limit, so make all weighted views as tall as the largest child.
854 final View child = getVirtualChildAt(i);
856 if (child == null || child.getVisibility() == View.GONE) {
861 (LinearLayoutCompat.LayoutParams) child.getLayoutParams();
865 child.measure(
866 MeasureSpec.makeMeasureSpec(child.getMeasuredWidth(),
897 final View child = getVirtualChildAt(i);
898 if (child.getVisibility() != GONE) {
899 LinearLayoutCompat.LayoutParams lp = ((LinearLayoutCompat.LayoutParams)child.getLayoutParams());
905 lp.height = child.getMeasuredHeight();
908 measureChildWithMargins(child, uniformMeasureSpec, 0, heightMeasureSpec, 0);
963 final View child = getVirtualChildAt(i);
965 if (child == null) {
970 if (child.getVisibility() == GONE) {
971 i += getChildrenSkipCount(child, i);
980 child.getLayoutParams();
998 // defeats the optimization mentioned above. Allow the child to
1003 child.measure(freeSpec, freeSpec);
1012 // child
1019 // Determine how big this child would like to be. If this or
1023 measureChildBeforeLayout(child, i, widthMeasureSpec,
1031 final int childWidth = child.getMeasuredWidth();
1034 getNextLocationOffset(child);
1038 lp.rightMargin + getNextLocationOffset(child));
1049 // child said it wanted to match our height. Set a flag indicating that
1056 final int childHeight = child.getMeasuredHeight() + margin;
1058 ViewCompat.getMeasuredState(child));
1061 final int childBaseline = child.getBaseline();
1063 // Translates the child's vertical gravity into an index
1090 i += getChildrenSkipCount(child, i);
1117 final View child = getVirtualChildAt(i);
1119 if (child == null) {
1124 if (child.getVisibility() == GONE) {
1125 i += getChildrenSkipCount(child, i);
1130 child.getLayoutParams();
1133 getNextLocationOffset(child);
1137 lp.leftMargin + lp.rightMargin + getNextLocationOffset(child));
1168 final View child = getVirtualChildAt(i);
1170 if (child == null || child.getVisibility() == View.GONE) {
1175 (LinearLayoutCompat.LayoutParams) child.getLayoutParams();
1190 // child has been previously measured
1192 // child was measured once already above ... base new measurement
1194 int childWidth = child.getMeasuredWidth() + share;
1199 child.measure(
1203 // child was skipped in the loop above. Measure for this first time here
1204 child.measure(MeasureSpec.makeMeasureSpec(
1211 ViewCompat.getMeasuredState(child) & ViewCompat.MEASURED_STATE_MASK);
1215 mTotalLength += child.getMeasuredWidth() + lp.leftMargin + lp.rightMargin +
1216 getNextLocationOffset(child);
1219 mTotalLength = Math.max(totalLength, totalLength + child.getMeasuredWidth() +
1220 lp.leftMargin + lp.rightMargin + getNextLocationOffset(child));
1227 int childHeight = child.getMeasuredHeight() + margin;
1235 final int childBaseline = child.getBaseline();
1237 // Translates the child's vertical gravity into an index in the range 0..2
1271 // We have no limit, so make all weighted views as wide as the largest child.
1275 final View child = getVirtualChildAt(i);
1277 if (child == null || child.getVisibility() == View.GONE) {
1282 (LinearLayoutCompat.LayoutParams) child.getLayoutParams();
1286 child.measure(
1288 MeasureSpec.makeMeasureSpec(child.getMeasuredHeight(),
1320 final View child = getVirtualChildAt(i);
1321 if (child.getVisibility() != GONE) {
1322 LinearLayoutCompat.LayoutParams lp = (LinearLayoutCompat.LayoutParams) child.getLayoutParams();
1328 lp.width = child.getMeasuredWidth();
1331 measureChildWithMargins(child, widthMeasureSpec, 0, uniformMeasureSpec, 0);
1340 * the specified child.</p>
1342 * @param child the child after which we want to skip children
1343 * @param index the index of the child after which we want to skip children
1346 int getChildrenSkipCount(View child, int index) {
1352 * child.</p>
1354 * @param childIndex the index of the null child
1355 * @return the width or height of the child depending on the orientation
1362 * <p>Measure the child according to the parent's measure specs. This
1367 * @param child the child to measure
1368 * @param childIndex the index of the child in this view
1374 void measureChildBeforeLayout(View child, int childIndex,
1377 measureChildWithMargins(child, widthMeasureSpec, totalWidth,
1382 * <p>Return the location offset of the specified child. This can be used
1385 * @param child the child for which to obtain the location offset
1388 int getLocationOffset(View child) {
1393 * <p>Return the size offset of the next sibling of the specified child.
1395 * following <code>child</code>.</p>
1397 * @param child the child whose next sibling will be moved
1398 * @return the location offset of the next child in pixels
1400 int getNextLocationOffset(View child) {
1431 // Where right end of child should go
1435 // Space available for child
1461 final View child = getVirtualChildAt(i);
1462 if (child == null) {
1464 } else if (child.getVisibility() != GONE) {
1465 final int childWidth = child.getMeasuredWidth();
1466 final int childHeight = child.getMeasuredHeight();
1469 (LinearLayoutCompat.LayoutParams) child.getLayoutParams();
1499 setChildFrame(child, childLeft, childTop + getLocationOffset(child),
1501 childTop += childHeight + lp.bottomMargin + getNextLocationOffset(child);
1503 i += getChildrenSkipCount(child, i);
1527 // Where bottom of child should go
1531 // Space available for child
1564 //In case of RTL, start drawing from the last child.
1572 final View child = getVirtualChildAt(childIndex);
1574 if (child == null) {
1576 } else if (child.getVisibility() != GONE) {
1577 final int childWidth = child.getMeasuredWidth();
1578 final int childHeight = child.getMeasuredHeight();
1582 (LinearLayoutCompat.LayoutParams) child.getLayoutParams();
1585 childBaseline = child.getBaseline();
1606 // // Align baselines vertically only if the child is smaller than us
1620 int descent = child.getMeasuredHeight() - childBaseline;
1634 setChildFrame(child, childLeft + getLocationOffset(child), childTop,
1637 getNextLocationOffset(child);
1639 i += getChildrenSkipCount(child, childIndex);
1644 private void setChildFrame(View child, int left, int top, int width, int height) {
1645 child.layout(left, top, left + width, top + height);
1671 * Describes how the child views are positioned. Defaults to GRAVITY_TOP. If
1672 * this layout has a VERTICAL orientation, this controls where all the child
1759 * Per-child layout information associated with ViewLinearLayout.