Example usage for android.graphics SweepGradient getLocalMatrix

List of usage examples for android.graphics SweepGradient getLocalMatrix

Introduction

In this page you can find the example usage for android.graphics SweepGradient getLocalMatrix.

Prototype

public boolean getLocalMatrix(@NonNull Matrix localM) 

Source Link

Document

Return true if the shader has a non-identity local matrix.

Usage

From source file:com.skumar.flexibleciruclarseekbar.CircularSeekBar.java

/**
 * Method to drawing the gradient color for the arc
 */// w  w w  . j  a v a 2s  .  com
public void setShader() {
    SweepGradient sweepgradient = new SweepGradient(mArcRadius, mArcRadius, Color.parseColor("#2f8bca"),
            Color.parseColor("#c91200"));
    Matrix matrix = new Matrix();
    matrix.reset();
    sweepgradient.getLocalMatrix(matrix);
    matrix.postRotate(90, mArcRadius, mArcRadius);
    sweepgradient.setLocalMatrix(matrix);
    mArcPaint.setShader(sweepgradient);
    mNeedleScalePaint.setShader(sweepgradient);
}