{ "id": "91213", "key": "TIMOB-8954", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "13271", "description": "Release 2.1.0", "name": "Release 2.1.0", "archived": false, "released": true, "releaseDate": "2012-06-29" }, { "id": "13405", "description": "Sprint 2012-09 API", "name": "Sprint 2012-09 API", "archived": true, "released": true, "releaseDate": "2012-05-06" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-05-03T13:29:03.000+0000", "created": "2012-05-02T12:37:01.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "API", "qe-testadded" ], "versions": [], "issuelinks": [ { "id": "21593", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "102272", "key": "TIMOB-11184", "fields": { "summary": "Android: Cancelable ActivityIndicator", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "17014", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "90891", "key": "TIMOB-8889", "fields": { "summary": "Android: android:back event does not get fired from activity indicator", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "Medium", "id": "3" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2012-09-27T00:40:01.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "h3. Feature\r\n\r\nAllow ActivityIndicator dialogs on Android to be cancelable by the user.\r\nNote: this is an Android only feature and doesn't require parity with iOS and MobileWeb\r\nsince they don't use modal dialogs.\r\n\r\nh3. API Changes\r\n\r\n- New property: cancelable\r\n When true the indicator can be canceled by the user.\r\n- New event: cancel\r\n Fired when the user has canceled the indicator. This is called after the indicator\r\n dialog has been hidden, so the developer does not need to call hide() manually.\r\n\r\nh3. Test case\r\n{code}\r\nvar hideIndicatorTimeout = null;\r\n\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor: \"red\",\r\n\tlayout: 'vertical'\r\n});\r\n\r\nvar indicator = Ti.UI.createActivityIndicator({\r\n message: \"Processing...\",\r\n cancelable: true // Indicator will be cancelable by setting this to true.\r\n});\r\nindicator.addEventListener('cancel', function() {\r\n\t// Fired when the user has canceled this indicator.\r\n\tclearTimeout(hideIndicatorTimeout);\r\n\talert(\"Aborted processing\");\r\n});\r\n\r\nvar cancelableSwitch = Titanium.UI.createSwitch({\r\n\ttitle: 'Cancelable',\r\n\tstyle: Ti.UI.Android.SWITCH_STYLE_CHECKBOX,\r\n value: true\r\n});\r\ncancelableSwitch.addEventListener('change',function(e)\r\n{\r\n indicator.cancelable = e.value;\r\n});\r\nwin.add(cancelableSwitch);\r\n\r\nvar showIndicatorButton = Ti.UI.createButton({\r\n\ttitle: \"Show Indicator\"\r\n});\r\nshowIndicatorButton.addEventListener('click', function() {\r\n\tindicator.show();\r\n\thideIndicatorTimeout = setTimeout(function() {\r\n\t\tindicator.hide();\r\n\t}, 5000);\r\n});\r\nwin.add(showIndicatorButton);\r\n\r\nwin.open();\r\n{code}\r\n\r\n1. Start up the application.\r\n2. Click \"Show Indicator\".\r\n3. Wait for it to go away (~5 seconds).\r\n4. Click \"Show Indicator\" again.\r\n5. Press the BACK button, the dialog should go away. You should also see an alert popup.\r\n6. Uncheck \"Cancelable\" and click \"Show Indicator\" again.\r\n7. Try hitting the BACK button, nothing should happen. Dialog should disappear in 5 seconds.\r\n8. Check \"Cancelable\" and click \"Show Indicator\".\r\n9. Try hitting the BACK button, the dialog should go away and alert popup (same as step 5).", "attachment": [], "flagged": false, "summary": "Android: Cancelable ActivityIndicator", "creator": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "193468", "author": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Sent [Pull Request #2118|https://github.com/appcelerator/titanium_mobile/pull/2118].\r\nIncludes implementation and documentation updates.", "updateAuthor": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-05-02T12:58:59.000+0000", "updated": "2012-05-02T12:58:59.000+0000" }, { "id": "197421", "author": { "name": "dhyde", "key": "dhyde", "displayName": "Dustin Hyde", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing as Fixed.\r\n\r\nVerified via test code.\r\n\r\nSDK: 2.1.0.v20120605140359\r\nStudio: 2.1.0.201206041625\r\nOS: Snow Leopard\r\nAndroid: V8\r\nDevices Tested: Nexus One 2.2.2, Nexus S 4.0.4", "updateAuthor": { "name": "dhyde", "key": "dhyde", "displayName": "Dustin Hyde", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-06-05T17:03:18.000+0000", "updated": "2012-06-05T17:03:18.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }