android - Selector of the parent view is not working when any child is clicked -


xml of selector is:

<selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@color/primary_light_transparent" android:state_enabled="true" android:state_pressed="true"/>     <item android:drawable="@color/primary_light_transparent" android:state_enabled="true" android:state_focused="true"/>     <item android:drawable="@color/primary_light_transparent" android:state_enabled="true" android:state_selected="true"/>     <item android:drawable="@color/primary_light_transparent" android:state_activated="true" android:state_enabled="true"/>     <item android:drawable="@drawable/normal"/> </selector> 

and layout xml is:

<framelayout android:id="@+id/keypad_6"      android:layout_width="0dp"      android:layout_height="match_parent"      android:layout_weight="1"      android:background="@drawable/button_selector"      android:descendantfocusability="beforedescendants"      android:onclick="onclick" >       <button      android:id="@+id/keypad_6_bt"      style="@style/button.keypad.numeric"      android:layout_width="match_parent"      android:layout_height="wrap_content"      android:onclick="onclick"      android:text="6" />      <textview      android:id="@+id/keypad_6_tv"      style="@style/keypad_letters"      android:layout_width="match_parent"      android:layout_height="wrap_content"      android:layout_gravity="bottom"      android:gravity="center_horizontal"      android:onclick="onclick"      android:text="mno"      android:textcolor="@color/keypad_digits_color" /> </framelayout> 

what looking when child views (button or textview) of framelayout clicked selector of framelayout should work , should highlight whole layout.

i unable achieve , looking forward know how can this

add android:addstatesfromchildren="true" framelayout


Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -