@Override public void pullToRefreshData(long uid, Context context) { mFollowActivityView.showLoadingIcon(); mUserModel.followers( uid, context, new UserModel.OnUserListRequestFinish() { @Override public void noMoreDate() { mFollowActivityView.hideLoadingIcon(); } @Override public void onDataFinish(ArrayList<User> userlist) { mFollowActivityView.hideLoadingIcon(); mFollowActivityView.updateListView(userlist); } @Override public void onError(String error) { mFollowActivityView.hideLoadingIcon(); mFollowActivityView.showErrorFooterView(); } }); }
public void logout(final Context context, String uid) { tokenListModel.deleteToken(context, uid); userModel.deleteUserByUid( Long.valueOf(uid), context, new UserModel.OnUserDeleteListener() { @Override public void onSuccess(ArrayList<User> userlist) { accoutActivityView.updateListView(userlist); } @Override public void onEmpty() { Intent intent = new Intent(context, UnLoginActivity.class); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK); context.startActivity(intent); accoutActivityView.finishItself(); } @Override public void onError(String error) { ToastUtil.showShort(context, error); } }); }
@Override public void requestMoreData(long uid, Context context) { mUserModel.followersNextPage( uid, context, new UserModel.OnUserListRequestFinish() { @Override public void noMoreDate() { mFollowActivityView.showEndFooterView(); } @Override public void onDataFinish(ArrayList<User> userlist) { mFollowActivityView.hideFooterView(); mFollowActivityView.updateListView(userlist); } @Override public void onError(String error) { mFollowActivityView.showErrorFooterView(); } }); }
@Override public void obtainUserListDetail(final Context context) { accoutActivityView.hideListView(); accoutActivityView.showProgressDialog(); userModel.getUserDetailList( context, new UserModel.OnUserListRequestFinish() { @Override public void noMoreDate() {} @Override public void onDataFinish(ArrayList<User> userlist) { Message message = Message.obtain(); Bundle bundle = new Bundle(); bundle.putSerializable("mUserArrayList", userlist); message.setData(bundle); mHandle.sendMessage(message); } @Override public void onError(String error) {} }); }