{"action":"created","issue":{"url":"https://api.github.com/repos/evant/binding-collection-adapter/issues/37","repository_url":"https://api.github.com/repos/evant/binding-collection-adapter","labels_url":"https://api.github.com/repos/evant/binding-collection-adapter/issues/37/labels{/name}","comments_url":"https://api.github.com/repos/evant/binding-collection-adapter/issues/37/comments","events_url":"https://api.github.com/repos/evant/binding-collection-adapter/issues/37/events","html_url":"https://github.com/evant/binding-collection-adapter/issues/37","id":143223347,"number":37,"title":"Items in RecyclerView not properly recycled","user":{"login":"Skrawlr","id":18049077,"avatar_url":"https://avatars.githubusercontent.com/u/18049077?v=3","gravatar_id":"","url":"https://api.github.com/users/Skrawlr","html_url":"https://github.com/Skrawlr","followers_url":"https://api.github.com/users/Skrawlr/followers","following_url":"https://api.github.com/users/Skrawlr/following{/other_user}","gists_url":"https://api.github.com/users/Skrawlr/gists{/gist_id}","starred_url":"https://api.github.com/users/Skrawlr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Skrawlr/subscriptions","organizations_url":"https://api.github.com/users/Skrawlr/orgs","repos_url":"https://api.github.com/users/Skrawlr/repos","events_url":"https://api.github.com/users/Skrawlr/events{/privacy}","received_events_url":"https://api.github.com/users/Skrawlr/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-03-24T11:35:31Z","updated_at":"2016-03-29T07:50:21Z","closed_at":"2016-03-25T19:27:08Z","body":"Hi and first of all thx for this very useful library. That being said, I think there's a bug when using it with a RecyclerView.\r\n\r\nSo, the thing is, I have a RecyclerView whose items are forms made of a bunch of EditTexts. Those forms are actually linked to a ViewModel so when I write something in one of the EditTexts, it updates my viewModels accordingly thx to DataBinding.\r\nThis seems to work, my ViewModel instances are correctly being updated so there isn't the problem.\r\n\r\nLet's now say I have 3 items in my RecyclerView, their first EditText being initialized with incremented string + numbers on the go (so \"item 1\", \"item 2\", \"item 3\"). Scrolling from top to bottom isn't a problem but when scrolling back up, the EditText's content get all messed up.\r\nMy attempt at an explanation of this would be that the items that are being recycled when  disappearing from the screen are not being \"debinded\" from their ViewModel. Therefore, when scrolling, the values of the first items are being updated because they are becoming the last items (which are being initialized on the go).\r\n\r\nScenario:\r\n\r\n- Initializing first item, (EditText = \"item 1\", updating the ViewModel),\r\n- Scrolling down,\r\n- Recycling first item, (seemingly not \"debinding\" it's viewmodel),\r\n- Reusing first item as third item,\r\n- Initializing third item (EditText = \"item 3\") still binded to the first item's ViewModel (since the third item IS the first item because that's how a RecyclerView works),\r\n- Updating third item's ViewModel which is still binded to the first item,\r\n- Scrolling back up to the first item,\r\n- \"item 3\" is now written in the first item's editText because its viewModel said so.\r\n\r\nHope it helps, if you need a code example or something, just ask, I'll see what I can do."},"comment":{"url":"https://api.github.com/repos/evant/binding-collection-adapter/issues/comments/202765865","html_url":"https://github.com/evant/binding-collection-adapter/issues/37#issuecomment-202765865","issue_url":"https://api.github.com/repos/evant/binding-collection-adapter/issues/37","id":202765865,"user":{"login":"Skrawlr","id":18049077,"avatar_url":"https://avatars.githubusercontent.com/u/18049077?v=3","gravatar_id":"","url":"https://api.github.com/users/Skrawlr","html_url":"https://github.com/Skrawlr","followers_url":"https://api.github.com/users/Skrawlr/followers","following_url":"https://api.github.com/users/Skrawlr/following{/other_user}","gists_url":"https://api.github.com/users/Skrawlr/gists{/gist_id}","starred_url":"https://api.github.com/users/Skrawlr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Skrawlr/subscriptions","organizations_url":"https://api.github.com/users/Skrawlr/orgs","repos_url":"https://api.github.com/users/Skrawlr/repos","events_url":"https://api.github.com/users/Skrawlr/events{/privacy}","received_events_url":"https://api.github.com/users/Skrawlr/received_events","type":"User","site_admin":false},"created_at":"2016-03-29T07:50:21Z","updated_at":"2016-03-29T07:50:21Z","body":"Okay, thanx a lot!"}}