Code example for LinearGradient

0
        } else { 
            mColorGradientPaint.setShader(new LinearGradient(
                    0, 0, 0, off-2, MIDDLE_COLOR&0xffffff, MIDDLE_COLOR, Shader.TileMode.CLAMP));
        } 
        mEdgeGradientPaint.setShader(new LinearGradient(
                0, 0, 0, off/2, 0x00a0a0a0, 0xffa0a0a0, Shader.TileMode.CLAMP));
    } 
 
    @Override 
    protected void onSizeChanged(int w, int h, int oldw, int oldh) {
        super.onSizeChanged(w, h, oldw, oldh);
        updateIndicator(); 
    } 
 
    @Override 
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);
 
        int width = getWidth();
 
        int left = 0;