{ "id": "160334", "key": "TIMOB-23406", "fields": { "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "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": "17608", "name": "Release 6.1.0", "archived": false, "released": true, "releaseDate": "2017-05-26" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2016-09-06T07:34:39.000+0000", "created": "2016-05-18T16:25:43.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2016-12-02T19:25:42.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" }, { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "At the moment is not possible to determine the scroll direction of a ListView natively and as the view is scrolling. Very common effects such as the hiding of the navigation bar when scrolling (like on the Facebook app) become impossible to achieve without cumbersome workarounds.\r\nI will send a PR with a modification to the SDK core.\r\nProbably some modifications like coding style and naming will be necessary (By no means I am an Objective C dev).\r\nMost of the code I took straight from Stackoverflow [link Stackoverflow|http://stackoverflow.com/a/21263997/436785]\r\n\r\n{code:java}\r\n- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate\r\n{\r\n if (!decelerate) {\r\n if ([self isLazyLoadingEnabled]) {\r\n [[ImageLoader sharedLoader] resume];\r\n }\r\n [self fireScrollEnd:(UITableView *)scrollView];\r\n }\r\n \r\n if ([self.proxy _hasListeners:@\"dragend\"]) {\r\n [self.proxy fireEvent:@\"dragend\" withObject:nil withSource:self.proxy propagate:NO reportSuccess:NO errorCode:0 message:nil];\r\n }\r\n\r\n if ([self.proxy _hasListeners:@\"pullend\"]) {\r\n if ( (_pullViewProxy != nil) && (pullActive == YES) ) {\r\n pullActive = NO;\r\n [self.proxy fireEvent:@\"pullend\" withObject:nil withSource:self.proxy propagate:NO reportSuccess:NO errorCode:0 message:nil];\r\n }\r\n }\r\n}\r\n{code}", "attachment": [], "flagged": false, "summary": "iOS/Android: Add 'scrolling' event to ListView to track scroll direction (up or down)", "creator": { "name": "rlustemberg", "key": "rlustemberg", "displayName": "Richard Lustemberg", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "rlustemberg", "key": "rlustemberg", "displayName": "Richard Lustemberg", "active": true, "timeZone": "Europe/Berlin" }, "environment": null, "closedSprints": [ { "id": 707, "state": "closed", "name": "2016 Sprint 19 SDK", "startDate": "2016-09-10T00:17:15.164Z", "endDate": "2016-09-24T00:17:00.000Z", "completeDate": "2016-09-26T05:17:04.253Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "386071", "author": { "name": "rlustemberg", "key": "rlustemberg", "displayName": "Richard Lustemberg", "active": true, "timeZone": "Europe/Berlin" }, "body": "Sorry, I put the wrong snippett ;)\r\nAnd the file modified is iphone/Classes/TIUIListView.m\r\n\r\n{code:java}\r\n-(void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset{\r\n \r\n if ([self.proxy _hasListeners:@\"scrolling\"]) {\r\n NSMutableDictionary *eventArgs = [NSMutableDictionary dictionary];\r\n NSString* swipeString = @\"none\";\r\n if (velocity.y > 0){\r\n swipeString = @\"up\";\r\n }\r\n if (velocity.y < 0){\r\n swipeString = @\"down\";\r\n }\r\n if(swipeString !=(id)[NSNull null])\r\n {\r\n [eventArgs setValue:swipeString forKey:@\"direction\"];\r\n [self.proxy fireEvent:@\"scrolling\" withObject:eventArgs withSource:self.proxy propagate:NO reportSuccess:NO errorCode:0 message:nil];\r\n }\r\n }\r\n}\r\n{code}", "updateAuthor": { "name": "rlustemberg", "key": "rlustemberg", "displayName": "Richard Lustemberg", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-05-18T17:39:49.000+0000", "updated": "2016-05-18T17:42:27.000+0000" }, { "id": "386204", "author": { "name": "nunocostapt", "key": "nunocostapt", "displayName": "Nuno Costa", "active": true, "timeZone": "Europe/Lisbon" }, "body": "This will solve lot of our problems :)", "updateAuthor": { "name": "nunocostapt", "key": "nunocostapt", "displayName": "Nuno Costa", "active": true, "timeZone": "Europe/Lisbon" }, "created": "2016-05-19T12:35:51.000+0000", "updated": "2016-05-19T12:35:51.000+0000" }, { "id": "386221", "author": { "name": "nunocostapt", "key": "nunocostapt", "displayName": "Nuno Costa", "active": true, "timeZone": "Europe/Lisbon" }, "body": "@Richard Lustemberg you actually tested the code, and if yes that worked?", "updateAuthor": { "name": "nunocostapt", "key": "nunocostapt", "displayName": "Nuno Costa", "active": true, "timeZone": "Europe/Lisbon" }, "created": "2016-05-19T17:41:26.000+0000", "updated": "2016-05-19T17:41:26.000+0000" }, { "id": "386225", "author": { "name": "rlustemberg", "key": "rlustemberg", "displayName": "Richard Lustemberg", "active": true, "timeZone": "Europe/Berlin" }, "body": "Yes, I am using it\r\n[It's here |https://github.com/appcelerator/titanium_mobile/pull/8005]\r\n\r\nI guess that to make it production ready some extra thoughts should be given to the event name, at the very least ;)", "updateAuthor": { "name": "rlustemberg", "key": "rlustemberg", "displayName": "Richard Lustemberg", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-05-19T17:46:56.000+0000", "updated": "2016-05-19T17:55:01.000+0000" }, { "id": "386227", "author": { "name": "nunocostapt", "key": "nunocostapt", "displayName": "Nuno Costa", "active": true, "timeZone": "Europe/Lisbon" }, "body": "I know is there :) \r\nyou js code is ?:\r\n\r\n\r\n{code}\r\n$.listView.addEventListener('scrolling'), function scrollingList(e) {\r\n\t\r\n \tlog.warn(JSON.stringify(e, null, 2));\r\n};\r\n\r\n{code}\r\n", "updateAuthor": { "name": "nunocostapt", "key": "nunocostapt", "displayName": "Nuno Costa", "active": true, "timeZone": "Europe/Lisbon" }, "created": "2016-05-19T17:50:10.000+0000", "updated": "2016-05-19T17:50:33.000+0000" }, { "id": "386229", "author": { "name": "rlustemberg", "key": "rlustemberg", "displayName": "Richard Lustemberg", "active": true, "timeZone": "Europe/Berlin" }, "body": "yes, exactly that. ", "updateAuthor": { "name": "rlustemberg", "key": "rlustemberg", "displayName": "Richard Lustemberg", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-05-19T17:52:16.000+0000", "updated": "2016-05-19T17:52:16.000+0000" }, { "id": "387073", "author": { "name": "nunocostapt", "key": "nunocostapt", "displayName": "Nuno Costa", "active": true, "timeZone": "Europe/Lisbon" }, "body": "Can we do the same for Android?", "updateAuthor": { "name": "nunocostapt", "key": "nunocostapt", "displayName": "Nuno Costa", "active": true, "timeZone": "Europe/Lisbon" }, "created": "2016-05-28T12:16:26.000+0000", "updated": "2016-05-28T12:16:26.000+0000" }, { "id": "387074", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "http://stackoverflow.com/a/17017477/5537752 looks promising. Although it seems like we cannot get the velocity and targetContentOffset, we get at least say if its scrolling up or down. Anyone interesting in implementing that?", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-05-28T12:24:04.000+0000", "updated": "2016-05-28T12:24:04.000+0000" }, { "id": "387075", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Btw, iOS PR (for linking): https://github.com/appcelerator/titanium_mobile/pull/8005", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-05-28T12:25:06.000+0000", "updated": "2016-05-28T12:25:06.000+0000" }, { "id": "387077", "author": { "name": "rlustemberg", "key": "rlustemberg", "displayName": "Richard Lustemberg", "active": true, "timeZone": "Europe/Berlin" }, "body": "I'll try to do that. The project I'm working on needs it :)", "updateAuthor": { "name": "rlustemberg", "key": "rlustemberg", "displayName": "Richard Lustemberg", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-05-28T12:43:26.000+0000", "updated": "2016-05-28T12:43:26.000+0000" }, { "id": "387078", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "Done: https://github.com/appcelerator/titanium_mobile/pull/8031 ;)\r\n\r\n*Edit:*\r\nhave to change it, at the moment it fires the whole time while scrolling (so it will detect chaging the direction during scrolling). In the yml file it says it will only fire when lifting the finger", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-05-28T14:31:51.000+0000", "updated": "2016-05-28T15:08:30.000+0000" }, { "id": "387079", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "I've changed the doc to:\r\n{quote}On iOS no event is fired when the finger is not released.{quote}\r\nsince it will fire when the finger is down on Android, too.", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-05-28T14:55:19.000+0000", "updated": "2016-05-28T14:55:19.000+0000" }, { "id": "387118", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~msamah] or [~hpham] to review the Android-side? Looks good to me.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-05-30T08:55:26.000+0000", "updated": "2016-05-30T08:55:26.000+0000" }, { "id": "387187", "author": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Reviewed code, left some comments.", "updateAuthor": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-05-31T18:11:37.000+0000", "updated": "2016-05-31T18:11:37.000+0000" }, { "id": "391493", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "Waiting for m1ga aka [~michael] to provide updates for this. For the moment, I believe he doesn't have time to look throughly at it.", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-07-26T09:02:36.000+0000", "updated": "2016-07-26T09:02:36.000+0000" }, { "id": "391500", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "Sorry, at the moment I can't compile the source since my normal work environment is under linux. I'll try to setup a windows machine to get things running though. ", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-07-26T09:42:09.000+0000", "updated": "2016-07-26T09:42:09.000+0000" }, { "id": "391602", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "No worries.", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-07-27T01:57:15.000+0000", "updated": "2016-07-27T01:57:15.000+0000" }, { "id": "393080", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "Updated the code and made a new PR: https://github.com/appcelerator/titanium_mobile/pull/8216", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-08-13T12:59:57.000+0000", "updated": "2016-08-13T12:59:57.000+0000" }, { "id": "395373", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "Android PR https://github.com/appcelerator/titanium_mobile/pull/8216 merged.", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-09-06T07:34:50.000+0000", "updated": "2016-09-06T07:34:50.000+0000" }, { "id": "402485", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified the implementation.\r\n\r\n{{scrolling}} event is fired successfully & it gives the direction as {{up}} or {{down}}.\r\nClosing.\r\n\r\nAppc Studio : 4.8.1.201611291132\r\nSDK Version : 6.1.0.v20161202104721\r\nMac OS Version : 10.12\r\nXcode Version : Xcode 8.1 Build version 8B62\r\nAppc CLI AND Appc NPM : {\"NPM\":\"4.2.9-1\",\"CLI\":\"6.1.0-302\"}\r\nTi CLI : 5.0.11\r\nAlloy : 1.9.4\r\nNode : v4.6.0\r\nDevice: running 7.1Pixel\r\nIOS simulator : Iphone 7 plus running IOS 10", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-12-02T19:25:18.000+0000", "updated": "2016-12-02T19:25:18.000+0000" } ], "maxResults": 22, "total": 22, "startAt": 0 } } }