BrowseRowsFrameLayoutpublic class BrowseRowsFrameLayout extends android.widget.FrameLayout Customized FrameLayout excludes margin of child from calculating the child size.
So we can change left margin of rows while keep the width of rows unchanged without
using hardcoded DIPS. |
Methods Summary |
---|
protected void | measureChildWithMargins(android.view.View child, int parentWidthMeasureSpec, int widthUsed, int parentHeightMeasureSpec, int heightUsed)
final MarginLayoutParams lp = (MarginLayoutParams) child.getLayoutParams();
final int childWidthMeasureSpec = getChildMeasureSpec(parentWidthMeasureSpec,
getPaddingLeft() + getPaddingRight() + widthUsed, lp.width);
final int childHeightMeasureSpec = getChildMeasureSpec(parentHeightMeasureSpec,
getPaddingTop() + getPaddingBottom() + heightUsed, lp.height);
child.measure(childWidthMeasureSpec, childHeightMeasureSpec);
|
|