Code example for GradientDrawable

Methods: setGradientType

0
		touchPt = new PointF(-1, -1);
 
		// ARGB A(0-͸Ã÷,255-²»Í¸Ã÷) 
		int[] color = { 0xb0333333, 0x00333333 };
		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);