AsymmetricGridView icon indicating copy to clipboard operation
AsymmetricGridView copied to clipboard

How to implements ViewHolder

Open tgamez opened this issue 11 years ago • 3 comments

It's a way to implements a ViewHolder for the adapter ? I have found the problem that view.getTag is used to store the item, so I haven't found any place to store de ViewHolder associated with the View.

Here a link explaining the performace improve of ViewHolder.

http://stackoverflow.com/questions/13164054/viewholder-good-practice

tgamez avatar Nov 10 '14 09:11 tgamez

I have walked into this issue as well. I tried to store the viewholder in the view with view.setTag(KEY,viewholder). But that doesn't work.

If you read the code you can see that the AssymetricGridViewAdapter puts the item in the tag. It is used to pass the item to a clicklistener.

I guess the only solution right now is writing a custom adapter, copying most of the code apart from the setting of the tag.

Swimburger avatar Nov 11 '14 16:11 Swimburger

using view.setTag(int, viewholder) seems to work just fine. Remember that the int used must be a resource so the app can guarantee uniqueness

shanus avatar Apr 13 '15 22:04 shanus

using a map to store the view and viewholder and it works fine

liyzay avatar Jun 18 '15 08:06 liyzay