Code example for LinearLayout.LayoutParams

Methods: setMargins

0
	private LinearLayout line;
 
	@Override 
	public View getView(Context context) {
		line = new LinearLayout(context);
		LayoutParams lp = new LayoutParams(LayoutParams.FILL_PARENT,
				(int) ImageTransform.dipToPixels(line.getResources(),
						getHeigthInDip())); 
		int p = 10;
		lp.setMargins(p, 2 * p, p, 2 * p);
		line.setLayoutParams(lp);
		loadBGUtils().applyTo(line);
		return line;
	} 
 
	public BGUtils loadBGUtils() { 
		int[] colorsInGradient = BGUtils.createGrayGradient3();
		BGUtils bgUtils = new BGUtils(Orientation.LEFT_RIGHT, colorsInGradient,
				BGUtils.genCornerArray(2)); 
		return bgUtils;
	}