Skip to content

Commit

Permalink
Merge pull request #154 from jinfengf/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
jinfengf authored May 24, 2019
2 parents 5a86c5f + 66ddde7 commit 83d60d3
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ private void initChatRoomData() {
mChatView.setChatListAdapter(mChatAdapter);
mChatView.setToBottom();
mChatView.setConversation(mConv);
mChatView.setGroupIcon();
initEmoticonsKeyBoardBar();
}

Expand Down Expand Up @@ -808,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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<List<ChatRoomInfo>>() {
@Override
public void gotResult(int i, String s, List<ChatRoomInfo> 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,8 @@ private void addMembers(ArrayList<String> 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, "添加失败");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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("删除好友");
}

Expand Down
1 change: 0 additions & 1 deletion chatapp/src/main/res/layout/activity_chat_detail.xml
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,6 @@
</RelativeLayout>

<View
android:id="@+id/single_chat_remove_6"
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:background="#E8EDF3"/>
Expand Down

0 comments on commit 83d60d3

Please sign in to comment.