Skip to content

Commit

Permalink
bug修复。
Browse files Browse the repository at this point in the history
  • Loading branch information
梁任彦 committed May 22, 2018
1 parent be586d1 commit ee4185d
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,12 @@ public void destroyItem(ViewGroup container, int position,
@Override
public Object instantiateItem(ViewGroup container, final int position) {

final int item = getActualPosition(position);

View view = views.get(position);

if (view == null) {
view = mCreator.createView(mContext, position);
view = mCreator.createView(mContext, item);
views.put(position, view);
}

Expand All @@ -57,7 +59,6 @@ public Object instantiateItem(ViewGroup container, final int position) {
parent.removeView(view);
}

final int item = getActualPosition(position);
final T t = mData.get(item);

mCreator.updateUI(mContext, view, item, t);
Expand Down

0 comments on commit ee4185d

Please sign in to comment.