I\'m trying to test a way to make themes, but the approach I used isn\'t giving me the expected results. Here my setup:
drawable/dummy.xml
I do not pretend to the correctness of the decision, but it works. I solved the problem by this trick:
My attrs:
My themes:
My var's:
private TypedArray arrowUpActive, arrowDownActive;
Declaration:
arrowUpActive = getActivity().getTheme().obtainStyledAttributes(new int[] { R.attr.arrow_up_active });
arrowDownActive = getActivity().getTheme().obtainStyledAttributes(new int[] { R.attr.arrow_down_active });
And usage:
imageButton.setImageDrawable(getResources().getDrawable(arrowUpActive.getResourceId(0,1)));
imageButton.setImageDrawable(getResources().getDrawable(arrowDownActive.getResourceId(0,1)));