SkinManager.java 文件源码

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

项目:themePlugin 作者:
public int getColor(int resId) {
    int originColor = context.getResources().getColor(resId);
    if (mResources == null || isDefaultSkin) {
        return originColor;
    }

    String resName = context.getResources().getResourceEntryName(resId);

    int trueResId = mResources.getIdentifier(resName, "color", skinPackageName);
    int trueColor = 0;

    try {
        trueColor = mResources.getColor(trueResId);
    } catch (NotFoundException e) {
        e.printStackTrace();
        trueColor = originColor;
    }

    return trueColor;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号