| | |
| | |
|
| | | import com.camnter.easyrecyclerview.widget.EasyRecyclerView;
|
| | |
|
| | | import cn.com.basic.face.adapter.CheckInFragment;
|
| | | import cn.com.basic.face.adapter.PhoneCallFragment.PhoneCallLeftAdapter;
|
| | | import cn.com.basic.face.discern.common.CommonVariables;
|
| | |
|
| | | import java.util.ArrayList;
|
| | | import java.util.List;
|
| | |
|
| | | import cn.com.basic.face.service.vo.PhoneCallFragment;
|
| | |
|
| | | public class PhoneCallLeftListView extends EasyRecyclerView {
|
| | |
|
| | | private PhoneCallLeftAdapter phoneCallLeftAdapter ;
|
| | | private PhoneCallLeftAdapter adapter ;
|
| | |
|
| | | private void initView() {
|
| | | phoneCallLeftAdapter = new PhoneCallLeftAdapter();
|
| | | setAdapter(phoneCallLeftAdapter);
|
| | | adapter = new PhoneCallLeftAdapter();
|
| | | setAdapter(adapter);
|
| | | }
|
| | |
|
| | | public PhoneCallLeftListView(Context context) {
|
| | |
| | | initView();
|
| | | }
|
| | |
|
| | | public void show(boolean isSortByDept, List list) {
|
| | | phoneCallLeftAdapter.setList(list);
|
| | | setAdapter(phoneCallLeftAdapter);
|
| | | phoneCallLeftAdapter.setSortByDept(isSortByDept);
|
| | | public void show(boolean isSortByDept, 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.setSortByDept(isSortByDept);
|
| | | }
|
| | |
|
| | | }
|