public LabelView(Context context,AttributeSet attrs){
  super(context,attrs);
  initLabelView();
  TypedArray a=context.obtainStyledAttributes(attrs,R.styleable.LabelView);
  CharSequence s=a.getString(R.styleable.LabelView_text);
  if (s != null) {
    setText(s.toString());
  }
  setTextColor(a.getColor(R.styleable.LabelView_textColor,0xFF000000));
  int textSize=a.getDimensionPixelOffset(R.styleable.LabelView_textSize,0);
  if (textSize > 0) {
    setTextSize(textSize);
  }
  a.recycle();
}

public LabelView ( Context context , AttributeSet attrs ) { super ( context , attrs ) ; initLabelView ( ) ; TypedArray a = context . obtainStyledAttributes ( attrs , R . styleable . LabelView ) ; CharSequence s = a . getString ( R . styleable . LabelView_text ) ; if ( s != null ) { setText ( s . toString ( ) ) ; } setTextColor ( a . getColor ( R . styleable . LabelView_textColor , 0xFF000000 ) ) ; int textSize = a . getDimensionPixelOffset ( R . styleable . LabelView_textSize , 0 ) ; if ( textSize > 0 ) { setTextSize ( textSize ) ; } a . recycle ( ) ; }
construct object , initializing with any attributes we understand from a layout file . these attributes are defined in sdk / assets / res / any / classes . xml .
