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