android.graphics.LinearGradient#setLocalMatrix ( )源码实例Demo

下面列出了android.graphics.LinearGradient#setLocalMatrix ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: Telegram-FOSS   文件: PollVotesAlert.java
private void updatePlaceholder() {
    if (placeholderPaint == null) {
        return;
    }
    int color0 = Theme.getColor(Theme.key_dialogBackground);
    int color1 = Theme.getColor(Theme.key_dialogBackgroundGray);
    color0 = AndroidUtilities.getAverageColor(color1, color0);
    placeholderPaint.setColor(color1);
    placeholderGradient = new LinearGradient(0, 0, gradientWidth = AndroidUtilities.dp(500), 0, new int[]{color1, color0, color1}, new float[]{0.0f, 0.18f, 0.36f}, Shader.TileMode.REPEAT);
    placeholderPaint.setShader(placeholderGradient);
    placeholderMatrix = new Matrix();
    placeholderGradient.setLocalMatrix(placeholderMatrix);
}
 
源代码2 项目: Telegram   文件: PollVotesAlert.java
private void updatePlaceholder() {
    if (placeholderPaint == null) {
        return;
    }
    int color0 = Theme.getColor(Theme.key_dialogBackground);
    int color1 = Theme.getColor(Theme.key_dialogBackgroundGray);
    color0 = AndroidUtilities.getAverageColor(color1, color0);
    placeholderPaint.setColor(color1);
    placeholderGradient = new LinearGradient(0, 0, gradientWidth = AndroidUtilities.dp(500), 0, new int[]{color1, color0, color1}, new float[]{0.0f, 0.18f, 0.36f}, Shader.TileMode.REPEAT);
    placeholderPaint.setShader(placeholderGradient);
    placeholderMatrix = new Matrix();
    placeholderGradient.setLocalMatrix(placeholderMatrix);
}
 
 同类方法