{ "id": "134481", "key": "TIMOB-17491", "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": "16586", "description": "Release 3.4.2", "name": "Release 3.4.2", "archived": false, "released": true, "releaseDate": "2017-03-11" }, { "id": "16704", "description": "Release 3.5.0", "name": "Release 3.5.0", "archived": false, "released": true, "releaseDate": "2015-01-13" }, { "id": "16593", "description": "Release 4.0.0", "name": "Release 4.0.0", "archived": false, "released": true, "releaseDate": "2015-05-21" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2014-11-04T22:42:44.000+0000", "created": "2014-08-11T13:59:17.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "android", "contentOffset", "parity", "scrollview" ], "versions": [ { "id": "15972", "description": "Release 3.4.0", "name": "Release 3.4.0", "archived": false, "released": true, "releaseDate": "2014-09-28" } ], "issuelinks": [], "assignee": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2015-04-19T16:07:09.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": "The contentOffset property (reflecting what's currently visible in a ScrollView), is undefined on Android.\r\n\r\nDocumentation of [UI.ScrollView|(http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.UI.ScrollView-property-contentOffset] says it's available on Android since 0.9, however in version 3.3.0 GA it (still?) doesn't work.\r\n\r\nh4. Notes\r\n* contentOffset is not set manually anywhere in the test code\r\n* I'm talking about UI.ScrollView, not tableview or listview\r\n\r\nh3. How to reproduce\r\nCreate a ScrollView\r\n{code:title=test.xml|borderStyle=solid}\r\n\r\n\t\r\n\r\n{code}\r\n\r\nIn the controller, try to get the value of the property :\r\n{code:title=test.js|borderStyle=solid}\r\nalert($.myscrollview.contentOffset.x);\r\n{code}\r\n\r\nh3. Actual result\r\n\r\nOn iOS : the value is properly displayed and reflects any scrolling (manual or not) done on the ScrollView\r\n\r\nOn Android : a runtime error occurs with the following message :\r\n{panel:title=Runtime Error}\r\nMessage:\r\nUncaught TypeError: Cannot read property 'x' of undefined\r\nSource:\r\nalert($.myscrollview.contentOffset.x);\r\n{panel}\r\n\r\nh3. Expected result\r\nBoth iOS & Android should produce the same result.\r\nLooking at the source of [TiUIScrollView.java|https://github.com/appcelerator/titanium_mobile/blob/master/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIScrollView.java] we see that indeed the property is supposed to be updated upon scrolling. However the property is not accessible from JavaScript on Android. (Could it be a problem in the proxy?)", "attachment": [], "flagged": false, "summary": "Android: contentOffset property of UI.ScrollView not accessible", "creator": { "name": "kayl", "key": "kayl", "displayName": "Kevin Frugier", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "kayl", "key": "kayl", "displayName": "Kevin Frugier", "active": true, "timeZone": "Europe/Berlin" }, "environment": "Android Titanium 3.3.0 GA\r\nAndroid Titanium 3.4.0 GA", "closedSprints": [ { "id": 241, "state": "closed", "name": "2014 Sprint 22 SDK", "startDate": "2014-10-27T22:25:43.407Z", "endDate": "2014-11-08T01:00:00.000Z", "completeDate": "2014-11-10T20:10:00.899Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "318164", "author": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "body": "Can reproduce with SDK 3.2.3 GA and 3.3.0 GA on Android 4.2.2.\r\nHere is a simple test case.\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: 'white',\r\n exitOnClose: true,\r\n fullscreen: false,\r\n title: 'ScrollView Demo'\r\n});\r\n\r\nvar scrollView = Ti.UI.createScrollView({\r\n contentWidth: 'auto',\r\n contentHeight: 'auto',\r\n showVerticalScrollIndicator: true,\r\n showHorizontalScrollIndicator: true,\r\n height: '80%',\r\n width: '80%'\r\n});\r\nvar view = Ti.UI.createView({\r\n backgroundColor:'#336699',\r\n borderRadius: 10,\r\n //top: 10,\r\n height: 2000,\r\n width: 1000\r\n});\r\n\r\n// output the contentOffset value\r\nTi.API.info(scrollView.contentOffset.x);\r\n\r\nscrollView.add(view);\r\nwin.add(scrollView);\r\nwin.open();\r\n{code} ", "updateAuthor": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "created": "2014-08-12T08:34:59.000+0000", "updated": "2014-08-12T08:34:59.000+0000" }, { "id": "330128", "author": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "body": "master PR: https://github.com/appcelerator/titanium_mobile/pull/6292\r\n3.4.X PR: https://github.com/appcelerator/titanium_mobile/pull/6313", "updateAuthor": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-10-30T21:21:27.000+0000", "updated": "2014-11-05T19:35:55.000+0000" }, { "id": "333574", "author": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The contentOffset property for ScrollView is accessible now and does not show any error. Tested with both the alloy and classic code provided.\r\nVerified on:\r\nSDK: 3.5.0.v20141124155715\r\nStudio: 3.4.1.201410281743\r\nCLI: 3.4.1\r\nAlloy: 1.5.1\r\nDevice: Samsung Galaxy S5 (v4.4.2)", "updateAuthor": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-11-25T07:07:03.000+0000", "updated": "2014-11-25T07:07:03.000+0000" }, { "id": "350055", "author": { "name": "titanium@webmasterei-hamburg.de", "key": "titanium@webmasterei-hamburg.de", "displayName": "Rainer Schleevoigt", "active": true, "timeZone": "Europe/Berlin" }, "body": "It doesn't work with SDK3.5.1.GA", "updateAuthor": { "name": "titanium@webmasterei-hamburg.de", "key": "titanium@webmasterei-hamburg.de", "displayName": "Rainer Schleevoigt", "active": true, "timeZone": "Europe/Berlin" }, "created": "2015-04-19T16:07:09.000+0000", "updated": "2015-04-19T16:07:09.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }