Code example for GradientDrawable

Methods: setGradientRadius

0
			if (viewWidth < viewHeight) {
				gradientRadius = viewWidth;
			} else { 
				gradientRadius = viewHeight;
			} 
			gradientDrawable.setGradientRadius(gradientRadius);
			break; 
		} 
	} 
	 
	@Override 
	protected void drawableStateChanged() { 
		super.drawableStateChanged(); 
		if (type == 0) {
			return; 
		} 
		int[] states = getDrawableState();
		for (int s : states) {
			if (s == android.R.attr.state_pressed) {
				isPressed = true;
				invalidate();