Making checkbox look unclickable?

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Making checkbox look unclickable?

Postby sandis84 » Thu Oct 29, 2009 9:28 am

Hi,

So I have a checkbox that I want to be unclickable. I simply set myCheckbox.setClickable(false), but I also want it to have a grayish look so the user understands that it cannot be clicked. Are there graphics for this already, or must I use some kind of drawing-tool to get this effect? Can someone give me a hint on how to do this?
sandis84
Experienced Developer
Experienced Developer
 
Posts: 78
Joined: Fri Aug 07, 2009 3:54 pm

Top

Postby RS » Thu Oct 29, 2009 11:28 am

Hello sandis84,

You can try change the look of the checkbox. More info at http://www.anddev.org/tutorial_change_look_of_checkbox-t4553.html
Code hard, go pro! Don't wait for someone to do your own project.
User avatar
RS
Junior Developer
Junior Developer
 
Posts: 11
Joined: Tue Oct 20, 2009 10:49 pm

Postby sandis84 » Thu Oct 29, 2009 1:55 pm

thanks, you link helped me solve it. However, should there not be a better way to access the checkbox-drawables then to copy them to my project res-folder? It feels lika a waste of memory.
sandis84
Experienced Developer
Experienced Developer
 
Posts: 78
Joined: Fri Aug 07, 2009 3:54 pm

Postby I_Artist » Thu Oct 29, 2009 4:21 pm

Hi Sandis,

If you don't mind, I'd like to give you my opinion on this.

You shouldn't mess with OS UI stuff like this, it will just confuse the user. Now the user's system will have checkboxes with 3 states, on/off/yours. As a user I totally agree with you that the off state in Android is not very clear. But changing in ONLY your app will just make things more complicated for the user. Imagine if every developer changed the checkbox, it would be unmanagable... As bad as it is now, at least it is coherent.

The other point is that you can expect the OS to change the implementation of the controls making them clearer, and yours out of place (still).

Now, building a theme that replaces ALL of the checkboxes on the system, and that is intalled with the users consent is a different story...

Cheers!
The I_Artist

follow me on Twitter: @I_Artist
follow Android Development on Twitter: #androiddev

Show the world that you are an #androiddev, wear the badge http://www.twibbon.com/join/androiddev
User avatar
I_Artist
Developer
Developer
 
Posts: 33
Joined: Fri Oct 16, 2009 3:49 am
Location: St-Eustache, Quebec

Postby sandis84 » Thu Oct 29, 2009 4:29 pm

Hi I_Artist,

I am however using drawables that comes with the SDK. I fail to use them in what I feel is the "correct" way, instead I copy them to my own projects drawable-folder (as in the link that was supplied to me in this thread). However, I am still only using a xml-file and drawables from the SDK. I agree completely that people should not invent their own standards and I dont think I do. I just think that I code it in a bad way, and I want to discover the good way.

To be honest I cannot understand why a checkbox dont become grayed out when I run myCheckbox.setEnabled(false); without me changing anything. With this xml-file I found in the SDK, it does just that.
sandis84
Experienced Developer
Experienced Developer
 
Posts: 78
Joined: Fri Aug 07, 2009 3:54 pm

Postby I_Artist » Thu Oct 29, 2009 4:52 pm

Sandis,

oddly enough, I was just brushing me teeth and thinking exactly that! hahaha ("what if he just wanted to get the knowledge, not set his own standard?")

Power to you man, those are good developer standards that you have.
The I_Artist

follow me on Twitter: @I_Artist
follow Android Development on Twitter: #androiddev

Show the world that you are an #androiddev, wear the badge http://www.twibbon.com/join/androiddev
User avatar
I_Artist
Developer
Developer
 
Posts: 33
Joined: Fri Oct 16, 2009 3:49 am
Location: St-Eustache, Quebec

Top

Postby sandis84 » Fri Oct 30, 2009 10:37 am

Thanks man. I'll be sure to post in this thread if I come up with an optimal solution =)
sandis84
Experienced Developer
Experienced Developer
 
Posts: 78
Joined: Fri Aug 07, 2009 3:54 pm

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: Google [Bot] and 5 guests