Closed shiquan18 closed 7 years ago
@ColorRes int getThemeColorId(Context context, int colorId, String theme) { switch (colorId) { case R.color.theme_color_primary: return context.getResources().getIdentifier(theme, "color", getPackageName()); case R.color.theme_color_primary_dark: return context.getResources().getIdentifier(theme + "_dark", "color", getPackageName()); case R.color.theme_color_primary_trans: return context.getResources().getIdentifier(theme + "_trans", "color", getPackageName()); } return colorId; } private @ColorRes int getThemeColor(Context context, int color, String theme) { switch (color) { case 0xfffb7299: return context.getResources().getIdentifier(theme, "color", getPackageName()); case 0xffb85671: return context.getResources().getIdentifier(theme + "_dark", "color", getPackageName()); case 0x99f0486c: return context.getResources().getIdentifier(theme + "_trans", "color", getPackageName()); case R.drawable.yellow_one: return context.getResources().getIdentifier(theme + "_one", "drawable", getPackageName()); case R.drawable.red_two: return context.getResources().getIdentifier(theme + "_two", "drawable", getPackageName()); } return -1; } case R.drawable.yellow_one: return context.getResources().getIdentifier(theme + "_one", "drawable", getPackageName()); case R.drawable.red_two: return context.getResources().getIdentifier(theme + "_two", "drawable", getPackageName()); 使用不行?
具体使用方法可以看README,不是很懂你的用法