Skip to content
This repository has been archived by the owner on May 15, 2023. It is now read-only.

Values replaced randomly in RemixerFragment #156

Open
sanchin opened this issue Sep 1, 2017 · 1 comment
Open

Values replaced randomly in RemixerFragment #156

sanchin opened this issue Sep 1, 2017 · 1 comment

Comments

@sanchin
Copy link
Contributor

sanchin commented Sep 1, 2017

I'm messing around with Remixer, trying out my own layouts (color picker etc) so I got to quite a few items on the list created by RemixerFragment. More than enough for scrolling.

It seems that, due to the remixerList being a RecyclerView, the cells are being reused improperly (viewholder binding bug?) which results in fields controlled by StringVariableMethod annotation being replaced and persisted by others. This probably also affects other types of variables and is not connected with my code - I just reproduced it in the example.

GIFV for reference
Modified TransactionListActivity GIST
Is just a stripped down Activity from the example with 14 empty StringVariableMethod annotated methods doing nothing. I've even tried adding a separate key for each, hoping that it might somehow affect the view binding apart from persistence but to no avail.

@sanchin
Copy link
Contributor Author

sanchin commented Sep 4, 2017

Ok, found the source of the problem - since the RecyclerView reuses the widgets, the afterTextChanged callback is being invoked with a new value.

Also, since each call to bindVariable creates a new TextWatcher and adds it to the text field - wouldn't it leak?

Possible fix: #157

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant