android - Emulate highlight on view click -


i have imageview icon. icon, example, have size: 32 x 32 dip. imageview have background:

<selector xmlns:android="http://schemas.android.com/apk/res/android">      <item android:state_focused="true"           android:drawable="@drawable/simple_button_focused_holo" />      <item android:state_pressed="true"           android:drawable="@drawable/simple_button_pressed_holo" />      <item android:drawable="@android:color/transparent" /> </selector> 

then user click on icon, can see hightlight on click. ok: work on 4 , 2 android version. size 32 little clicking. therefore, add hidden view , add onclick hidden view. view have ~ 50dip , user can easy click on icon. in case, user don't see highlight on click. cann't increase size source icon, because parent view have fix size , near icon exists other views: textviews, progressbar (which not need response on click).

enter image description here

can change background color of view when receives click? use transparent color user can still see button. can setup thread sleep amount of time, , use runonuithread() , pass runnable set background transparent?


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -