{ "id": "64010", "key": "TIMOB-3378", "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": "12083", "description": "", "name": "Sprint 2011-43", "archived": true, "released": true, "releaseDate": "2011-10-31" }, { "id": "12580", "description": "Dual Runtime 1.8.0", "name": "Release 1.8.0.1", "archived": true, "released": true, "releaseDate": "2011-12-22" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-01-03T18:04:40.000+0000", "created": "2011-04-15T03:43:31.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "module_scrollview", "qe-testadded" ], "versions": [ { "id": "11260", "description": "", "name": "Release 1.6.2", "archived": true, "released": true, "releaseDate": "2011-04-20" } ], "issuelinks": [], "assignee": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2013-11-19T06:14:22.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": "{html}

It seems to me that the remove() method on ScrollView doesn't do\r\nits job on Android (build 1.6.0+ from continous builds). Here is a\r\ntest code where a button should be removed from the view when it's\r\nclicked:

\r\n
\r\nvar win = Titanium.UI.createWindow({  \r\n    title:'Scrollview test window',\r\n    backgroundColor:'#fff'\r\n});\r\n\r\nvar scrollview = Ti.UI.createScrollView({layout: 'vertical'});\r\n\r\nwin.add(scrollview);\r\n\r\nfunction onButtonClick(event){\r\n    var button = event.source;\r\n    var n = Ti.UI.createNotification({message: 'Removed button \"' + button.title + '\"'});\r\n    n.duration = Ti.UI.NOTIFICATION_DURATION_LONG;\r\n    button.removeEventListener('click', onButtonClick);\r\n    scrollview.remove(button);\r\n    n.show();\r\n}\r\n\r\nvar i, button;\r\nfor (i = 0; i < 30; i++) {\r\n    button = Ti.UI.createButton({title: String.format('Click to remove #%d', i)});\r\n    button.addEventListener('click', onButtonClick);\r\n    scrollview.add(button);\r\n}\r\n\r\nwin.open();\r\n
\r\n

I've attached a test project containing this code for you to\r\nenjoy.

