Closed supersume closed 9 years ago
Did you try to override the AsymmetricGridViewAdapter class? So that you can provide your expected values such as:
@Override
public int getViewTypeCount() {
return wrappedAdapter.getViewTypeCount();
}
@Override
public int getItemViewType(int position) {
return wrappedAdapter.getItemViewType(position);
}
Yes I have done that. The result is that multiple view types now appear, but their assignment is random. They don't follow any rules that I set in my adapter class. On May 27, 2015 4:09 PM, "RoRoche" notifications@github.com wrote:
Did you try to override the AsymmetricGridViewAdapter class? So that you can provide your expected values such as:
@Override public int getViewTypeCount() { return wrappedAdapter.getViewTypeCount(); }
@Override public int getItemViewType(int position) { return wrappedAdapter.getItemViewType(position); }
— Reply to this email directly or view it on GitHub https://github.com/felipecsl/AsymmetricGridView/issues/30#issuecomment-105900433 .
I have found a temporary workaround. In the getview() method of my adapter, I don't write the code
if (convertView != null)
The result is that the getview() method will always instantiate a new view hence view recycling is non existent. My guess is, the problem is with views that have been cached by the adapter. The method viewPool.get() in AsymmetricGridViewAdapter.java seems to be returning the wrong view type from cache.
When using an adapter with multiple view types (in my case 4), the overridden method getViewTypeCount() never gets called. The adapter only uses one view type in getView (the first one to be inflated). Please provide a fix for this. Thanks.