private void addDots ( int length ) { removeAllViews ( ) ; final int pinLength = styledAttributes . getInt ( R . styleable . PinLock_pinLength , 4 ) ; for ( int i = 0 ; i < pinLength ; i ++ ) { Dot dot = new Dot ( context , styledAttributes , i < length ) ; addView ( dot ) ; } }
Adding Dot objects to layout