Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26224] Android: Modify "OptionDialog" to display a list of normal buttons

GitHub Issuen/a
TypeImprovement
PriorityMedium
StatusClosed
ResolutionDuplicate
Resolution Date2019-04-24T22:30:15.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid
LabelsOptionDialog, android
ReporterJoshua Quick
AssigneeJoshua Quick
Created2018-07-21T03:50:23.000+0000
Updated2019-04-24T22:30:15.000+0000

Description

*Summary:* The Ti.UI.OptionDialog currently displays a vertical list of radio buttons, but none of the radio buttons are ever enabled if property selectedIndex is not set. This is not a good interface. Especially if the buttonNames property is not set as well. It would be better to display a vertical list of normal button like how it works on iOS.
var window = Ti.UI.createWindow();
var button = Ti.UI.createButton({ title: "Show Dialog" });
button.addEventListener("click", function(e) {
	var dialog = Ti.UI.createOptionDialog({
		title: "Option Dialog",
		options: ["Option 1", "Option 2", "Cancel"],
		cancel: 2,
	});
	dialog.addEventListener("click", function(e) {
		Ti.API.info("@@@ Dialog 'click' index: " + e.index + ", button: " + e.button + ", cancel: " + e.cancel);
	});
	dialog.show();
});
window.add(button);
window.open();
We should only use radio buttons if the buttonNames property is also set. In which case, tapping a radio button should not automatically close the dialog. Doing it this way, we'll be following Google's material design guideline here... https://material.io/design/components/dialogs.html#usage

Attachments

FileDateSize
OptionDialog.png2018-07-21T03:50:03.000+000038674

Comments

No comments

JSON Source