[TIMOB-16556] AlertDialog: ButtonNames buttons are shown in opposite order of their position in array
GitHub Issue | n/a |
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2018-08-21T19:59:03.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | n/a |
Labels | android |
Reporter | Tim Poulsen |
Assignee | Unknown |
Created | 2014-03-03T15:17:42.000+0000 |
Updated | 2018-08-21T19:59:03.000+0000 |
Description
Buttons added to the ButtonNames array should be displayed in the order, left to right, as their position in the array. In other words, the first button in the array should be shown first on the left.
They are shown in opposite order (first is on the right)
Attachments
This is not an Alloy bug. It happens with Classic code as well. Test case:
[~ingo] This has been raised as an issue by ACE. To follow both the iOS and Android design guidelines requires some nasty branching. Can we get this prioritised?
This is not a bug since before ICS the default order is "OK/Cancel." Starting ICS, the order is changed to "Cancel/OK." So if I have an alertdialog like this: var dialog = Ti.UI.createAlertDialog({ cancel: 1, buttonNames: ['OK', 'Cancel'], message: 'message', title: 'title' }); It adapts to platform's default automatically.
[~shawnlan] looking at the design guidelines for iOS and Android, for non-destructive alerts (which I think should be the default), the button order should be the same: Android http://developer.android.com/design/building-blocks/dialogs.html "The dismissive action of a dialog is always on the left. Dismissive actions return to the user to the previous state. The affirmative actions are on the right. Affirmative actions continue progress toward the user goal that triggered the dialog." Order: Cancel | OK iOS https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/Alerts.html "When the most likely button performs a nondestructive action, it should be on the right in a two-button alert. The button that cancels this action should be on the left." Order: Cancel | OK
Sorry I'm not talking about iOS vs Android. I'm talking about Android 14+ vs earlier versions. Check this: http://stackoverflow.com/questions/12705058/ok-cancel-buttons-order-in-ics
[~shawnlan] FYI, we don't support versions earlier than ICS as of 4.0.
This is not a bug. Android 4.0 reversed the button order in dialogs from left-to-right (Windows style) to right-to-left (Apple style). So, if given button array
["OK", "Cancel"]
, on Android 2.2 it would appear[OK][Cancel]
and on Android 4.0 it would appear[Cancel][OK]
. This is the correct behavior and respects the native UI guidelines of the environment.