Code example for LayerDrawable

0
//		TabUnselectedBackground unselectedPressed = new TabUnselectedBackground(); 
		TabUnselectedBackground unselected = new TabUnselectedBackground();
		 
 
		addState(new int[] {attr.state_selected}, selected);
		addState(new int[] {attr.state_pressed}, new LayerDrawable(new Drawable[] {getHighlightDrawable(context)/*, unselectedPressed*/}));
		addState(new int[] {}, unselected);		
		 
		 
		mUnderlineColor = underlineColor;
		mUnselectedUnderlineHeight = AttributesParser.parseDimension("1dip", context);
		mSelectedUnderlineHeight = AttributesParser.parseDimension("5dip", context);
		 
	} 
	 
 
	private static Drawable getHighlightDrawable(Context context) {
		return context.getResources().getDrawable(R.drawable.highlight_background);
	} 
	 
	private class TabSelectedBackground extends Drawable {