Android: Propagate parent state to child view
<p>I am experiencing some problem that I basically dont know how to fix. I have a LinearLayout with some child compenents in it, like ImageView, TextView and so on, one example can be seen in the xml below:</p>

<pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal" 
android:layout_width="fill_parent"
android:layout_height="wrap_content" 
style="@style/list_buttom_top"&gt;

&lt;LinearLayout android:gravity="center_vertical"
    android:paddingLeft="10dip" 
    android:orientation="vertical"
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content"
    android:layout_weight="1.0"&gt;

    &lt;TextView android:text="title" 
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" 
        android:id="@+id/title"
        style="@style/content_page_large_text" /&gt;

    &lt;TextView android:text="summary" 
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" 
        android:id="@+id/subtitle"
        android:visibility="visible" 
        style="@style/content_page_small_text" /&gt;
&lt;/LinearLayout&gt;

&lt;TextView android:layout_width="wrap_content"
    android:layout_height="wrap_content" 
    android:id="@+id/itemCount"
    android:visibility="gone" 
    style="@style/content_page_large_count_text" /&gt;

&lt;ImageView android:layout_width="wrap_content"
    android:layout_height="wrap_content" 
    android:id="@+id/chevron"
    style="@style/list_buttom_chevron" /&gt;

&lt;/LinearLayout&gt; 
</code></pre>

<p>The style list_buttom_top says that when the LinearLayout is in the pressed state, the background color needs to be changed, and so far this is working. The problem is that the content_page_large_text also says that the text color of the TextView needs to be changed as well, but it doesnt happen. The only color changing when I am clicking the LinearLayout is its background.</p>

<pre><code>&lt;style name="list_buttom_top"&gt;
&lt;item name="android:clickable"&gt;true&lt;/item&gt;
&lt;item name="android:paddingTop"&gt;10dip&lt;/item&gt;
&lt;item name="android:paddingBottom"&gt;10dip&lt;/item&gt;
&lt;item name="android:paddingLeft"&gt;10dip&lt;/item&gt;
&lt;item name="android:paddingRight"&gt;10dip&lt;/item&gt;
&lt;item name="android:gravity"&gt;center_vertical&lt;/item&gt;
&lt;item name="android:background"&gt;@drawable/background_view_rounded_top&lt;/item&gt;
&lt;/style&gt;

&lt;style name="list_buttom_chevron"&gt;
    &lt;item name="android:paddingLeft"&gt;4.0dip&lt;/item&gt;
    &lt;item name="android:paddingTop"&gt;2.0dip&lt;/item&gt;
    &lt;item name="android:paddingRight"&gt;4.0dip&lt;/item&gt;
    &lt;item name="android:paddingBottom"&gt;2.0dip&lt;/item&gt;
    &lt;item name="android:layout_width"&gt;wrap_content&lt;/item&gt;
    &lt;item name="android:layout_height"&gt;wrap_content&lt;/item&gt;
    &lt;item name="android:src"&gt;@drawable/chevron&lt;/item&gt;
&lt;/style&gt;    
</code></pre>

<p>I have tried using this android:duplicateParentState="true" in my TextViews but it also didnt work. The same happens for the ImageView, which does not get its source image changed when I am clicking the LinearLayout.</p>

<p>Am I missing something here?
Thanks for the attention
T</p>
