Code example for LayerDrawable

Methods: setLayerInset

	private Drawable getWheelBackground()
		Drawable item0 = makeGradientDrawable(Orientation.BOTTOM_TOP, Color.parseColor("#333333"), Color.parseColor("#DDDDDD"), Color.parseColor("#333333"), 1f, Color.parseColor("#FF333333"));
		Drawable item1 = makeGradientDrawable(Orientation.BOTTOM_TOP, Color.parseColor("#AAAAAA"), Color.parseColor("#FFFFFF"), Color.parseColor("#AAAAAA"));
		LayerDrawable ld = new LayerDrawable(new Drawable[]{item0, item1});
		ld.setLayerInset(1, dipToInt(4f), dipToInt(1f), dipToInt(4f), dipToInt(1f));
		return ld;
	 * Calculates desired height for layout 
	 * @param layout 
	 *            the source layout 
	 * @return the desired layout height 
	private int getDesiredHeight(Layout layout) {
		if (layout == null) {
			return 0; 
Experience pair programming with AI  Get Codota for Java