网上没有解释的很详尽的,正好需要。直接把源码拷出来,记录一下,方便以后使用:
1.角度与值的对应关系:
/**
* Update the orientation of the gradient based on the given angle only if the type is
* {@link #LINEAR_GRADIENT}
*/
private void updateGradientStateOrientation() {
if (mGradient == LINEAR_GRADIENT) {
int angle = mAngle;
if (angle % 45 != 0) {
throw new IllegalArgumentException("Linear gra