{ "id": "63353", "key": "TIMOB-2721", "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": "15079", "description": "2013 Sprint 02 API", "name": "2013 Sprint 02 API", "archived": true, "released": true, "releaseDate": "2013-01-28" }, { "id": "14812", "description": "2013 Sprint 02", "name": "2013 Sprint 02", "archived": true, "released": true, "releaseDate": "2013-01-28" } ], "resolution": { "id": "2", "description": "The problem described is an issue which will never be fixed.", "name": "Won't Fix" }, "resolutiondate": "2013-01-23T18:46:47.000+0000", "created": "2011-04-15T03:27:47.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "api", "insight", "parity" ], "versions": [ { "id": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" } ], "issuelinks": [ { "id": "34648", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "inwardIssue": { "id": "87333", "key": "TIMOB-7877", "fields": { "summary": "Android: TableView scroll event contentOffset returning null", "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": "Low", "id": "4" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2014-01-29T07:51:35.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}

In the blog post here: \r\nhttp://developer.appcelerator.com/blog/2010/05/how-to-create-a-twee...

\r\n

The scroll event listener references a contentOffset property\r\nwhich has x / y coord. props. contentOffset is undefined in our 1.6\r\nSDK for Android only. contentOffset is present in 1.5.x for Android\r\n(works for iOS either way).

{html}", "attachment": [], "flagged": false, "summary": "Android: implement the \"contentOffset\" property for the \"scroll\" event in TableView", "creator": { "name": "rblalock", "key": "rblalock", "displayName": "Rick Blalock", "active": false, "timeZone": "America/Havana" }, "subtasks": [], "reporter": { "name": "rblalock", "key": "rblalock", "displayName": "Rick Blalock", "active": false, "timeZone": "America/Havana" }, "environment": null, "comment": { "comments": [ { "id": "129262", "author": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

To my knowledge this has never been implemented in Android. I\nwent back through the 1.5 source and could not find any reference\nto contentOffset and it doesn't appear that tableview is even\nfiring a scroll event.

\n

I'm changing the title and tags to correctly denote this as a\nfeature request. Please review the ticket submission guidelines as\nthis ticket violates most of them.

{html}", "updateAuthor": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:27:48.000+0000", "updated": "2011-04-15T03:27:48.000+0000" }, { "id": "129263", "author": { "name": "jalter", "key": "jalter", "displayName": "Jon Alter", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Associated Helpdesk Ticket

\n

http://developer.appcelerator.com/helpdesk/view/76652

{html}", "updateAuthor": { "name": "jalter", "key": "jalter", "displayName": "Jon Alter", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:27:48.000+0000", "updated": "2011-04-15T03:27:48.000+0000" }, { "id": "129264", "author": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "body": "{html}

klist'd and rplist'd

{html}", "updateAuthor": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "created": "2011-04-15T03:27:48.000+0000", "updated": "2011-04-15T03:27:48.000+0000" }, { "id": "157559", "author": { "name": "matthewcongrove", "key": "matthewcongrove", "displayName": "Matthew Congrove", "active": true, "timeZone": "America/Chicago" }, "body": "There's also no contentOffset for ScrollViews. Can we get this added at the same time? Request is coming from customer.\r\n\r\nhttp://support.appcelerator.com/tickets/APP-633921/", "updateAuthor": { "name": "matthewcongrove", "key": "matthewcongrove", "displayName": "Matthew Congrove", "active": true, "timeZone": "America/Chicago" }, "created": "2011-06-22T13:06:53.000+0000", "updated": "2011-06-22T13:06:53.000+0000" }, { "id": "166882", "author": { "name": "zpapp", "key": "zpapp", "displayName": "Zsombor Papp", "active": true, "timeZone": "America/Los_Angeles" }, "body": "+1 for implementing this for ScrollView.", "updateAuthor": { "name": "zpapp", "key": "zpapp", "displayName": "Zsombor Papp", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-09-25T12:31:07.000+0000", "updated": "2011-09-25T12:31:07.000+0000" }, { "id": "167667", "author": { "name": "aleard", "key": "aleard", "displayName": "Alan Leard", "active": true, "timeZone": "America/Los_Angeles" }, "updateAuthor": { "name": "aleard", "key": "aleard", "displayName": "Alan Leard", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-10-03T12:38:50.000+0000", "updated": "2011-10-03T12:38:50.000+0000" }, { "id": "187114", "author": { "name": "hans", "key": "hans", "displayName": "hans schoenburg", "active": true, "timeZone": "America/Los_Angeles" }, "body": "up up up!", "updateAuthor": { "name": "hans", "key": "hans", "displayName": "hans schoenburg", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-03-19T11:30:15.000+0000", "updated": "2012-03-19T11:30:15.000+0000" }, { "id": "201651", "author": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "body": "One may work around using the following Droid properties of Scroll event (firstVisibleItem, totalItemCount, visibleItemCount) - Tested on 2.1.0.GA:\r\n\r\nh6.app.js\r\n{code}\r\nTi.UI.setBackgroundColor('#000');\r\n\r\n var win = Ti.UI.createWindow({\r\n backgroundColor: 'black',\r\n exitOnClose: true,\r\n fullscreen: false,\r\n title: 'TableView Demo'\r\n });\r\n \r\n // generate random number, used to make each row appear distinct for this example\r\n function randomInt(max){\r\n return Math.floor(Math.random() * max) + 1;\r\n }\r\n \r\n var IMG_BASE = 'https://github.com/appcelerator/titanium_mobile/raw/master/demos/KitchenSink/Resources/images/';\r\n var defaultFontSize = Ti.Platform.name === 'android' ? 16 : 14;\r\n \r\n var tableData = [];\r\n \r\n for (var i=1; i<=20; i++){\r\n var row = Ti.UI.createTableViewRow({\r\n className:'forumEvent', // used to improve table performance\r\n selectedBackgroundColor:'white',\r\n rowIndex:i, // custom property, useful for determining the row during events\r\n height:110\r\n });\r\n \r\n var imageAvatar = Ti.UI.createImageView({\r\n image: IMG_BASE + 'custom_tableview/user.png',\r\n left:10, top:5,\r\n width:50, height:50\r\n });\r\n row.add(imageAvatar);\r\n \r\n var labelUserName = Ti.UI.createLabel({\r\n color:'#576996',\r\n font:{fontFamily:'Arial', fontSize:defaultFontSize+6, fontWeight:'bold'},\r\n text:'Fred Smith ' + i,\r\n left:70, top: 6,\r\n width:200, height: 30\r\n });\r\n row.add(labelUserName);\r\n \r\n var labelDetails = Ti.UI.createLabel({\r\n color:'#222',\r\n font:{fontFamily:'Arial', fontSize:defaultFontSize+2, fontWeight:'normal'},\r\n text:'Replied to post with id ' + randomInt(1000) + '.',\r\n left:70, top:44,\r\n width:360\r\n });\r\n row.add(labelDetails);\r\n \r\n var imageCalendar = Ti.UI.createImageView({\r\n image:IMG_BASE + 'custom_tableview/eventsButton.png',\r\n left:70, bottom: 2,\r\n width:32, height: 32\r\n });\r\n row.add(imageCalendar);\r\n \r\n var labelDate = Ti.UI.createLabel({\r\n color:'#999',\r\n font:{fontFamily:'Arial', fontSize:defaultFontSize, fontWeight:'normal'},\r\n text:'on ' + randomInt(30) + ' Nov 2012',\r\n left:105, bottom:10,\r\n width:200, height:20\r\n });\r\n row.add(labelDate);\r\n \r\n tableData.push(row);\r\n }\r\n \r\n var tableView = Ti.UI.createTableView({\r\n backgroundColor:'white',\r\n data:tableData\r\n });\r\n \r\n win.add(tableView);\r\n win.open();\r\n\r\ntableView.addEventListener('scroll', function(e)\r\n{\r\n //Ti.API.info('x|y ' + e.contentOffset.x + '|' + e.contentOffset.y);//it will be undefined indeed ... \r\n Ti.API.info('-------------------');\r\n\tTi.API.info( 'firstVisibleItem : Number - Row index of the topmost visible row in the view: ' + e.firstVisibleItem);\r\n\tTi.API.info( 'totalItemCount : Number - Total number of rows in the view: ' + e.totalItemCount );\r\n\tTi.API.info( 'visibleItemCount : Number - Number of rows currently visible in the view: '+ e.visibleItemCount );\r\n});\r\n{code}", "updateAuthor": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-07-05T13:26:03.000+0000", "updated": "2012-07-05T13:26:03.000+0000" }, { "id": "232036", "author": { "name": "krowley", "key": "krowley", "displayName": "Karl Rowley", "active": true, "timeZone": "America/Los_Angeles" }, "body": "It looks like fixing this would require keeping track of row heights.\r\nHere's a post from stack overflow:\r\n\r\nhttp://stackoverflow.com/questions/10808387/android-getting-exact-scroll-position-in-listview\r\n\r\nThis would be possible if every TableView started at the top and then scrolled down.\r\nHowever, a TableView can be programmatically scrolled to any row. In this case the height\r\nof proceeding rows may not be known yet.\r\n\r\n", "updateAuthor": { "name": "krowley", "key": "krowley", "displayName": "Karl Rowley", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-12-19T18:52:56.000+0000", "updated": "2012-12-19T19:05:57.000+0000" }, { "id": "235447", "author": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "body": "There is no notion of Y scroll for a ListView in Android simply because the total height of the content is unknown. Only the height of the displayed content is known. I don't think it is possible to implement this feature on Android.", "updateAuthor": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-01-23T02:34:49.000+0000", "updated": "2013-01-23T02:34:49.000+0000" }, { "id": "235529", "author": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Mark the ticket as Won't Fix since the native Android does not support it.", "updateAuthor": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-01-23T18:46:32.000+0000", "updated": "2013-01-23T18:46:32.000+0000" } ], "maxResults": 16, "total": 16, "startAt": 0 } } }