public void adjustChildren ( int widthMeasureSpec , int heightMeasureSpec ) { if ( Log . isLoggable ( TAG , Log . DEBUG ) ) { Log . d ( TAG , "adjustChildren: " + mHost + " widthMeasureSpec: " + View . MeasureSpec . toString ( widthMeasureSpec ) + " heightMeasureSpec: " + View . MeasureSpec . toString ( heightMeasureSpec ) ) ; } int widthHint = View . MeasureSpec . getSize ( widthMeasureSpec ) ; int heightHint = View . MeasureSpec . getSize ( heightMeasureSpec ) ; for ( int i = 0 , N = mHost . getChildCount ( ) ; i < N ; i ++ ) { View view = mHost . getChildAt ( i ) ; ViewGroup . LayoutParams params = view . getLayoutParams ( ) ; if ( Log . isLoggable ( TAG , Log . DEBUG ) ) { Log . d ( TAG , "should adjust " + view + " " + params ) ; } if ( params instanceof PercentLayoutParams ) { PercentLayoutInfo info = ( ( PercentLayoutParams ) params ) . getPercentLayoutInfo ( ) ; if ( Log . isLoggable ( TAG , Log . DEBUG ) ) { Log . d ( TAG , "using " + info ) ; } if ( info != null ) { if ( params instanceof ViewGroup . MarginLayoutParams ) { info . fillMarginLayoutParams ( ( ViewGroup . MarginLayoutParams ) params , widthHint , heightHint ) ; } else { info . fillLayoutParams ( params , widthHint , heightHint ) ; } } } } }
Iterates over children and changes their width and height to one calculated from percentage values .