{ "id": "110926", "key": "TIMOB-13020", "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": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" }, { "id": "15274", "description": "2013 Sprint 06 API", "name": "2013 Sprint 06 API", "archived": true, "released": true, "releaseDate": "2013-03-25" }, { "id": "14816", "description": "2013 Sprint 06", "name": "2013 Sprint 06", "archived": true, "released": true, "releaseDate": "2013-03-25" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-03-19T02:14:59.000+0000", "created": "2013-03-11T01:15:16.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "module_AndroidProperties", "qe-testadded" ], "versions": [ { "id": "14164", "description": "Release 3.0.2", "name": "Release 3.0.2", "archived": true, "released": true, "releaseDate": "2013-02-19" } ], "issuelinks": [ { "id": "26918", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "111575", "key": "TIMOB-13177", "fields": { "summary": "iOS: Parity - view properties are not applying correctly on iOS", "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 } } } } ], "assignee": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2013-03-23T20:43:04.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": "Given:\r\n{code}\r\n// this sets the background color of the master UIView (when there are no windows/tab groups on it)\r\nTitanium.UI.setBackgroundColor('#000');\r\n\r\n// create tab group\r\nvar tabGroup = Titanium.UI.createTabGroup();\r\n\r\n// create base UI tab and root window\r\nvar win1 = Titanium.UI.createWindow({ \r\n title:'Tab 1',\r\n backgroundColor:'#fff'\r\n});\r\nvar tab1 = Titanium.UI.createTab({ \r\n icon:'KS_nav_views.png',\r\n title:'Tab 1',\r\n window:win1\r\n});\r\n\r\nvar label1 = Titanium.UI.createLabel({\r\n\tcolor:'#999',\r\n\ttext:'I am Window 1',\r\n\tfont:{fontSize:20,fontFamily:'Helvetica Neue'},\r\n\ttextAlign:'center',\r\n\twidth:'auto'\r\n});\r\n\r\nwin1.add(label1);\r\n\r\nvar viewy = Ti.UI.createView({width:100, height:100, top: 50, left: 50, backgroundColor:'#f00'});\r\n\r\nfunction doWork(){\r\n\tviewy.applyProperties({top:150,left:150});\r\n\tviewy.applyProperties({top:50,left:50});\r\n}\r\n\r\nwin1.add(viewy);\r\n\r\nvar btn1 = Ti.UI.createButton({width:200,height:60,left:10,top:410,title:'Test!'});\r\nwin1.add(btn1);\r\nbtn1.addEventListener('click',function(){\r\n\tlabel1.text = 'Testing...';\r\n\tvar startTime = Date.now();\r\n\tfor(i=0;i<1000;i++){\r\n\t\tdoWork();\r\n\t}\r\n\tvar endTime = Date.now();\r\n\tlabel1.text = 'This command USED TO take '+(endTime-startTime)+' microsecs.';\r\n\tTi.API.debug(label1.text);\t\r\n})\r\n\r\n\r\n//\r\n// create controls tab and root window\r\n//\r\nvar win2 = Titanium.UI.createWindow({ \r\n title:'Tab 2',\r\n backgroundColor:'#fff'\r\n});\r\nvar tab2 = Titanium.UI.createTab({ \r\n icon:'KS_nav_ui.png',\r\n title:'Tab 2',\r\n window:win2\r\n});\r\n\r\nvar label2 = Titanium.UI.createLabel({\r\n\tcolor:'#999',\r\n\ttext:'I am Window 2',\r\n\tfont:{fontSize:20,fontFamily:'Helvetica Neue'},\r\n\ttextAlign:'center',\r\n\twidth:'auto'\r\n});\r\n\r\nwin2.add(label2);\r\ntabGroup.addTab(tab1); \r\ntabGroup.addTab(tab2); \r\ntabGroup.open();\r\n{code}\r\n\r\nTapping the button shows the view flickering from top left to bottom right as it should be, BUT sometimes it will show top right and bottom left as the properties in applyProperties are only half-applied before the draw phase. This means wasted draws and possible visual glitches.", "attachment": [], "flagged": false, "summary": "Android: applyProperties should be atomic for UI actions", "creator": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Android 4.0", "comment": { "comments": [ { "id": "242297", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "https://github.com/appcelerator/titanium_mobile/pull/3959", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-03-14T20:23:54.000+0000", "updated": "2013-03-14T20:23:54.000+0000" }, { "id": "243818", "author": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested with:\nTitanium Studio, build: 3.1.0.201303230404\nTitanium SDK, build: 3.1.0.v20130322171500\nDevice:\nNexus 4 Android version 4.2\n\nVerified the view flickering from top left to bottom right as it should be, according to code.", "updateAuthor": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-03-23T20:42:10.000+0000", "updated": "2013-03-23T20:42:10.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }