| | |
| | |
|
| | | import com.camnter.easyrecyclerview.widget.EasyRecyclerView;
|
| | |
|
| | | import java.util.ArrayList;
|
| | | import java.util.List;
|
| | |
|
| | | import cn.com.basic.face.adapter.VisitFragment;
|
| | | import cn.com.basic.face.discern.common.CommonVariables;
|
| | |
|
| | | public class VisitLeftListView extends EasyRecyclerView {
|
| | |
|
| | |
| | | initView();
|
| | | }
|
| | |
|
| | | public void show(boolean isSortByDept, List list) {
|
| | | adapter.setList(list);
|
| | | public void show(List list, boolean append) {
|
| | | if (append) {
|
| | | List newList = new ArrayList();
|
| | | if (adapter.getList().size() > 0 && adapter.getList().get(adapter.getList().size()-1) instanceof Integer && ((int)adapter.getList().get(adapter.getList().size()-1))== CommonVariables.Page.hasMorePages) {
|
| | | adapter.getList().remove(adapter.getList().size() - 1);
|
| | | }
|
| | | if (adapter.getList().size() > 0 && adapter.getList().get(adapter.getList().size()-1) instanceof
|
| | | Integer && ((int)adapter.getList().get(adapter.getList().size()-1))== CommonVariables.Page.noMorePage) {
|
| | | adapter.getList().remove(adapter.getList().size() - 1);
|
| | | }
|
| | | newList.addAll(adapter.getList());
|
| | | newList.addAll(list);
|
| | | if (adapter.getList().size() > 0) {
|
| | | this.scrollToPosition(adapter.getList().size()-1);
|
| | | }
|
| | | adapter.setList(newList);
|
| | | } else {
|
| | | adapter.setList(list);
|
| | | }
|
| | | setAdapter(adapter);
|
| | | adapter.notifyDataSetChanged();
|
| | | }
|
| | |
|
| | | public List getPrevList() {
|
| | | return adapter.getList();
|
| | | }
|
| | |
|
| | | }
|