{"action":"created","issue":{"url":"https://api.github.com/repos/gajus/swing/issues/58","labels_url":"https://api.github.com/repos/gajus/swing/issues/58/labels{/name}","comments_url":"https://api.github.com/repos/gajus/swing/issues/58/comments","events_url":"https://api.github.com/repos/gajus/swing/issues/58/events","html_url":"https://github.com/gajus/swing/issues/58","id":117808140,"number":58,"title":"Unresponsive on Android","user":{"login":"tobiasmuecksch","id":1294854,"avatar_url":"https://avatars.githubusercontent.com/u/1294854?v=3","gravatar_id":"","url":"https://api.github.com/users/tobiasmuecksch","html_url":"https://github.com/tobiasmuecksch","followers_url":"https://api.github.com/users/tobiasmuecksch/followers","following_url":"https://api.github.com/users/tobiasmuecksch/following{/other_user}","gists_url":"https://api.github.com/users/tobiasmuecksch/gists{/gist_id}","starred_url":"https://api.github.com/users/tobiasmuecksch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tobiasmuecksch/subscriptions","organizations_url":"https://api.github.com/users/tobiasmuecksch/orgs","repos_url":"https://api.github.com/users/tobiasmuecksch/repos","events_url":"https://api.github.com/users/tobiasmuecksch/events{/privacy}","received_events_url":"https://api.github.com/users/tobiasmuecksch/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-11-19T12:55:35Z","updated_at":"2015-12-08T19:04:41Z","closed_at":null,"body":"On Android this script is very unresponsive. When you try to move a card around nothing happens until you remove your finger and try to move it again. And then it still is very laggy.\r\n\r\nI tested it on Motorola Moto G 2. Generation with Android 5.x and Android 6.0."},"comment":{"url":"https://api.github.com/repos/gajus/swing/issues/comments/162983545","html_url":"https://github.com/gajus/swing/issues/58#issuecomment-162983545","issue_url":"https://api.github.com/repos/gajus/swing/issues/58","id":162983545,"user":{"login":"optikalefx","id":926885,"avatar_url":"https://avatars.githubusercontent.com/u/926885?v=3","gravatar_id":"","url":"https://api.github.com/users/optikalefx","html_url":"https://github.com/optikalefx","followers_url":"https://api.github.com/users/optikalefx/followers","following_url":"https://api.github.com/users/optikalefx/following{/other_user}","gists_url":"https://api.github.com/users/optikalefx/gists{/gist_id}","starred_url":"https://api.github.com/users/optikalefx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/optikalefx/subscriptions","organizations_url":"https://api.github.com/users/optikalefx/orgs","repos_url":"https://api.github.com/users/optikalefx/repos","events_url":"https://api.github.com/users/optikalefx/events{/privacy}","received_events_url":"https://api.github.com/users/optikalefx/received_events","type":"User","site_admin":false},"created_at":"2015-12-08T19:04:41Z","updated_at":"2015-12-08T19:04:41Z","body":"Our solution to this, which works really well - was 3 fold.\r\n\r\n1) As suggested, only keep a stack of 5, and always remove the thrown out card from the DOM and add 1 more to the 'bottom' of the stack. This required a change in this code base from appendToParent to prependToParent. Which means the newly added card will be at the bottom.\r\n\r\n2) `element.dispatchEvent(touchStartEvent);` on the new element that was added. We found firing touchstart before the user started dragging fixed a ton of lag\r\n\r\n3) the above touch start caused the cards to pop around, so we also got rid of the appendToParent call on touchStart. It wasn't needed anyway. For us we only ever want the top card to be on top.\r\n\r\nSo now we get 60 fps on a stack of 100 on android."}}