|
|
@@ -1,25 +1,16 @@
|
|
|
package com.xzjmyk.pm.activity.ui.erp.activity;
|
|
|
|
|
|
-import android.app.Activity;
|
|
|
-import android.app.AlertDialog;
|
|
|
import android.app.ProgressDialog;
|
|
|
-import android.content.ComponentName;
|
|
|
-import android.content.DialogInterface;
|
|
|
import android.content.Intent;
|
|
|
-import android.content.ServiceConnection;
|
|
|
import android.os.Bundle;
|
|
|
import android.os.Handler;
|
|
|
-import android.os.IBinder;
|
|
|
import android.text.Editable;
|
|
|
-import android.text.InputFilter;
|
|
|
import android.text.TextUtils;
|
|
|
import android.text.TextWatcher;
|
|
|
import android.util.Log;
|
|
|
import android.view.LayoutInflater;
|
|
|
import android.view.View;
|
|
|
-import android.view.ViewGroup;
|
|
|
import android.widget.AdapterView;
|
|
|
-import android.widget.EditText;
|
|
|
import android.widget.ListView;
|
|
|
import android.widget.TextView;
|
|
|
|
|
|
@@ -33,12 +24,8 @@ import com.xzjmyk.pm.activity.R;
|
|
|
import com.xzjmyk.pm.activity.adapter.FriendSortAdapter;
|
|
|
import com.xzjmyk.pm.activity.bean.AttentionUser;
|
|
|
import com.xzjmyk.pm.activity.bean.Friend;
|
|
|
-import com.xzjmyk.pm.activity.bean.message.NewFriendMessage;
|
|
|
-import com.xzjmyk.pm.activity.bean.message.XmppMessage;
|
|
|
-import com.xzjmyk.pm.activity.broadcast.MsgBroadcast;
|
|
|
import com.xzjmyk.pm.activity.db.dao.FriendDao;
|
|
|
import com.xzjmyk.pm.activity.db.dao.OnCompleteListener;
|
|
|
-import com.xzjmyk.pm.activity.helper.FriendHelper;
|
|
|
import com.xzjmyk.pm.activity.sortlist.BaseComparator;
|
|
|
import com.xzjmyk.pm.activity.sortlist.BaseSortModel;
|
|
|
import com.xzjmyk.pm.activity.sortlist.PingYinUtil;
|
|
|
@@ -53,15 +40,11 @@ import com.xzjmyk.pm.activity.ui.message.ChatActivity;
|
|
|
import com.xzjmyk.pm.activity.ui.message.NewFriendActivity;
|
|
|
import com.xzjmyk.pm.activity.util.ProgressDialogUtil;
|
|
|
import com.xzjmyk.pm.activity.util.StringUtils;
|
|
|
-import com.xzjmyk.pm.activity.util.TimeUtils;
|
|
|
import com.xzjmyk.pm.activity.util.ToastUtil;
|
|
|
import com.xzjmyk.pm.activity.view.ClearEditText;
|
|
|
import com.xzjmyk.pm.activity.volley.ArrayResult;
|
|
|
-import com.xzjmyk.pm.activity.volley.ObjectResult;
|
|
|
import com.xzjmyk.pm.activity.volley.Result;
|
|
|
import com.xzjmyk.pm.activity.volley.StringJsonArrayRequest;
|
|
|
-import com.xzjmyk.pm.activity.volley.StringJsonObjectRequest;
|
|
|
-import com.xzjmyk.pm.activity.xmpp.CoreService;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Collections;
|
|
|
@@ -90,7 +73,7 @@ public class MyFriendActivity extends BaseActivity {
|
|
|
@Override
|
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
|
super.onCreate(savedInstanceState);
|
|
|
- setContentView(R.layout.fragment_friend);
|
|
|
+ setContentView(R.layout.fragment_contact);
|
|
|
isPeculiar = getIntent().getBooleanExtra("isPeculiar", false);
|
|
|
if (isPeculiar)
|
|
|
getSupportActionBar().setTitle("常用联系人");
|
|
|
@@ -98,24 +81,19 @@ public class MyFriendActivity extends BaseActivity {
|
|
|
getSupportActionBar().setTitle("UU好友");
|
|
|
mSortFriends = new ArrayList<>();
|
|
|
allFriends = new ArrayList<>();
|
|
|
- mBaseComparator = new BaseComparator<Friend>();
|
|
|
+ mBaseComparator = new BaseComparator<>();
|
|
|
mLoginUserId = MyApplication.getInstance().mLoginUser.getUserId();
|
|
|
initView();
|
|
|
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- private Friend EnterChatAction(EmployeesEntity employee) {
|
|
|
- Friend friend = new Friend();
|
|
|
- friend.setUserId(String.valueOf(employee.getEm_IMID()));
|
|
|
- friend.setOwnerId(MyApplication.getInstance().mLoginUser.getUserId());
|
|
|
- friend.setRemarkName(employee.getEM_NAME());//备注
|
|
|
- friend.setNickName(employee.getEM_NAME());//昵称
|
|
|
-// friend.setDescription("企业通讯录人员");
|
|
|
- // timeSend作为取群聊离线消息的标志,所以要在这里设置一个初始值
|
|
|
- friend.setTimeSend(TimeUtils.sk_time_current_time());
|
|
|
- friend.setStatus(Friend.STATUS_UNKNOW);
|
|
|
- return friend;
|
|
|
+ @Override
|
|
|
+ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
|
|
+ if (requestCode == 0x20 && resultCode == 0x20) {
|
|
|
+ mAdapter.setisRefeshed(true);
|
|
|
+ upDataFriend();
|
|
|
+ loadData();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
private void upDataFriend() {
|
|
|
@@ -146,20 +124,9 @@ public class MyFriendActivity extends BaseActivity {
|
|
|
MyApplication.getInstance().getFastVolley().addDefaultRequest(HASHCODE, request);
|
|
|
}
|
|
|
|
|
|
- private ServiceConnection mServiceConnection = new ServiceConnection() {
|
|
|
- @Override
|
|
|
- public void onServiceDisconnected(ComponentName name) {
|
|
|
- mXmppService = null;
|
|
|
- }
|
|
|
|
|
|
- @Override
|
|
|
- public void onServiceConnected(ComponentName name, IBinder service) {
|
|
|
- mXmppService = ((CoreService.CoreServiceBinder) service).getService();
|
|
|
- }
|
|
|
- };
|
|
|
|
|
|
private void initView() {
|
|
|
- mBind = MyFriendActivity.this.bindService(CoreService.getIntent(), mServiceConnection, Activity.BIND_AUTO_CREATE);
|
|
|
mPullToRefreshListView = (PullToRefreshListView) findViewById(R.id.pull_refresh_list);
|
|
|
mTextDialog = (TextView) findViewById(R.id.text_dialog);
|
|
|
mSideBar = (SideBar) findViewById(R.id.sidebar);
|
|
|
@@ -221,22 +188,7 @@ public class MyFriendActivity extends BaseActivity {
|
|
|
intent.putExtra(AppConstant.EXTRA_NICK_CODE, friend.getPhone());
|
|
|
intent.putExtra("friend", friend);
|
|
|
}
|
|
|
- startActivityForResult(intent,0x20);
|
|
|
- }
|
|
|
- });
|
|
|
- mPullToRefreshListView.getRefreshableView().setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
|
|
|
- @Override
|
|
|
- public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
|
|
|
- BaseSortModel<Friend> sortFriend = mSortFriends.get((int) id);
|
|
|
- if (sortFriend == null || sortFriend.getBean() == null) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- String userId = sortFriend.getBean().getUserId();
|
|
|
- if (userId.equals(Friend.ID_SYSTEM_MESSAGE) || userId.equals(Friend.ID_NEW_FRIEND_MESSAGE)) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- showLongClickOperationDialog(sortFriend);
|
|
|
- return true;
|
|
|
+ startActivityForResult(intent, 0x20);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
@@ -396,294 +348,11 @@ public class MyFriendActivity extends BaseActivity {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // ///////////其他操作///////////////////
|
|
|
- private void showLongClickOperationDialog(final BaseSortModel<Friend> sortFriend) {
|
|
|
- Friend friend = sortFriend.getBean();
|
|
|
- if (friend.getStatus() != Friend.STATUS_BLACKLIST && friend.getStatus() == Friend.STATUS_ATTENTION
|
|
|
- && friend.getStatus() == Friend.STATUS_FRIEND) {
|
|
|
- return;
|
|
|
- }
|
|
|
- CharSequence[] items = new CharSequence[4];
|
|
|
- items[0] = getString(R.string.set_remark_name);// 设置备注名
|
|
|
- if (friend.getStatus() == Friend.STATUS_BLACKLIST) {// 在黑名单中,显示“设置备注名”、“移除黑名单”,"取消关注",“彻底删除”
|
|
|
- items[1] = getString(R.string.remove_blacklist);
|
|
|
- } else {
|
|
|
- items[1] = getString(R.string.add_blacklist);
|
|
|
- }
|
|
|
- items[2] = getString(R.string.cancel_attention);
|
|
|
- items[3] = getString(R.string.delete_all);
|
|
|
-
|
|
|
- new AlertDialog.Builder(MyFriendActivity.this).setItems(items, new DialogInterface.OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(DialogInterface dialog, int which) {
|
|
|
- switch (which) {
|
|
|
- case 0:// 设置备注名
|
|
|
- showRemarkDialog(sortFriend);
|
|
|
- break;
|
|
|
- case 1:// 加入黑名单,或者移除黑名单
|
|
|
- showBlacklistDialog(sortFriend);
|
|
|
- break;
|
|
|
- case 2:// 取消关注
|
|
|
- showCancelAttentionDialog(sortFriend);
|
|
|
- break;
|
|
|
- case 3:// 解除关注关系或者解除好友关系
|
|
|
- showDeleteAllDialog(sortFriend);
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- }).setCancelable(true).create().show();
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- private void showRemarkDialog(final BaseSortModel<Friend> sortFriend) {
|
|
|
- final EditText editText = new EditText(MyFriendActivity.this);
|
|
|
- editText.setMaxLines(2);
|
|
|
- editText.setLines(2);
|
|
|
- editText.setText(sortFriend.getBean().getShowName());
|
|
|
- editText.setFilters(new InputFilter[]{new InputFilter.LengthFilter(20)});
|
|
|
- editText.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
|
|
|
-
|
|
|
- AlertDialog.Builder builder = new AlertDialog.Builder(MyFriendActivity.this);
|
|
|
- builder.setTitle(R.string.set_remark_name).setView(editText)
|
|
|
- .setPositiveButton(getString(R.string.sure), new DialogInterface.OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(DialogInterface dialog, int which) {
|
|
|
- String input = editText.getText().toString();
|
|
|
- if (input.equals(sortFriend.getBean().getShowName())) {// 备注名没变
|
|
|
- return;
|
|
|
- }
|
|
|
- if (!StringUtils.isNickName(input)) {// 不符合昵称
|
|
|
- if (input.length() != 0) {
|
|
|
- ToastUtil.showToast(MyFriendActivity.this, R.string.remark_name_format_error);
|
|
|
- return;
|
|
|
- } else {// 不符合昵称,因为长度为0,但是可以做备注名操作,操作就是清除备注名
|
|
|
- // 判断之前有没有备注名
|
|
|
- if (TextUtils.isEmpty(sortFriend.getBean().getRemarkName())) {// 如果没有备注名,就不需要清除
|
|
|
- return;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- remarkFriend(sortFriend, input);
|
|
|
- }
|
|
|
- }).setNegativeButton(getString(R.string.cancel), null);
|
|
|
- builder.create().show();
|
|
|
- }
|
|
|
-
|
|
|
- private void remarkFriend(final BaseSortModel<Friend> sortFriend, final String remarkName) {
|
|
|
- HashMap<String, String> params = new HashMap<String, String>();
|
|
|
- params.put("access_token", MyApplication.getInstance().mAccessToken);
|
|
|
- params.put("toUserId", sortFriend.getBean().getUserId());
|
|
|
- params.put("remarkName", remarkName);
|
|
|
|
|
|
- ProgressDialogUtil.show(mProgressDialog);
|
|
|
- StringJsonObjectRequest<Result> request = new StringJsonObjectRequest<Result>(MyApplication.getInstance().getConfig().FRIENDS_REMARK, new Response.ErrorListener() {
|
|
|
- @Override
|
|
|
- public void onErrorResponse(VolleyError arg0) {
|
|
|
- ProgressDialogUtil.dismiss(mProgressDialog);
|
|
|
- ToastUtil.showErrorNet(MyFriendActivity.this);
|
|
|
- }
|
|
|
- }, new StringJsonObjectRequest.Listener<Result>() {
|
|
|
- @Override
|
|
|
- public void onResponse(ObjectResult<Result> result) {
|
|
|
- boolean success = Result.defaultParser(MyFriendActivity.this, result, true);
|
|
|
- ProgressDialogUtil.dismiss(mProgressDialog);
|
|
|
- if (success) {
|
|
|
- String firstLetter = sortFriend.getFirstLetter();
|
|
|
- mSideBar.removeExist(firstLetter);// 移除之前设置的首字母
|
|
|
- sortFriend.getBean().setRemarkName(remarkName);// 修改备注名称
|
|
|
- setSortCondition(sortFriend);
|
|
|
- Collections.sort(mSortFriends, mBaseComparator);
|
|
|
- Collections.sort(allFriends, mBaseComparator);
|
|
|
- mAdapter.notifyDataSetChanged();
|
|
|
- // 更新到数据库
|
|
|
- FriendDao.getInstance().setRemarkName(mLoginUserId, sortFriend.getBean().getUserId(), remarkName);
|
|
|
- // 更新消息界面(因为昵称变了,所有要更新)
|
|
|
- MsgBroadcast.broadcastMsgUiUpdate(MyFriendActivity.this);
|
|
|
- }
|
|
|
|
|
|
- }
|
|
|
- }, Result.class, params);
|
|
|
- //mActivity.addDefaultRequest(request);
|
|
|
- //Integer.toHexString(this.hashCode()) + "@"
|
|
|
- MyApplication.getInstance().getFastVolley().addDefaultRequest(HASHCODE, request);
|
|
|
-
|
|
|
- }
|
|
|
|
|
|
String HASHCODE = Integer.toHexString(this.hashCode()) + "@";
|
|
|
|
|
|
- /* 显示加入黑名单的对话框 */
|
|
|
- private void showBlacklistDialog(final BaseSortModel<Friend> sortFriend) {
|
|
|
- final Friend friend = sortFriend.getBean();
|
|
|
- int messageId = 0;
|
|
|
- if (friend.getStatus() == Friend.STATUS_BLACKLIST) {// 已经在黑名单,那就是移出黑名单(在名片盒界面,不可能出现此情况,从别的地方copy过来的,懒得去掉)
|
|
|
- messageId = R.string.remove_blacklist_prompt;
|
|
|
- } else if (friend.getStatus() == Friend.STATUS_ATTENTION || friend.getStatus() == Friend.STATUS_FRIEND) {
|
|
|
- messageId = R.string.add_blacklist_prompt;
|
|
|
- } else {// 其他关系(错误的状态)
|
|
|
- return;
|
|
|
- }
|
|
|
- AlertDialog.Builder builder = new AlertDialog.Builder(MyFriendActivity.this).setTitle(R.string.prompt_title).setMessage(messageId)
|
|
|
- .setPositiveButton(getString(R.string.sure), new DialogInterface.OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(DialogInterface dialog, int which) {
|
|
|
- if (friend.getStatus() == Friend.STATUS_BLACKLIST) {// 已经在黑名单,那就是移出黑名单(在名片盒界面,不可能出现此情况)
|
|
|
- // removeBlacklist(friend);
|
|
|
- } else if (friend.getStatus() == Friend.STATUS_ATTENTION || friend.getStatus() == Friend.STATUS_FRIEND) {
|
|
|
- addBlacklist(sortFriend);
|
|
|
- }
|
|
|
- }
|
|
|
- }).setNegativeButton(getString(R.string.cancel), null);
|
|
|
- builder.create().show();
|
|
|
- }
|
|
|
-
|
|
|
- private void addBlacklist(final BaseSortModel<Friend> sortFriend) {
|
|
|
- HashMap<String, String> params = new HashMap<String, String>();
|
|
|
- params.put("access_token", MyApplication.getInstance().mAccessToken);
|
|
|
- params.put("toUserId", sortFriend.getBean().getUserId());
|
|
|
-
|
|
|
- ProgressDialogUtil.show(mProgressDialog);
|
|
|
- StringJsonObjectRequest<Void> request = new StringJsonObjectRequest<Void>(MyApplication.getInstance().getConfig().FRIENDS_BLACKLIST_ADD, new Response.ErrorListener() {
|
|
|
- @Override
|
|
|
- public void onErrorResponse(VolleyError arg0) {
|
|
|
- ProgressDialogUtil.dismiss(mProgressDialog);
|
|
|
- ToastUtil.showErrorNet(MyFriendActivity.this);
|
|
|
- }
|
|
|
- }, new StringJsonObjectRequest.Listener<Void>() {
|
|
|
- @Override
|
|
|
- public void onResponse(ObjectResult<Void> result) {
|
|
|
-
|
|
|
- boolean success = Result.defaultParser(MyFriendActivity.this, result, true);
|
|
|
- if (success) {
|
|
|
- FriendDao.getInstance().updateFriendStatus(sortFriend.getBean().getOwnerId(), sortFriend.getBean().getUserId(),
|
|
|
- Friend.STATUS_BLACKLIST);
|
|
|
- FriendHelper.addBlacklistExtraOperation(mLoginUserId, sortFriend.getBean().getUserId());
|
|
|
-
|
|
|
- /* 发送加入黑名单的通知 */
|
|
|
- if (sortFriend.getBean().getStatus() == Friend.STATUS_FRIEND) {// 之前是好友,需要发消息让那个人不能看我的商务圈
|
|
|
- NewFriendMessage message = NewFriendMessage.createWillSendMessage(MyApplication.getInstance().mLoginUser,
|
|
|
- XmppMessage.TYPE_BLACK, null, sortFriend.getBean());
|
|
|
- sendNewFriendMessage(sortFriend.getBean().getUserId(), message);// 加入黑名单
|
|
|
- }
|
|
|
-
|
|
|
- ToastUtil.showToast(MyFriendActivity.this, R.string.add_blacklist_succ);
|
|
|
-
|
|
|
- mSortFriends.remove(sortFriend);
|
|
|
- String firstLetter = sortFriend.getFirstLetter();
|
|
|
- mSideBar.removeExist(firstLetter);// 移除之前设置的首字母
|
|
|
- mAdapter.notifyDataSetInvalidated();
|
|
|
-
|
|
|
- // 更新消息界面
|
|
|
- MsgBroadcast.broadcastMsgUiUpdate(MyFriendActivity.this);
|
|
|
- }
|
|
|
- ProgressDialogUtil.dismiss(mProgressDialog);
|
|
|
- }
|
|
|
- }, Void.class, params);
|
|
|
-// mActivity.addDefaultRequest(request);
|
|
|
- MyApplication.getInstance().getFastVolley().addDefaultRequest(HASHCODE, request);
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- private boolean mBind;
|
|
|
- private CoreService mXmppService;
|
|
|
-
|
|
|
- void sendNewFriendMessage(String toUserId, NewFriendMessage message) {
|
|
|
- if (mBind && mXmppService != null) {
|
|
|
- mXmppService.sendNewFriendMessage(toUserId, message);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 取消关注
|
|
|
- *
|
|
|
- * @param
|
|
|
- */
|
|
|
- private void showCancelAttentionDialog(final BaseSortModel<Friend> sortFriend) {
|
|
|
- if (sortFriend.getBean().getStatus() == Friend.STATUS_UNKNOW) {
|
|
|
- return;
|
|
|
- }
|
|
|
- AlertDialog.Builder builder = new AlertDialog.Builder(MyFriendActivity.this).setTitle(R.string.prompt_title)
|
|
|
- .setMessage(R.string.cancel_attention_prompt).setPositiveButton(getString(R.string.sure), new DialogInterface.OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(DialogInterface dialog, int which) {
|
|
|
- deleteFriend(sortFriend, 0);
|
|
|
- }
|
|
|
- }).setNegativeButton(getString(R.string.cancel), null);
|
|
|
- builder.create().show();
|
|
|
- }
|
|
|
-
|
|
|
- private void showDeleteAllDialog(final BaseSortModel<Friend> sortFriend) {
|
|
|
- if (sortFriend.getBean().getStatus() == Friend.STATUS_UNKNOW) {
|
|
|
- return;
|
|
|
- }
|
|
|
- AlertDialog.Builder builder = new AlertDialog.Builder(MyFriendActivity.this).setTitle(R.string.prompt_title).setMessage(R.string.delete_all_prompt)
|
|
|
- .setPositiveButton(getString(R.string.sure), new DialogInterface.OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(DialogInterface dialog, int which) {
|
|
|
- deleteFriend(sortFriend, 1);
|
|
|
- }
|
|
|
- }).setNegativeButton(getString(R.string.cancel), null);
|
|
|
- builder.create().show();
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * @param
|
|
|
- * @param type 0 取消关注 <br/>
|
|
|
- * 1、彻底删除<br/>
|
|
|
- */
|
|
|
- private void deleteFriend(final BaseSortModel<Friend> sortFriend, final int type) {
|
|
|
- HashMap<String, String> params = new HashMap<String, String>();
|
|
|
- params.put("access_token", MyApplication.getInstance().mAccessToken);
|
|
|
- params.put("toUserId", sortFriend.getBean().getUserId());
|
|
|
-
|
|
|
- String url = null;
|
|
|
- if (type == 0) {
|
|
|
- url = MyApplication.getInstance().getConfig().FRIENDS_ATTENTION_DELETE;// 取消关注
|
|
|
- } else {
|
|
|
- url = MyApplication.getInstance().getConfig().FRIENDS_DELETE;// 删除好友
|
|
|
- }
|
|
|
-
|
|
|
- ProgressDialogUtil.show(mProgressDialog);
|
|
|
- StringJsonObjectRequest<Void> request = new StringJsonObjectRequest<Void>(url, new Response.ErrorListener() {
|
|
|
- @Override
|
|
|
- public void onErrorResponse(VolleyError arg0) {
|
|
|
- ProgressDialogUtil.dismiss(mProgressDialog);
|
|
|
- ToastUtil.showErrorNet(MyFriendActivity.this);
|
|
|
- }
|
|
|
- }, new StringJsonObjectRequest.Listener<Void>() {
|
|
|
- @Override
|
|
|
- public void onResponse(ObjectResult<Void> result) {
|
|
|
- boolean success = Result.defaultParser(MyFriendActivity.this, result, true);
|
|
|
- if (success) {
|
|
|
- if (type == 0) {
|
|
|
- ToastUtil.showToast(MyFriendActivity.this, R.string.cancel_attention_succ);
|
|
|
- NewFriendMessage message = NewFriendMessage.createWillSendMessage(MyApplication.getInstance().mLoginUser,
|
|
|
- XmppMessage.TYPE_DELSEE, null, sortFriend.getBean());
|
|
|
- // ((CardcastActivity) getActivity()).sendNewFriendMessage(sortFriend.getBean().getUserId(), message);// 解除关注
|
|
|
- } else {
|
|
|
- ToastUtil.showToast(MyFriendActivity.this, R.string.delete_all_succ);
|
|
|
- NewFriendMessage message = NewFriendMessage.createWillSendMessage(MyApplication.getInstance().mLoginUser,
|
|
|
- XmppMessage.TYPE_DELALL, null, sortFriend.getBean());
|
|
|
- // ((CardcastActivity) getActivity()).sendNewFriendMessage(sortFriend.getBean().getUserId(), message);// 解除好友
|
|
|
- }
|
|
|
-
|
|
|
- FriendHelper.removeAttentionOrFriend(mLoginUserId, sortFriend.getBean().getUserId());
|
|
|
-
|
|
|
- mSortFriends.remove(sortFriend);
|
|
|
- String firstLetter = sortFriend.getFirstLetter();
|
|
|
- mSideBar.removeExist(firstLetter);// 移除之前设置的首字母
|
|
|
- mAdapter.notifyDataSetInvalidated();
|
|
|
-
|
|
|
- // 更新消息界面
|
|
|
- MsgBroadcast.broadcastMsgUiUpdate(MyFriendActivity.this);
|
|
|
- }
|
|
|
- ProgressDialogUtil.dismiss(mProgressDialog);
|
|
|
- }
|
|
|
- }, Void.class, params);
|
|
|
-// mActivity.addDefaultRequest(request);
|
|
|
- MyApplication.getInstance().getFastVolley().addDefaultRequest(HASHCODE, request);
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
|
|
|
@Override
|
|
|
public void onDestroy() {
|