Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-3200] Android: Add radio button group support

GitHub Issuen/a
TypeNew Feature
PriorityMedium
StatusClosed
ResolutionDuplicate
Resolution Date2020-02-13T15:12:47.000+0000
Affected Version/sRelease 3.0.0
Fix Version/sn/a
ComponentsAndroid
Labelsandroid, api, button
ReporterIan Hawes
AssigneeYordan Banev
Created2011-04-15T03:39:18.000+0000
Updated2021-01-16T03:20:30.000+0000

Description

*Summary:* We should add a radio button group like feature on all platforms (Android, iOS, and Windows) where a horizontal layout of buttons are displayed, but only one option can be selected at a time. On Android and Windows, this is a built-in UI component that we should use. https://developer.android.com/guide/topics/ui/controls/radiobutton On iOS, this should be implemented via a UISegmentedControl. https://developer.apple.com/design/human-interface-guidelines/ios/controls/segmented-controls *Recommend Solution:* Should be implemented in Titanium similar to Ti.UI.TabbedBar... https://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.TabbedBar The idea is that the Titanium developer creates the "group" view, but does not have access to the individual buttons within the group. This will help make it more portable between Android and iOS. The radio buttons will be created via a creation-only "labels" property, which is assigned an array of strings, just like how it works with Ti.UI.TabbedBar and Ti.UI.ButtonBar. We should also support an "index" property to indicate which button is selected and the "click" event when a button has been clicked on. This is how it's implemented in Ti.UI.TabbedBar as well. The layout should be horizontal by default. Especially since iOS' UISegmentedControl can only be displayed horizontally. Vertical layout support would be nice, but it is only natively supported on Android and Windows. *Future:* We may also want to support the "Choice Chips" feature as shown in Google's material design below. New Chip and ChipGroup Java classes have been added to Google's Support Library version 28. This could be implemented via the view's "style" property in the future. https://material.io/design/components/chips.html

Comments

  1. Junaid Younus 2012-08-31

    Can't seem to find that we have a radio widget for Android in our docs, changed from bug to feature request.
  2. Ingo Muschenetz 2013-04-01

    We don't want to implement it for iOS, but here's a discussion for doing so: http://stackoverflow.com/questions/4847296/best-radio-button-implementation-for-ios
  3. Biju pm 2014-02-14

    PR : https://github.com/appcelerator/titanium_mobile/pull/5352
  4. Rene Pot 2020-02-13

    closed in favor of TIMOB-25954
  5. Joshua Quick 2021-01-16

    The plan is to implement radio buttons via: [TIMOB-28317]

JSON Source