DeckChildViewThumbnail.java 文件源码

java
阅读 22 收藏 0 点赞 0 评论 0

项目:DeckView 作者:
/**
 * Updates the paint to draw the thumbnail.
 */
void updateThumbnailPaintFilter() {
    if (mInvisible) {
        return;
    }
    int mul = (int) ((1.0f - mDimAlpha) * mThumbnailAlpha * 255);
    int add = (int) ((1.0f - mDimAlpha) * (1 - mThumbnailAlpha) * 255);
    if (mBitmapShader != null) {
        mLightingColorFilter =
                new LightingColorFilter(Color.argb(255, mul, mul, mul),
                        Color.argb(0, add, add, add));
        mDrawPaint.setColorFilter(mLightingColorFilter);
        mDrawPaint.setColor(0xffffffff);
    } else {
        int grey = mul + add;
        mDrawPaint.setColorFilter(null);
        mDrawPaint.setColor(Color.argb(255, grey, grey, grey));
    }
    invalidate();
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号