{html}", "attachment": [ { "id": "23968", "filename": "Screen shot 2011-10-31 at 5.38.42 PM.png", "author": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-10-31T16:50:30.000+0000", "size": 1136601, "mimeType": "image/png" }, { "id": "18311", "filename": "scrollviewtest.tgz", "author": { "name": "albertoberti", "key": "albertoberti", "displayName": "Alberto Berti", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:43:32.000+0000", "size": 740522, "mimeType": "application/x-gzip" } ], "flagged": false, "summary": "Android: ScrollView.remove() doesn't really remove on android", "creator": { "name": "albertoberti", "key": "albertoberti", "displayName": "Alberto Berti", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "albertoberti", "key": "albertoberti", "displayName": "Alberto Berti", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "160571", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "I can confirm this on Titanium 1.7.1 (2011/06/17 00:13 293a6d...). Below is a simplified testcase:\r\n\r\n{code:javascript|title=app.js}\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor: 'blue'\r\n});\r\n\r\nvar scrollView = Ti.UI.createScrollView({\r\n\tlayout: 'vertical'\r\n});\r\n\r\nvar label = Ti.UI.createLabel({\r\n\ttext: 'Test',\r\n\ttop:20,\r\n\twidth: 300\r\n});\r\n\r\nvar textField = Ti.UI.createTextField({\r\n\ttop:20,\r\n\twidth: 300\r\n});\r\n\r\nscrollView.add(label);\r\nscrollView.add(textField);\r\n\r\nwin.add(scrollView);\r\n\r\nscrollView.addEventListener('click', function(){\r\n\tscrollView.remove(textField);\r\n});\r\n\r\nwin.open();\r\n{code}\r\n\r\n", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2011-07-26T03:43:16.000+0000", "updated": "2011-08-11T05:03:49.000+0000" }, { "id": "162560", "author": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "Workaround is to add components to \"View\" component, add that \"View\" component to \"ScrollView\" component and then remove components from \"View\" component.\r\n\r\n\r\nAnyway, I would really appreciate if this would be fixed soon. Thanks. :)", "updateAuthor": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2011-08-11T05:15:50.000+0000", "updated": "2011-08-11T05:15:50.000+0000" }, { "id": "170980", "author": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Just found another issue, maybe related to this bug. I ran the same test code on both iphone and android, and they have very different looks (see attachment [^Screen shot 2011-10-31 at 5.38.42 PM.png]).\r\n\r\n{code}\r\nvar win = Titanium.UI.createWindow({ backgroundColor:'#f0f0f0' });\r\n\r\nvar parent = Ti.UI.createView({ width:150, height:150, top:0, left:0, borderColor:'red', borderWidth:3 });\r\n\r\nvar greenView = Ti.UI.createScrollView({ width:100, height:100, top:0, left:0, borderColor:'green', borderWidth:1 });\r\n\r\nvar child = Ti.UI.createView({ width:10, height:10, top:15, left:15, borderColor:'black', borderWidth:3 });\r\n\r\nvar button1 = Ti.UI.createButton({ title:'remove from scrollview', top:150, left:0, width:200, height:40 });\r\nvar button2 = Ti.UI.createButton({ title:'remove from view', top:200, left:0, width:200, height:40 });\r\n\r\nbutton1.addEventListener('click', function() { greenView.remove(child); });\r\nbutton2.addEventListener('click', function() { parent.remove(greenView); });\r\nwin.add(parent);\r\nparent.add(greenView);\r\ngreenView.add(child);\r\nwin.add(button1);\r\nwin.add(button2);\r\nwin.open();\r\n{code}", "updateAuthor": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-10-31T16:49:05.000+0000", "updated": "2011-10-31T16:53:37.000+0000" }, { "id": "171170", "author": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Fixed the ScrollView.remove() issue. The pull request is https://github.com/appcelerator/titanium_mobile/pull/616 .\r\nThe issue that one code generates two different looks on iphone and android is not related to the remove() issue.", "updateAuthor": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-11-02T08:53:24.000+0000", "updated": "2011-11-02T08:53:24.000+0000" }, { "id": "172215", "author": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Pull request accepted.", "updateAuthor": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-11-10T14:00:46.000+0000", "updated": "2011-11-10T14:00:46.000+0000" }, { "id": "172686", "author": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "Doesn't work with latest 1.8.0 build: Titanium SDK version: 1.8.0 (11/14/11 10:39 1012866...), using Rhino engine.", "updateAuthor": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2011-11-15T04:55:34.000+0000", "updated": "2011-11-15T04:55:34.000+0000" }, { "id": "172701", "author": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "body": "@Ivan, notice the fixVersion says it was committed to \"Release 1.8.0.1\" that's on master. It was not committed to the 1_8_X (\"Release 1.8.0\") branch. Try it on 1.8.0.1 please.", "updateAuthor": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-11-15T08:10:12.000+0000", "updated": "2011-11-15T08:10:12.000+0000" }, { "id": "175283", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified fixed with SDK 1.8.0.1.v20111207112258 in both Rhino and V8 on Nexus S 2.3.6 and Droid 3 2.3.4 using Titanium Studio, build: 1.0.7.201112061404.", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-12-07T16:42:37.000+0000", "updated": "2011-12-07T16:42:37.000+0000" }, { "id": "177920", "author": { "name": "mpettiford", "key": "mpettiford", "displayName": "Michael Pettiford", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Reopening/closing to add labels", "updateAuthor": { "name": "mpettiford", "key": "mpettiford", "displayName": "Michael Pettiford", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-01-03T18:04:17.000+0000", "updated": "2012-01-03T18:04:17.000+0000" }, { "id": "280129", "author": { "name": "jithinv@exalture.com", "key": "jithinv@exalture.com", "displayName": "jithinpv", "active": true, "timeZone": "America/Los_Angeles" }, "body": "anvil test case added\nPR Link:\nhttps://github.com/appcelerator/titanium_mobile/pull/4958", "updateAuthor": { "name": "jithinv@exalture.com", "key": "jithinv@exalture.com", "displayName": "jithinpv", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-11-19T06:14:22.000+0000", "updated": "2013-11-19T06:14:22.000+0000" } ], "maxResults": 13, "total": 13, "startAt": 0 } } }