I have a custom view group that contains a couple simple views. How can I style my view group so that certain properties reach certain child elements? For instance, in the example below how can I create style that allows for easy change of text size, color, etc. I'd like to set the style in xml on the CustomViewGroup if at all possible. Can I specify an ID when creating styles so that specific elements get it?
Example usage:
<com.example.CustomViewGroup
android:id="@+id/custom"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
XML of the view group:
<TextView
android:id="@+id/valueTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/descriptionTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/valueTextView"
android:layout_alignLeft="@id/valueTextView"
android:layout_marginTop="-4dip"
android:layout_marginLeft="26dip"/>
</RelativeLayout>
If the style for this view was the same the whole time this wouldn't be an issue but I would like to use different styles in different situations so I can have it be bigger in some areas of my app but smaller in others.
Thanks in advance!