daimajia / AndroidSwipeLayout

The Most Powerful Swipe Layout!
MIT License
12.38k stars 2.67k forks source link

listview item repeat open,when do noting in fillValues() method #215

Open CGmaybe10 opened 9 years ago

CGmaybe10 commented 9 years ago

code first eleventh

use your example, do nothing in fillValues(int position, View convertView) method, there is a problem. eg, listView contains fifty items. 1step, i open first item, 2step, i slide listView down when eleventh item shows, It‘s opened!

lancewong2014 commented 8 years ago

Yeah,I met the same error.It takes me some times to find out why.Sometimes,the listview's item doesn't call "onLayout" method!Under this situation,SwipeLayout doesn't call "onLayout",so item is repeated. I advise to close it manually by a special flag.

SheldonWang3000 commented 8 years ago

@lancewong2014 could you tell me how to deal with this situation in detail? I met the same error, and I have done something in fillValues() but the item opened as well.

lancewong2014 commented 8 years ago

@euangelion666 I mean u can add a flag for each item.When the flag is true,u open it,otherwise u close it.

SheldonWang3000 commented 8 years ago

@lancewong2014 thank you for your help. But I found that change the view in swipelayout from match_parent to wrap_content can prevent this situation happen. Maybe will help you

prashanthd commented 8 years ago

Hi, any one found the solution for this problem? I am facing same issue.

prashanthd commented 8 years ago

Hi I Know my list is small so used following solution

`@Override

public int getViewTypeCount() {

return getCount();

}

@Override public int getItemViewType(int position) {

return position;

}`