From fd8e1bcb1d4b3978f85821542d15113175d485fd Mon Sep 17 00:00:00 2001 From: jinfeng Date: Thu, 23 May 2019 17:52:43 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=81=8A=E5=A4=A9?= =?UTF-8?q?=E5=AE=A4=E9=94=AE=E7=9B=98=E6=90=9C=E7=B4=A2=E9=94=AE=E6=97=A0?= =?UTF-8?q?=E6=95=88=E9=97=AE=E9=A2=98=EF=BC=8CIM-5412?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chat/activity/SearchChatRoomActivity.java | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/chatapp/src/main/java/jiguang/chat/activity/SearchChatRoomActivity.java b/chatapp/src/main/java/jiguang/chat/activity/SearchChatRoomActivity.java index 6220e02e..4dca1887 100644 --- a/chatapp/src/main/java/jiguang/chat/activity/SearchChatRoomActivity.java +++ b/chatapp/src/main/java/jiguang/chat/activity/SearchChatRoomActivity.java @@ -4,8 +4,10 @@ import android.content.Intent; import android.os.Bundle; import android.text.TextUtils; +import android.view.KeyEvent; import android.view.MotionEvent; import android.view.View; +import android.view.inputmethod.EditorInfo; import android.widget.EditText; import android.widget.ImageView; import android.widget.LinearLayout; @@ -62,6 +64,42 @@ private void initData() { return false; }); + + mSearchEditText.setOnEditorActionListener(new TextView.OnEditorActionListener() { + public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { + if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_UNSPECIFIED) { + + String keytag = mSearchEditText.getText().toString().trim(); + + if (TextUtils.isEmpty(keytag)) { + Toast.makeText(SearchChatRoomActivity.this, "请输入聊天室ID", Toast.LENGTH_SHORT).show(); + } else { + String roomId = mSearchEditText.getText().toString().trim(); + try { + long id = Long.parseLong(roomId); + ChatRoomManager.getChatRoomInfos(Collections.singleton(id), new RequestCallback>() { + @Override + public void gotResult(int i, String s, List chatRoomInfos) { + if (i == 0) { + mRoomID = chatRoomInfos.get(0).getRoomID(); + mLl_chatRoomItem.setVisibility(View.VISIBLE); + mTv_chatRoomDesc.setText(chatRoomInfos.get(0).getDescription()); + mTv_chatRoomName.setText(chatRoomInfos.get(0).getName()); + }else { + mLl_chatRoomItem.setVisibility(View.GONE); + Toast.makeText(SearchChatRoomActivity.this, "搜索的聊天室不存在", Toast.LENGTH_SHORT).show(); + } + } + }); + } catch (NumberFormatException e) { + Toast.makeText(SearchChatRoomActivity.this, "搜索的聊天室不存在", Toast.LENGTH_SHORT).show(); + } + } + } + return true; + } + }); + mAc_iv_press_back.setOnClickListener(v -> { finish(); CommonUtils.hideKeyboard(SearchChatRoomActivity.this); From 321d8c3988f4bf3b3a17384ed9a6215d42d91334 Mon Sep 17 00:00:00 2001 From: jinfeng Date: Fri, 24 May 2019 10:09:46 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8D=95=E8=81=8A?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E8=AE=BE=E7=BD=AE=E9=A1=B5=E5=B1=95=E7=A4=BA?= =?UTF-8?q?=E9=97=AE=E9=A2=98,IM-5432?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chatapp/src/main/java/jiguang/chat/view/ChatDetailView.java | 1 - chatapp/src/main/res/layout/activity_chat_detail.xml | 1 - 2 files changed, 2 deletions(-) diff --git a/chatapp/src/main/java/jiguang/chat/view/ChatDetailView.java b/chatapp/src/main/java/jiguang/chat/view/ChatDetailView.java index e80289a5..811995ce 100644 --- a/chatapp/src/main/java/jiguang/chat/view/ChatDetailView.java +++ b/chatapp/src/main/java/jiguang/chat/view/ChatDetailView.java @@ -178,7 +178,6 @@ public void setSingleView(boolean friend) { findViewById(R.id.single_chat_remove_3).setVisibility(View.GONE); findViewById(R.id.single_chat_remove_4).setVisibility(View.GONE); findViewById(R.id.single_chat_remove_5).setVisibility(View.GONE); - findViewById(R.id.single_chat_remove_6).setVisibility(View.GONE); mDelGroupBtn.setText("删除好友"); } diff --git a/chatapp/src/main/res/layout/activity_chat_detail.xml b/chatapp/src/main/res/layout/activity_chat_detail.xml index 814a1068..4a08628a 100644 --- a/chatapp/src/main/res/layout/activity_chat_detail.xml +++ b/chatapp/src/main/res/layout/activity_chat_detail.xml @@ -262,7 +262,6 @@ From 1ba39ad0268afbf0623bad5b7a1675774ab455fd Mon Sep 17 00:00:00 2001 From: jinfeng Date: Fri, 24 May 2019 13:44:03 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E7=BE=A4=E6=88=90=E5=91=98=E6=88=90=E5=8A=9F=E5=90=8E=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=9C=AA=E5=88=B7=E6=96=B0=E9=97=AE=E9=A2=98=EF=BC=8C?= =?UTF-8?q?IM-5441?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/jiguang/chat/controller/ChatDetailController.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/chatapp/src/main/java/jiguang/chat/controller/ChatDetailController.java b/chatapp/src/main/java/jiguang/chat/controller/ChatDetailController.java index afdfda79..e6711efd 100644 --- a/chatapp/src/main/java/jiguang/chat/controller/ChatDetailController.java +++ b/chatapp/src/main/java/jiguang/chat/controller/ChatDetailController.java @@ -625,6 +625,8 @@ private void addMembers(ArrayList users) { public void gotResult(final int status, final String desc) { mLoadingDialog.dismiss(); if (status == 0) { + mMemberInfoList.clear(); + mMemberInfoList.addAll(mGroupInfo.getGroupMembers()); refreshMemberList(); } else { ToastUtil.shortToast(mContext, "添加失败"); From 6391c34a38afd1d57de6e3491f6b9044d33b1484 Mon Sep 17 00:00:00 2001 From: jinfeng Date: Fri, 24 May 2019 14:29:11 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E7=BE=A4=E7=BB=84=E6=97=B6=E7=BE=A4=E5=A4=B4=E5=83=8F=E9=97=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=8CIM-5442?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chatapp/src/main/java/jiguang/chat/activity/ChatActivity.java | 1 + .../jiguang/chat/activity/SelectCreateGroupTypeActivity.java | 1 + 2 files changed, 2 insertions(+) diff --git a/chatapp/src/main/java/jiguang/chat/activity/ChatActivity.java b/chatapp/src/main/java/jiguang/chat/activity/ChatActivity.java index 08a565f2..30e26d1b 100644 --- a/chatapp/src/main/java/jiguang/chat/activity/ChatActivity.java +++ b/chatapp/src/main/java/jiguang/chat/activity/ChatActivity.java @@ -258,6 +258,7 @@ private void initChatRoomData() { mChatView.setChatListAdapter(mChatAdapter); mChatView.setToBottom(); mChatView.setConversation(mConv); + mChatView.setGroupIcon(); initEmoticonsKeyBoardBar(); } diff --git a/chatapp/src/main/java/jiguang/chat/activity/SelectCreateGroupTypeActivity.java b/chatapp/src/main/java/jiguang/chat/activity/SelectCreateGroupTypeActivity.java index 77d40e5b..9502d6f4 100644 --- a/chatapp/src/main/java/jiguang/chat/activity/SelectCreateGroupTypeActivity.java +++ b/chatapp/src/main/java/jiguang/chat/activity/SelectCreateGroupTypeActivity.java @@ -59,6 +59,7 @@ protected void onCreate(Bundle savedInstanceState) { setContentView(R.layout.activity_select_create_group_type); initTitle(true, true, "发起群聊", "", false, ""); + JGApplication.groupAvatarPath = null;//清空头像信息 initView(); initData(); From 66ddde7bb719d6e4f5dcd01666af5606334f9e48 Mon Sep 17 00:00:00 2001 From: jinfeng Date: Fri, 24 May 2019 16:05:32 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E7=BE=A4=E6=88=90=E5=91=98=E5=90=8E=EF=BC=8C=E8=81=8A=E5=A4=A9?= =?UTF-8?q?=E5=AE=A4=E8=AF=A6=E6=83=85=E6=8C=89=E9=92=AE=E4=B8=8D=E8=A7=81?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chatapp/src/main/java/jiguang/chat/activity/ChatActivity.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/chatapp/src/main/java/jiguang/chat/activity/ChatActivity.java b/chatapp/src/main/java/jiguang/chat/activity/ChatActivity.java index 30e26d1b..5f5aa771 100644 --- a/chatapp/src/main/java/jiguang/chat/activity/ChatActivity.java +++ b/chatapp/src/main/java/jiguang/chat/activity/ChatActivity.java @@ -809,8 +809,9 @@ public void onEvent(MessageEvent event) { case group_member_removed: //删除群成员事件 userNames = ((EventNotificationContent) message.getContent()).getUserNames(); + UserInfo operator = ((EventNotificationContent) message.getContent()).getOperatorUserInfo(); //群主删除了当前用户,则隐藏聊天详情按钮 - if (userNames.contains(mMyInfo.getNickname()) || userNames.contains(mMyInfo.getUserName())) { + if ((userNames.contains(mMyInfo.getNickname()) || userNames.contains(mMyInfo.getUserName())) && operator.getUserID() != mMyInfo.getUserID()) { runOnUiThread(new Runnable() { @Override public void run() {