How do I build a radio list using Andriod 4.0 radio button widgets?

Rich shared this question 6 years ago
Answered

I am trying to create radio list of android 4.0 buttons. These widgets don't seem to behave like basic justinmind radio list. Looking through the forums, it loooks like I have to use a toggle event to do something, but I can't find anyting in the userguide/tutorial that explains "on toggle" event or dynamic panels to figure out how to build android radio lists.

Comments (7)

photo
1

If you are going to see the prototype inside a real android device then use the standard radio buttons. They will show as android radio buttons in android devices. If not then you'll need to prototype all the radio buttons states using dynamic panels.

photo
1

I figured that much. I have a 2 button page with the top button being checked on page load.


For each button panel, with on click event, I switch the appropriate panels from checked to unchecked states (i.e. click bottom button, uncheck top and check bottom panel)


But, if I click the bottom button and click it again, it goes to unchecked state and the top remains unchecked. Thoughts?

photo
1

In the first panel select the top button and remove the panel 'unchecked'. Select the bottom one and remove the panel 'checked'. Then go to the second big panel that has the two radios. There do the other way around, select the top radio and remove the panel 'checked' and select the bottom one and remove the panel 'unchecked'.

photo
1

So if I understand this correctly I need to have:


1. Top Panel


1a-TP1-checked


1b-TP2-unchecked


2. Bottom Panel


2a. BP1-checked


2b. BP2-unchecked


Have the default states:


TP1-show


TP2-hide


BP1-hide


BP2-show


Then for Top Panel


On click, add the following interactions:


-show TP1-checked


-hide TP1-unchecked


-hide BP1-checked


-show BP2-unchecked


Then for Bottom Panel


On click, add the following interactions:


-hide TP1-checked


-showTP1-unchecked


-show BP1-checked


-hide BP2-unchecked


I hope there is an easier way because with each additional button, the work grows, no?

photo
1

I made a small example for you, I hope it helps:


http://d2ld3he4yll0xl.cloudfront.net/...

photo
1

Thanks. That helped. Took a while figuring out all the panels because duplicate doesn't work quite as expected but I got it working. As expected though, it does get more challenging if you add more buttons to the mix because you need one panel for each checked confguration, but certainly much easier than the hide/show approach I was taking.


Thanks!


PS - the manual & tutorials could use some updating as I couldn't find much info on panels or toggle events.

photo
1

You're totally right. We could make more efforts on tutorials and documents.