CompatUtils.java 文件源码

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

项目:MainCalendar 作者:
/**
 * Gets color.
 *
 * @param context  the context
 * @param colorRes the color res
 * @return the color
 */
@ColorInt
public static int getColor(Context context, @ColorRes int colorRes) {
    if (Build.VERSION.SDK_INT < 21) {
        //noinspection deprecation
        return context.getResources().getColor(colorRes);
    } else {
        return context.getResources().getColor(colorRes, null);
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号