get color from theme by attr

This commit is contained in:
aliveoutside
2022-08-28 20:07:04 +03:00
parent 6758c8735c
commit 9abed48ec0
@@ -151,11 +151,11 @@ public class ThemesAdapter extends RecyclerView.Adapter<ThemesAdapter.ThemeViewH
private int getAccentColorFromCustomTheme(ThemeModel theme) {
if (!"default".equals(theme.id)) {
if (theme.hasColor("accent"))
return theme.getColor("accent");
return theme.getColor(R.attr.accent);
else if (theme.hasColor("colorAccent"))
return theme.getColor("colorAccent");
return theme.getColor(R.attr.colorAccent);
else if (theme.hasColor("vk_accent"))
return theme.getColor("vk_accent");
return theme.getColor(R.attr.vk_accent);
}
return ThemesUtils.getColorFromAttr(R.attr.accent);
}