public static int[] getViewSizeFromSpec(View view, int widthSpec, int heightSpec) { int minWidth = View.MeasureSpec.getSize(widthSpec) + view.getPaddingLeft() + view.getPaddingRight(); int width = ViewCompat.resolveSizeAndState(minWidth, widthSpec, 1); int minHeight = View.MeasureSpec.getSize(heightSpec) + view.getPaddingBottom() + view.getPaddingTop(); int height = ViewCompat.resolveSizeAndState(minHeight, heightSpec, 0); return new int[]{width, height}; }
maxWidth = Math.max(maxWidth, getSuggestedMinimumWidth()); int measuredWidth = ViewCompat.resolveSizeAndState(maxWidth, widthMeasureSpec, childState); int measuredHeight = ViewCompat.resolveSizeAndState(maxHeight, heightMeasureSpec, childState << MEASURED_HEIGHT_STATE_SHIFT); setMeasuredDimension(measuredWidth, measuredHeight);
final int measuredHeight = ViewCompat.resolveSizeAndState(height, heightMeasureSpec, childState); setMeasuredDimension(width, measuredHeight);
final int measuredHeight = ViewCompat.resolveSizeAndState(height, heightMeasureSpec, childState); setMeasuredDimension(width, measuredHeight);