{ "id": "154924", "key": "TIMOB-20403", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "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": "17706", "name": "Release 5.4.0", "archived": false, "released": true, "releaseDate": "2016-08-11" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2016-03-28T21:26:03.000+0000", "created": "2016-02-15T13:04:51.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "progressbar", "qe-5.4.0" ], "versions": [ { "id": "16997", "name": "Release 5.2.0", "archived": false, "released": true, "releaseDate": "2016-02-23" } ], "issuelinks": [], "assignee": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2016-06-10T00:10:16.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": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "The following code sample and attached screenshots shows that the {{min}} and {{max}} property are ignored when setting the tracker position at creation. Not until after layout will setting the value result in the proper position.\r\n\r\nIn the code we hardcode the default 0/1 min/max and then calculate the value back to this using the min/max set bij the user. It seems like we don't do this at creation and any value > the hardcoded max will show as a full progress bar.\r\n\r\nhttps://github.com/appcelerator/titanium_mobile/blob/1607237763f9e490e41d98b8d711ac49eeb01043/iphone/Classes/TiUIProgressBar.m#L159\r\n\r\n{code:js}\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: 'white'\r\n});\r\n\r\n// OK: default min:0, max:1 with value:0.5\r\nwin.add(Ti.UI.createProgressBar({\r\n top: 50,\r\n width: 250,\r\n value: 0.5\r\n}));\r\n\r\n// OK: set min:0, max:1 with value:0.5\r\nwin.add(Ti.UI.createProgressBar({\r\n top: 100,\r\n width: 250,\r\n min: 0,\r\n max: 1,\r\n value: 0.5\r\n}));\r\n\r\n// WRONG: min:0, max:10 with value:5 (shows as value:10)\r\nwin.add(Ti.UI.createProgressBar({\r\n top: 150,\r\n width: 250,\r\n min: 0,\r\n max: 10,\r\n value: 5\r\n}));\r\n\r\n// WRONG: min:0, max:10 with value:0.5 (shows above is because at creation min/max are ignored to calculate value position)\r\nwin.add(Ti.UI.createProgressBar({\r\n top: 200,\r\n width: 250,\r\n min: 0,\r\n max: 10,\r\n value: 0.5\r\n}));\r\n\r\n// WRONG: min:0, max:10 with value:5 (shows it not just fails at creation)\r\nvar pb1 = Ti.UI.createProgressBar({\r\n top: 250,\r\n width: 250,\r\n min: 0,\r\n max: 10,\r\n value: 5\r\n});\r\npb1.value = 5;\r\nwin.add(pb1);\r\n\r\n// OK: min:0, max:10 with value:5 (shows it fails before layout)\r\nvar pb2 = Ti.UI.createProgressBar({\r\n top: 300,\r\n width: 250,\r\n min: 0,\r\n max: 10,\r\n value: 5\r\n});\r\nwin.add(pb2);\r\n\r\nwin.open();\r\npb2.value = 5;\r\n{code}", "attachment": [ { "id": "58237", "filename": "Simulator Screen Shot 15 Feb 2016 14.01.38.png", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2016-02-15T13:01:42.000+0000", "size": 16896, "mimeType": "image/png" } ], "flagged": false, "summary": "iOS: ProgressBar tracker position not set correctly before layout", "creator": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "subtasks": [], "reporter": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "environment": "SDK 5.2.0, 5.1.2.GA\r\niOS 9.2 Simulator", "closedSprints": [ { "id": 614, "state": "closed", "name": "2016 Sprint 07 SDK", "startDate": "2016-03-26T00:38:56.432Z", "endDate": "2016-04-09T00:38:00.000Z", "completeDate": "2016-04-11T04:41:08.231Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "376924", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Do we know if this is a regression?", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-02-15T16:17:32.000+0000", "updated": "2016-02-15T16:17:32.000+0000" }, { "id": "376949", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "No, same result with 5.1.2.GA", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2016-02-16T08:15:32.000+0000", "updated": "2016-02-16T08:15:32.000+0000" }, { "id": "380724", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "PR: https://github.com/appcelerator/titanium_mobile/pull/7887", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-03-26T01:11:42.000+0000", "updated": "2016-03-26T01:11:42.000+0000" }, { "id": "387994", "author": { "name": "htbryant", "key": "htbryant", "displayName": "Harry Bryant", "active": true, "timeZone": "Europe/London" }, "body": "Verified as fixed, compared the progress bars against the correct positions stated in the comments of the sample code, and found no inconsistencies.\r\n\r\n\r\nTested On:\r\niPhone 6S (9.3.2) Device\r\nMac OSX El Capitan 10.11.5 \r\nTi SDK: 5.4.0.v20160608165242\r\nAppc Studio: 4.6.0.201605201934\r\nAppc NPM: 4.2.7-2\r\nApp CLI: 5.4.0-15\r\nXcode 7.3\r\nNode v4.2.6\r\n*Closing ticket.*", "updateAuthor": { "name": "htbryant", "key": "htbryant", "displayName": "Harry Bryant", "active": true, "timeZone": "Europe/London" }, "created": "2016-06-10T00:10:02.000+0000", "updated": "2016-06-10T00:10:02.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }