android - How to trigger selectors from the layout view? -


the problem

suppose have view inside layout view, , wish each touching event on layout affect view's background selector.

for example, when touch layout , selector of view choose state_pressed state.

what i've tried

i've read duplicateparentstate , addstatesfromchildren , think it's opposite of i'm searching for.

i've tried use splitmotionevents, didn't help.

the question

how do this?

also, should done in case layout inside listview (as item within it) ?

consider have spinner inside linear layout. make focusable property of view(here spinner) false. , onclick of linear layout call performclick on view(spinner in case).

edit:

in focus change listener of linear layout if has focus, call requestfocus on view. can follow same method other states of view

another method:

do not apply selector layout(linearlayout in case) , add whatever selector want view(spinner in case). view add parameter

android:duplicateparentstate="true" 

Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -