{"id":20086831,"url":"https://github.com/worker8/radiogroupplus","last_synced_at":"2025-07-24T23:03:11.117Z","repository":{"id":150772788,"uuid":"48743048","full_name":"worker8/RadioGroupPlus","owner":"worker8","description":"A small tweak version of RadioGroup class in Android to expand it's capability","archived":false,"fork":false,"pushed_at":"2020-04-17T03:15:04.000Z","size":108,"stargazers_count":101,"open_issues_count":6,"forks_count":36,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-06T02:38:54.886Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/worker8.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2015-12-29T10:52:46.000Z","updated_at":"2024-04-09T11:07:25.000Z","dependencies_parsed_at":"2023-04-07T00:27:22.906Z","dependency_job_id":null,"html_url":"https://github.com/worker8/RadioGroupPlus","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/worker8/RadioGroupPlus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worker8%2FRadioGroupPlus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worker8%2FRadioGroupPlus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worker8%2FRadioGroupPlus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worker8%2FRadioGroupPlus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/worker8","download_url":"https://codeload.github.com/worker8/RadioGroupPlus/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worker8%2FRadioGroupPlus/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266920237,"owners_count":24006721,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-24T02:00:09.469Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T16:02:37.513Z","updated_at":"2025-07-24T23:03:11.108Z","avatar_url":"https://github.com/worker8.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RadioGroupPlus ![](https://img.shields.io/badge/latest-v1.0.1-blue) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nThis is a tweak to the original Android `RadioGroup.java` class. This is because the original RadioGroup is only able to do:\n\n![](http://i.imgur.com/nsDmoZsm.png)\n\n\nAnd it is **not** able to do this:\n\n![](http://i.stack.imgur.com/kQ4hx.png)\n\n*Note: this image is stolen shamelessly from this Stackoverflow post: [http://stackoverflow.com/questions/20456322/preparing-customized-radio-group-type-of-layout](http://stackoverflow.com/questions/20456322/preparing-customized-radio-group-type-of-layout)\n\nWith `RadioGroupPlus`, you can do this:\n\n![](http://i.imgur.com/HvtQ598.gif)\n\nDoc\n-------\nEverything should function the same as the original `RadioGroup`, so refer to this: [http://developer.android.com/reference/android/widget/RadioGroup.html](http://developer.android.com/reference/android/widget/RadioGroup.html)\n\nDemo\n-------\nRefer to `app/` folder of this repo.\n\nUsage\n-------\nSimple example:\n\n```\n   \u003cworker8.com.github.radiogroupplus.RadioGroupPlus\n        android:id=\"@+id/radio_group_plus\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:orientation=\"vertical\"\u003e\n        \u003cLinearLayout...\u003e\n           \u003cImageView...\u003e\n           \u003cTextView...\u003e\n           \u003cRadioButton...\u003e\n        \u003c/LinearLayout\u003e\n        \u003cLinearLayout...\u003e\n           \u003cImageView...\u003e\n           \u003cTextView...\u003e\n           \u003cRadioButton...\u003e\n        \u003c/LinearLayout\u003e\n        \u003cLinearLayout...\u003e\n           \u003cImageView...\u003e\n           \u003cTextView...\u003e\n           \u003cRadioButton...\u003e\n        \u003c/LinearLayout\u003e\n   \u003c/worker8.com.github.radiogroupplus.RadioGroupPlus\u003e\n```\n\nExplanation: the 3 `RadioButton` shown in the code above will be linked together by `RadioGroupPlus` automatically.\n\n---\n\nIf you want a even weirder layout, it will also work, for example:\n\n    \u003cworker8.com.github.radiogroupplus.RadioGroupPlus\n        android:id=\"@+id/radio_group_plus\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:orientation=\"vertical\"\u003e\n        \u003cLinearLayout...\u003e\n           \u003cImageView...\u003e\n           \u003cTextView...\u003e\n           \u003cRadioButton...\u003e\n        \u003c/LinearLayout\u003e\n        \u003cLinearLayout...\u003e\n           \u003cImageView...\u003e\n           \u003cTextView...\u003e\n           \u003cRadioButton...\u003e\n        \u003c/LinearLayout\u003e\n        \u003cLinearLayout...\u003e\n          \u003cRelativeLayout\u003e\n             \u003cImageView...\u003e\n             \u003cTextView...\u003e\n             \u003cRadioButton...\u003e\n          \u003c/RelativeLayout\u003e\n          \u003cRelativeLayout\u003e\n             \u003cImageView...\u003e\n             \u003cTextView...\u003e\n             \u003cRadioButton...\u003e\n          \u003c/RelativeLayout\u003e\n        \u003c/LinearLayout\u003e\n    \u003c/worker8.com.github.radiogroupplus.RadioGroupPlus\u003e\n\nNow the 2 `RadioButton` under the `LinearLayout` and the 2 `RadioButton` inside the `RelativeLayout` will all be linked together.\n\nIn fact, there is no limitation to what the layout should look like, because `RadioGroupPlus` will just look for all the `RadioButton` in it's children and link them together.\n\nHow it works / Contribute\n-------\nYou don't actually need to read this part unless you are interested or you want to contribute or fix this repo. I wrote a simple `TreeTraversel` to traverse all the children that will be added to `RadioGroupPlus`, a Pre-order traversal is used but there is no special reason of why because it doesn't really matter in this case. \n\nWhile traversing, the listener `mChildOnCheckedChangeListener` is added to the `RadioButton`, so when the `RadioButton` is clicked, `mChildOnCheckedChangeListener` will be called, and `CheckedStateTracker#onCheckedChanged` will be called to properly toggle the `RadioButton`s.\n\nIn short, look for `traverseTree()` in [](https://github.com/worker8/RadioGroupPlus/blob/master/radiogroupplus/src/main/java/worker8/com/github/radiogroupplus/RadioGroupPlus.java) if you want to make changes.\n\n\nDownload/Install\n-------\nAdd this to **top** level `build.gradle`:\n\n    allprojects {\n        repositories {\n            maven { url \"https://jitpack.io\" }\n        }\n    }\n\nAdd this under dependencies:\n\n    compile 'com.github.worker8:RadioGroupPlus:v1.0.1'\n\nIf you run into conflict, use this instead:\n\n    compile('com.github.worker8:RadioGroupPlus:v1.0.1') {\n        transitive = false;\n    }\n    \n\nThe MIT License (MIT)\n-------\n\n    Copyright 2015 Tan Jun Rong\n\n    Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\n    The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n    THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworker8%2Fradiogroupplus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fworker8%2Fradiogroupplus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworker8%2Fradiogroupplus/lists"}