private void setStyle ( Button view ) { final int textSize = styledAttributes . getInt ( R . styleable . PinLock_keypadTextSize , 12 ) ; view . setTextSize ( TypedValue . COMPLEX_UNIT_SP , textSize ) ; final int color = styledAttributes . getColor ( R . styleable . PinLock_keypadTextColor , Color . BLACK ) ; view . setTextColor ( color ) ; final int background = styledAttributes . getResourceId ( R . styleable . PinLock_keypadButtonShape , R . drawable . rectangle ) ; view . setBackgroundResource ( background ) ; }
Setting Button background styles such as background size and shape