Code example for RadialGradient

0
        public GradientsView(Context c) {
            super(c);
 
            mSweepGradient = new SweepGradient(0.0f, 0.0f, 0xff000000, 0xffffffff);
            mRadialGradient = new RadialGradient(0.0f, 0.0f, 100.0f, 0xff000000, 0xffffffff,
                    Shader.TileMode.MIRROR);
             
            mMatrix = new Matrix();
            mMatrix.setRotate(-45, 0.0f, 0.0f);
            mMatrix.postTranslate(100.0f, 100.0f);
 
            mMatrix2 = new Matrix();
            mMatrix2.setScale(1.0f, 2.0f);
            mMatrix2.postRotate(-45, 0.0f, 0.0f);
 
            mMatrix3 = new Matrix();
            mMatrix3.setTranslate(100.0f, 100.0f);            
             
            mPaint = new Paint();
        }