ForegroundDelegate.java 文件源码

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

项目:LuaViewPlayground 作者:
private static void setupForeground(View view, Drawable drawable, Integer color, Integer alpha) {
    if (view instanceof IForeground) {
        if (color != null) {
            if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
                if (drawable instanceof RippleDrawable) {
                    RippleDrawable rippleDrawable = (RippleDrawable) drawable;
                    rippleDrawable.setColor(ColorStateList.valueOf(color));
                    if (alpha != null) {
                        rippleDrawable.setAlpha(alpha);
                    }

                }
            }
        }
        ((IForeground) view).setForeground(drawable);
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号