Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-26224

Android: Modify "OptionDialog" to display a list of normal buttons

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Medium
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Android
    • Story Points:
      3

      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

          Issue Links

            Activity

              People

              • Assignee:
                jquick Joshua Quick
                Reporter:
                jquick Joshua Quick
              • Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                    Git Source Code