Code example for GradientDrawable

Methods: setGradientType

0
		shadowDrawableRL = new GradientDrawable(
				GradientDrawable.Orientation.RIGHT_LEFT, color);
		shadowDrawableRL.setGradientType(GradientDrawable.LINEAR_GRADIENT);
 
		shadowDrawableLR = new GradientDrawable(
				GradientDrawable.Orientation.LEFT_RIGHT, color);
		shadowDrawableLR.setGradientType(GradientDrawable.LINEAR_GRADIENT);
 
		float array[] = { 0.55f, 0, 0, 0, 80.0f, 0, 0.55f, 0, 0, 80.0f, 0, 0,
				0.55f, 0, 80.0f, 0, 0, 0, 0.2f, 0 }; 
		ColorMatrix cm = new ColorMatrix();
		cm.set(array);
		/* 
		 * |A*0.55 + 80| |R*0.55 + 80| |G*0.55 + 80| |B*0.2| 
		 */ 
		// cm.setSaturation(0); 
		mColorMatrixFilter = new ColorMatrixColorFilter(cm);
 
		// ���ù�������ʵ�ֽӴ����ſ����Ķ���Ч�� 
		mScroller = new Scroller(context);
	}