Well, I found the answer to my Question.
I couldn't control it from the XML itself, but I could implement it dynamically instead of hardcoding it. :)
The problem was only with those custom listviews within the ViewPager which was not taking the attributes from the XML. This is how I solved it.
In /values/attr.xml
<attr name="listFontColor" format="color" />
And in each Theme
, I set the listFontColor attribute values accordingly.
<item name="listFontColor">@android:color/white</item>
Instead of checking with each theme in the code, I fetched the current theme and assigned the font color in the code in my Adapter
like this,
//dynamically fetching the theme's list font Color and setting it to textview
TypedArray a = ((MyActivity)context).getTheme().obtainStyledAttributes(((MyApplication)(context.getApplicationContext())).getcurrentTheme(), new int[] {R.attr.listFontColor});
int attributeResourceId = a.getResourceId(0, 0);
listTitle.setTextColor(context.getResources().getColor(attributeResourceId));
Thanks for the reference :)