{ "id": "165504", "key": "AC-4758", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "2", "description": "The problem described is an issue which will never be fixed.", "name": "Won't Fix" }, "resolutiondate": "2017-01-29T16:16:33.000+0000", "created": "2017-01-28T13:35:48.000+0000", "labels": [ "alertDialog", "android", "community" ], "versions": [], "issuelinks": [], "assignee": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2017-01-29T16:16:33.000+0000", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "Adding an {{autoClose}} property that will keep the AlertDialog open after clicking a button. Default will be {{true}} so it will the same behaviour as before.\r\nYou have to manually call {{hide()}} to close the dialog when {{autoClose:false}}\r\n\r\n*Test code*\r\n\r\n\r\n{code:javascript}\r\nTi.UI.setBackgroundColor('white');\r\nvar win = Ti.UI.createWindow({\r\n title: 'Click window to test',\r\n backgroundColor: 'white',\r\n layout: \"vertical\"\r\n});\r\n\r\nvar btn1 = Ti.UI.createButton({\r\n title: \"Alert 1\"\r\n});\r\nwin.add(btn1);\r\nvar btn2 = Ti.UI.createButton({\r\n title: \"Alert 2\"\r\n});\r\nwin.add(btn2);\r\nvar btn3 = Ti.UI.createButton({\r\n title: \"Alert 3\"\r\n});\r\nwin.add(btn3);\r\n\r\nbtn1.addEventListener('click', function(e) {\r\n var dialog = Ti.UI.createAlertDialog({\r\n message: 'autoClose not set - default way',\r\n ok: 'Okay',\r\n title: 'autoClose'\r\n });\r\n dialog.show();\r\n});\r\nbtn2.addEventListener('click', function(e) {\r\n var dialog = Ti.UI.createAlertDialog({\r\n message: 'AutoClose true',\r\n ok: 'Okay',\r\n title: 'autoClose',\r\n autoClose: true\r\n });\r\n dialog.show();\r\n});\r\nbtn3.addEventListener('click', function(e) {\r\n var dialog = Ti.UI.createAlertDialog({\r\n cancel: 1,\r\n buttonNames: ['Confirm', 'Cancel', 'Help'],\r\n message: 'Click confirm and wait 3sec',\r\n ok: 'Okay',\r\n title: 'autoClose',\r\n autoClose: false\r\n });\r\n dialog.addEventListener('click', function(e) {\r\n Ti.API.info('e.index: ' + e.index);\r\n if (e.index == 0) {\r\n dialog.setMessage(\"closing...please wait 3sec\")\r\n setTimeout(function() {\r\n dialog.hide();\r\n }, 3000)\r\n } else {\r\n alert(\"Click confirm and wait\")\r\n }\r\n });\r\n dialog.show();\r\n});\r\nwin.open();\r\n{code}\r\n\r\n* First button: default way\r\n* Second button: autoClose: true \r\n* Third button: autoClose: false (new way)\r\n", "attachment": [], "flagged": false, "summary": "Android: add autoClose to AlertDialog to keep it open after clicking", "creator": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "environment": null, "comment": { "comments": [ { "id": "405574", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "I have to be honest, I don't like that functionality and would propose to not add it to the SDK. And that because of the simple reason that (modal) alerts are supposed to be dismissed, so this would produce a UX leak that I'd like to prevent here. I'm open for discussion, but please consider to use a custom UI component to that special use-case.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-01-29T09:53:39.000+0000", "updated": "2017-01-29T09:53:39.000+0000" }, { "id": "405575", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "I'll completely understand. It was a user request on tislack. The reason was that you are allowed to have inputs from the user in a dialog but you can't verify it without closing it when you click a button. Since it wasn't a big PR I'll did this. \r\nA workaround would already be to create a custom overlay view or window. This PR would just remove the need to create a custom window but stick to the AlertDialog to get the userdata. \r\nBut a custom AlertDialog module would be also a good idea. Then its SDK independent", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-01-29T11:19:38.000+0000", "updated": "2017-01-29T11:19:38.000+0000" }, { "id": "405578", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Thanks for the feedback. Resolving as {{Won't Fix}} based on the above reasons. Please feel free to patch the SDK anyway if this functionality is needed.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-01-29T16:16:33.000+0000", "updated": "2017-01-29T16:16:33.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }