1

I have a checkbox in the a listview. I disabled the highlighting of listview upon pressing. Also, I disabled the focus of the listview as I have buttons in the row itself.

This worked perfect. However the problem is that the checkbox still shows Orange highlight.

Is there anyway to disable this orange highlight of the check box (whether it is through the list view or some way through the checkbox itself?

Thank you

Snake
  • 14,228
  • 27
  • 117
  • 250
  • Check this: http://stackoverflow.com/questions/2907335/android-disabling-highlight-on-listview-click – wraith Feb 15 '13 at 21:07
  • That totally does not answer my question as it talks about list view orange highlight of listview – Snake Feb 15 '13 at 22:33

2 Answers2

0

I believe that the only way to disable the highlight of the checkbox is to create your own drawable without the on pressed xml and leave use that, but I dont think there is any checkbox xml attribute that stops highlighting.....

Raigex
  • 1,205
  • 12
  • 32
  • Ok I know how to create drawable xml but how can I make this xml include the default behavior of the check box without the pressed state – Snake Feb 15 '13 at 22:32
  • basically just copy and paste the original into your own private one and delte the lines like state="pressesd" – Raigex Feb 16 '13 at 20:20
  • Why can't I get a complete answer on this? where is the original? – Snake Feb 16 '13 at 23:41
  • Sorry, The original file is in your android folder where you installed android (eg: mine is C:\Development\Android\platforms\platformname\) once you pick your platform name it should be in the res folder in that directory or a sub directory. – Raigex Feb 17 '13 at 01:11
  • Thank you, I tried copy/pasting while removing the pressed state. It does not work because it access drawable files like btton_on and these are not public (can not be accessed). You can try and yo will see – Snake Feb 17 '13 at 05:26
  • you have to take all the files. There are files for for the drawable in .xml and then there are files that it accesses in drawable-hdpi, ldpi, etc. You have to find all of them and copy them them. Usually its better to just create your own version than extending the android one. – Raigex Feb 18 '13 at 14:07
  • Oh ok. Thats lengthy. Well I guess the only solution. Accepted – Snake Feb 18 '13 at 17:03
0

I cannot add comments yet, but you should be able to use the link that I provided & programatically set styles to the checkbox to hide the orange highlight, right?

wraith
  • 391
  • 1
  • 14
  • I checked the link and it talks about listview orange highlight. I know you are referring to styles but here is the problem. I want to keep the default CheckBox style and just remove the highlighting. Your answer (as it is now) is so high level which unfortunetly won't do me a good. If you have code example (xml exmaple) then that would help and thus can accept the answer. Thank you – Snake Feb 16 '13 at 06:10