| | |
| | | refresh(list, append);
|
| | | }
|
| | |
|
| | | public void refresh(List theNewList, boolean append) {
|
| | | if (append) {
|
| | | List oldList = adapter.getList();
|
| | | List newList = new ArrayList();
|
| | | if (oldList.size() > 0 && oldList.get(oldList.size()-1) instanceof Integer &&
|
| | | ((int)oldList.get(oldList.size()-1))== CommonVariables.Page.hasMorePages) {
|
| | | oldList.remove(oldList.size() - 1);
|
| | | }
|
| | | if (oldList.size() > 0 && oldList.get(oldList.size()-1) instanceof
|
| | | Integer && ((int)oldList.get(oldList.size()-1))== CommonVariables.Page.noMorePage) {
|
| | | oldList.remove(oldList.size() - 1);
|
| | | }
|
| | | if (oldList.size() > 0) {
|
| | | this.scrollToPosition(oldList.size()-1);
|
| | | }
|
| | | oldList.addAll(theNewList);
|
| | | } else {
|
| | | adapter.setList(theNewList);
|
| | | public void refresh(List list, boolean append) {
|
| | | if (append && adapter.getList().size() > 0) {
|
| | | this.scrollToPosition(adapter.getList().size()-1);
|
| | | }
|
| | | adapter.setList(list);
|
| | | this.setAdapter(adapter);
|
| | | adapter.notifyDataSetChanged();
|
| | | }
|
| | |
|
| | | public List getPrevList() {
|
| | | return adapter.getList();
|
| | | }
|
| | | }
|