I have a custom attribute say like this :
<attr name="colorPrimarySdk" format="color"/>
<attr name="colorSecondarySdk" format="color"/>
<attr name="colorAccentSdk" format="color"/>
And I am using them in my styles like this:
<style name="MyTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">?colorPrimarySdk</item>
<item name="colorPrimaryDark">?colorSecondarySdk</item>
<item name="colorAccent">?colorAccentSdk</item>
</style>
Now what I want is to set the value of my attributes dynamically from the code like, say :
colorPrimarySdk.value = myCustomColor
I have already tried using TypedValue and accessing the attribute itself. If anyone can help changing the value for my custom attribute, that would be a great help. Thanks in advance.