Skip to content

Commit

Permalink
1.Adapter中添加add(List<T> t)方法
Browse files Browse the repository at this point in the history
  • Loading branch information
caikaidev committed Oct 30, 2016
1 parent f7eec87 commit be0d055
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,19 @@ public void add(T t){
mView.updatePointView(getRealCount());
}

public void add(List<T> list){
if (data == null) {
data = new ArrayList<>();
}

data.addAll(list);
//设置初始为中间,这样一开始就能够往左滑动了
mView.setCurrentItem(0);

mView.start();
mView.updatePointView(getRealCount());
}

@Override
public int getCount() {
return data == null ? 0 : Integer.MAX_VALUE;
Expand Down

0 comments on commit be0d055

Please sign in to comment.