How to change font color of all children of a ViewGroup, and differently per ViewGroup instance?
<p>I have a layout for a row to be used in a <code>ListView</code>. The layout contains about eight <code>TextViews</code>.</p>

<p>If a row represents data of type "A",  I want it to have a red background with light grey font color for all <code>TextViews</code>.  If the data is of type "B", I want the background color to be green and the font color to be black.</p>

<p>Right now, I have a custom <code>ListAdapter</code> and in the <code>getView()</code> method I'm programmatically changing the font color for each <code>TextView</code>, but that is very tedious.</p>

<p>I considered defining styles for "A" and "B", but there doesn't seem to be a way to apply a style programmatically (i.e. it can only be done statically in the XML layout).</p>

<p>I also considered having different layouts for "A" and "B", but I don't want to have duplicate code in two XML files.</p>

<p>Any ideas on a better way to do this?  </p>
