| | |
| | | }
|
| | | });
|
| | | } else {
|
| | | findPhoneCallLeftListAfterReturn(PhoneCallDao.getInstance().findPhoneCallLeftList(searchText, pageNum), isSortByDept, append);
|
| | | findPhoneCallLeftListAfterReturn(PhoneCallDao.getInstance().findPhoneCallLeftList(searchText, pageNum), isSortByDept, append);
|
| | | }
|
| | | }
|
| | |
|
| | | private void findPhoneCallLeftListAfterReturn(ResultBean resultBean, boolean isSortByDept, boolean append) {
|
| | | private void findPhoneCallLeftListAfterReturn(ResultBean resultBean, final boolean isSortByDept, final boolean append) {
|
| | | List<PhoneCallQueryItem> list = resultBean.getList(PhoneCallQueryItem.class);
|
| | |
|
| | | if (append) {
|
| | |
| | | }
|
| | | }
|
| | | sort(list, isSortByDept);
|
| | | List itemList = new ArrayList();
|
| | | final List itemList = new ArrayList();
|
| | | String name = "";
|
| | | String prev = "";
|
| | | for (int i = 0; i < list.size(); i++) {
|
| | |
| | | prev = name;
|
| | | }
|
| | | addPageFooter(resultBean.hasMorePages(), resultBean.getPageNum(), itemList);
|
| | | PhoneCallFragment.getInstance().get_fragment_phone_call_left_list_view().show(isSortByDept, itemList, append);
|
| | | if (BaseApplication.getInstance().networkAvailable()) {
|
| | | PhoneCallFragment.getInstance().get_fragment_phone_call_left_list_view().show(isSortByDept, itemList, append);
|
| | | } else {
|
| | | MainActivity.getInstance().runOnUiThread(new Runnable() {
|
| | | @Override
|
| | | public void run() {
|
| | | PhoneCallFragment.getInstance().get_fragment_phone_call_left_list_view().show(isSortByDept, itemList, append);
|
| | | }
|
| | | });
|
| | | }
|
| | | }
|
| | |
|
| | | private void sort(List<PhoneCallQueryItem> list, final boolean sortedByDept) {
|