Java Code Examples for android.text.TextPaint.setShader()

The following are Jave code examples for showing how to use setShader() of the android.text.TextPaint class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: snippety   File: MultiColorSpan.java   Source Code and License Vote up 5 votes
@Override
public void updateDrawState(TextPaint paint) {
    paint.setStyle(Paint.Style.FILL);
    Shader shader = new LinearGradient(0, 0, 0, paint.getTextSize() * colors.length, colors, null,
            Shader.TileMode.MIRROR);
    Matrix matrix = new Matrix();
    matrix.setRotate(angle);
    shader.setLocalMatrix(matrix);
    paint.setShader(shader);
}
 
Example 2
Project: GitHub   File: SpanUtils.java   Source Code and License Vote up 4 votes
@Override
public void updateDrawState(final TextPaint tp) {
    tp.setShader(mShader);
}
 
Example 3
Project: AndroidUtilCode-master   File: SpanUtils.java   Source Code and License Vote up 4 votes
@Override
public void updateDrawState(TextPaint tp) {
    tp.setShader(mShader);
}
 
Example 4
Project: HeadlineNews   File: SpanUtils.java   Source Code and License Vote up 4 votes
@Override
public void updateDrawState(final TextPaint tp) {
    tp.setShader(mShader);
}