Tutorial: change look of CheckBox

Basic Tutorials concerning: GUI, Views, Activites, XML, Layouts, Intents, ...

Postby Zeba Momin » Fri Jan 01, 2010 2:16 pm

Very systematically written and helpful tutorial.. thanks a ton :)
Zeba Momin
Developer
Developer
 
Posts: 49
Joined: Thu Sep 17, 2009 6:53 am

Top

Postby khoailang2500 » Fri Jan 15, 2010 3:01 am

Thank you very much!
:)
khoailang2500
Once Poster
Once Poster
 
Posts: 1
Joined: Sun Sep 13, 2009 5:19 pm

Re: Tutorial: change look of CheckBox

Postby David » Sun May 23, 2010 1:09 pm

What should i do to use this custom checkboxes if i add my checkboxes dinamically on my code? (on the java code not on the xml files)

For example, i have a tableLayout and i want to add a checkbox for each new row i have.

Great tutorial btw
David
Freshman
Freshman
 
Posts: 5
Joined: Mon Feb 01, 2010 4:51 pm

Re: Tutorial: change look of CheckBox

Postby fonter » Thu Jun 24, 2010 10:37 am

Thanks very mush!It is useful for me!
fonter
Junior Developer
Junior Developer
 
Posts: 17
Joined: Wed Apr 28, 2010 10:45 am

Re: Tutorial: change look of CheckBox

Postby pathikdave@gmail.com » Wed Dec 22, 2010 12:35 pm

Great Tutorial to the point + detailed. Thanks
pathikdave@gmail.com
Once Poster
Once Poster
 
Posts: 1
Joined: Wed Dec 22, 2010 12:33 pm

Re: Tutorial: change look of CheckBox

Postby Schermvlieger » Wed Dec 22, 2010 5:40 pm

Thanks for this tut darolla!

I would like to implement this as well, but with one big difference:

To use replacement drawables which are part of the standard Android widget set that is contained in the Framework.

More specifically, I want to use some of the drawables associated with the RatingBar widget. This way, I could have a checkbox that looks like a RatingBar with StepSize and NumStars set to 1.

Why not use RatingBar directly, you might ask; well, the RatingBar widget does not seem to listen to onClick events, so setting the rating back to zero requires the user to slide their finger across the widget to the left, which is counterintuitive for a user input that should emulate the functionality of a CheckBox.

Of course, if there _is_ a way to make RatingBar listen to onClick, that would be great as well.
Schermvlieger
Senior Developer
Senior Developer
 
Posts: 159
Joined: Fri Feb 26, 2010 1:37 pm

Top

Re: Tutorial: change look of CheckBox

Postby Schermvlieger » Thu Dec 23, 2010 8:55 am

It turns out to be very simple: just add this to the CheckBox definition in the XML file:

style="?android:attr/starStyle"
Schermvlieger
Senior Developer
Senior Developer
 
Posts: 159
Joined: Fri Feb 26, 2010 1:37 pm

Re: Tutorial: change look of CheckBox

Postby maduranga » Thu Dec 23, 2010 5:47 pm

Thank you for this awesome tutorial. It's surprising there aren't many tutorials like this.

I do have a problem and I hope somebody could help me.
I have managed to get the custome buttons to work, using a widgetLayout, but unfortunately now the states are not registering. For example, when I click, the buttons change, but it's not registering in the system. I have put a onClichListener but its not responding when I click.

Any help is appreciated.
Thank you.
maduranga
Freshman
Freshman
 
Posts: 8
Joined: Wed Sep 22, 2010 5:25 pm

Re: Tutorial: change look of CheckBox

Postby h.johny » Tue Jul 12, 2011 8:03 am

很好,学习了!
h.johny
Once Poster
Once Poster
 
Posts: 1
Joined: Tue Jul 12, 2011 7:56 am

Re: Tutorial: change look of CheckBox

Postby sabine » Wed Jul 20, 2011 10:09 pm

darolla,

How can i change the text? I need a specific color and size

Thanks,

sabine
sabine
Freshman
Freshman
 
Posts: 2
Joined: Mon Feb 28, 2011 7:50 am

Re: Tutorial: change look of CheckBox

Postby Nakama IT » Tue Nov 08, 2011 5:08 pm

It seems that there is some minor changes with the latests SDK.

The repertories where you can find the png resources are
\android-sdk-windows\platforms\android-xx\data\res\drawable-ydpi
Where xx is the api level and y = m, l and h

Filenames are :
btn_check_label_background.9.png instead of checkbox_label_background.9.png
btn_check.xml instead of checkbox.xml
The others filenames are not changed.

Hence the main.xml looks like :
Code: Select all
android:background="@drawable/checkbox_on_background" android:button="@drawable/btn_check"


Thanks for this tuto !
Nakama IT
Once Poster
Once Poster
 
Posts: 1
Joined: Tue Nov 08, 2011 4:27 pm

Re: Tutorial: change look of CheckBox

Postby aakash » Fri Dec 23, 2011 9:24 am

Exactly what I am looking for.
Thanks you darolla.
Let me develop something.

Grrrrrrrrrrr
aakash
Developer
Developer
 
Posts: 29
Joined: Thu Aug 11, 2011 7:10 am

Re: Tutorial: change look of CheckBox

Postby hgft » Wed Feb 29, 2012 8:42 am

Coach Outlet Online Sale is with imperfections which consist of cuts, scars, and scratches will exist, the grain in its organically grown problem has between one of the most considerable dietary fibers strength, and getting a last end result between one of the most considerable durability. The grain also has organically grown breathability, resulting in increased comfort using the path from the wearer.

Louis Vuitton Outlet could possibly be one of the most well-known is not necessarily one of the most ideal for you! possibly the most current quarter round shoulder bag with fluorescent color provides you a shine in the moment, desire to possess the urge to it immediately; But possibly your pores and skin color could possibly be the earth beside the handbag could possibly be one of the most make you fondle admiringly joker choice.

Louis Vuitton Outlet supply reduce, the weakening from the role, tiny haystack in slender whole body once more and again. the right way to purchase Louis Vuitton bags That's between the powerful cohesion when Cunningham lancelet find yourself isolated point, allow wind and bad weather insulation, yr pursuing year, pile of grass system earlier short increased grass blanketed with it or bi erosion.

Jennifer Garner and Ben Affleck are the proud parents of a newborn son! The 39-year-old actress gave birth to the couple's third child in Santa Monica, Calif., a source tells Us Weekly. The family's newest addition joins older sisters Violet, 6, and Seraphina, 3. “I would have thought [Ben] wanted a boy]. At first … I really thought so,” Jen, who kept the baby's gender under wraps, told Jay Leno last month.
hgft
Experienced Developer
Experienced Developer
 
Posts: 66
Joined: Tue Feb 28, 2012 9:11 am

Top
Previous

Return to Novice Tutorials

Who is online

Users browsing this forum: Google Feedfetcher and 7 guests