Skip to content

Commit

Permalink
jchat2.3.0版本测试第一轮
Browse files Browse the repository at this point in the history
  • Loading branch information
chenyanan committed Dec 29, 2017
1 parent b1df02f commit dbf579e
Show file tree
Hide file tree
Showing 33 changed files with 82 additions and 79 deletions.
Binary file removed chatapp/libs/arm64-v8a/libjcore117.so
Binary file not shown.
Binary file added chatapp/libs/arm64-v8a/libjcore118.so
Binary file not shown.
Binary file removed chatapp/libs/armeabi-v7a/libjcore117.so
Binary file not shown.
Binary file added chatapp/libs/armeabi-v7a/libjcore118.so
Binary file not shown.
Binary file removed chatapp/libs/armeabi/libjcore117.so
Binary file not shown.
Binary file added chatapp/libs/armeabi/libjcore118.so
Binary file not shown.
Binary file removed chatapp/libs/jcore-android-1.1.7-debug-b155.jar
Binary file not shown.
Binary file added chatapp/libs/jcore-android-1.1.8.jar
Binary file not shown.
Binary file removed chatapp/libs/jmessage-android_debug_v2.4.0_b903.jar
Binary file not shown.
Binary file added chatapp/libs/jmessage-android_v2.4.0.jar
Binary file not shown.
Binary file removed chatapp/libs/mips/libjcore117.so
Binary file not shown.
Binary file added chatapp/libs/mips/libjcore118.so
Binary file not shown.
Binary file removed chatapp/libs/mips64/libjcore117.so
Binary file not shown.
Binary file added chatapp/libs/mips64/libjcore118.so
Binary file not shown.
Binary file removed chatapp/libs/x86/libjcore117.so
Binary file not shown.
Binary file added chatapp/libs/x86/libjcore118.so
Binary file not shown.
Binary file removed chatapp/libs/x86_64/libjcore117.so
Binary file not shown.
Binary file added chatapp/libs/x86_64/libjcore118.so
Binary file not shown.
1 change: 1 addition & 0 deletions chatapp/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@
<activity
android:name=".activity.SearchChatRoomActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="stateVisible"
android:theme="@style/AppTh"/>
<activity
android:name=".activity.GroupAvatarActivity"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
import jiguang.chat.utils.keyboard.utils.EmoticonsKeyboardUtils;
import jiguang.chat.utils.keyboard.widget.FuncLayout;
import jiguang.chat.utils.photovideo.takevideo.CameraActivity;
import jiguang.chat.utils.photovideo.takevideo.utils.LogUtils;
import jiguang.chat.view.ChatView;
import jiguang.chat.view.SimpleAppsGridView;
import jiguang.chat.view.TipItem;
Expand Down Expand Up @@ -174,7 +175,7 @@ protected void onCreate(Bundle savedInstanceState) {

private void initChatRoom(long chatRoomId) {
ProgressDialog dialog = new ProgressDialog(mContext);
dialog.setMessage("正在加载...");
dialog.setMessage("正在进入聊天室...");
dialog.show();
ChatRoomManager.enterChatRoom(chatRoomId, new RequestCallback<Conversation>() {
@Override
Expand Down Expand Up @@ -405,6 +406,7 @@ private void initEmoticonsKeyBoardBar() {

ekBar.getEtChat().setOnSizeChangedListener((w, h, oldw, oldh) -> scrollToBottom());
//发送按钮
//发送文本消息
ekBar.getBtnSend().setOnClickListener(v -> {
String mcgContent = ekBar.getEtChat().getText().toString();
scrollToBottom();
Expand All @@ -419,6 +421,7 @@ private void initEmoticonsKeyBoardBar() {
} else if (null != mAtList) {
msg = mConv.createSendMessage(content, mAtList, null);
} else {
LogUtils.d("ChatActivity", "create send message conversation = " + mConv +"==content==" + content.toString());
msg = mConv.createSendMessage(content);
}

Expand All @@ -436,6 +439,7 @@ private void initEmoticonsKeyBoardBar() {
forDel.clear();
}
} else {
JMessageClient.sendMessage(msg);
mChatAdapter.addMsgToList(msg);
ekBar.getEtChat().setText("");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,23 +49,8 @@ public void gotResult(int i, String s, List<ChatRoomInfo> chatRoomInfos) {
mInfo = chatRoomInfos.get(0);
mChatRoomName.setText(mInfo.getName());
mChatRoomID.setText(mInfo.getRoomID() + "");
mInfo.getDescription(new RequestCallback<String>() {
@Override
public void gotResult(int i, String s, String s2) {
if (i == 0) {
mChatRoomDesc.setText(s2);
}
}
});

mInfo.getTotalMemberCount(new RequestCallback<Integer>() {
@Override
public void gotResult(int i, String s, Integer integer) {
if (i == 0) {
mChatRoomMember.setText(integer + "");
}
}
});
mChatRoomDesc.setText(mInfo.getDescription());
mChatRoomMember.setText(mInfo.getTotalMemberCount() + "");
}
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class ChatRoomInfoActivity extends BaseActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_chat_room_info);
initTitle(true, true, "详细资料", "", false, "");
initTitle(true, true, "聊天室资料", "", false, "");
mTv_chatRoomName = (TextView) findViewById(R.id.tv_chatRoomName);
tv_chatRoomID = (TextView) findViewById(R.id.tv_chatRoomID);
tv_chatRoomMember = (TextView) findViewById(R.id.tv_chatRoomMember);
Expand All @@ -39,22 +39,9 @@ public void gotResult(int i, String s, List<ChatRoomInfo> chatRoomInfos) {
ChatRoomInfo info = chatRoomInfos.get(0);
mTv_chatRoomName.setText(info.getName());
tv_chatRoomID.setText(info.getRoomID() + "");
info.getTotalMemberCount(new RequestCallback<Integer>() {
@Override
public void gotResult(int i, String s, Integer integer) {
if (i == 0) {
tv_chatRoomMember.setText(integer + "");
}
}
});
info.getDescription(new RequestCallback<String>() {
@Override
public void gotResult(int i, String s, String s2) {
if (i == 0) {
tv_chatRoomDesc.setText(s2);
}
}
});
tv_chatRoomMember.setText(info.getTotalMemberCount() + "");
tv_chatRoomDesc.setText(info.getDescription());

}
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener,
private View mUserLine;
private View mPswLine;
//内部测试环境使用,发布时会置为false;此处对开发者来说即使打开也是没有效果的.
private boolean isTestVisibility = true;
private boolean isTestVisibility = false;
private RadioGroup mRadioGroup;
private RadioButton mRelease;
private RadioButton mTest;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package jiguang.chat.activity;

import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.MotionEvent;
Expand All @@ -17,6 +18,7 @@
import cn.jpush.im.android.api.callback.RequestCallback;
import cn.jpush.im.android.api.model.ChatRoomInfo;
import jiguang.chat.R;
import jiguang.chat.utils.CommonUtils;

/**
* Created by ${chenyn} on 2017/11/9.
Expand All @@ -31,6 +33,7 @@ public class SearchChatRoomActivity extends BaseActivity {
private EditText mSearchEditText;
private LinearLayout mAc_iv_press_back;
private TextView mTv_search;
private long mRoomID;

@Override
protected void onCreate(Bundle savedInstanceState) {
Expand All @@ -57,24 +60,20 @@ private void initData() {
return false;
});

mAc_iv_press_back.setOnClickListener(v -> finish());
mAc_iv_press_back.setOnClickListener(v -> {
finish();
CommonUtils.hideKeyboard(SearchChatRoomActivity.this);
});
mTv_search.setOnClickListener(v -> {
if (!TextUtils.isEmpty(mSearchEditText.getText())) {
String roomId = mSearchEditText.getText().toString().trim();
ChatRoomManager.getChatRoomInfos(Collections.singleton(Long.parseLong(roomId)), 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);
chatRoomInfos.get(0).getDescription(new RequestCallback<String>() {
@Override
public void gotResult(int i, String s, String s2) {
if ( i == 0) {
mTv_chatRoomDesc.setText(s2);
}
}
});

mTv_chatRoomDesc.setText(chatRoomInfos.get(0).getDescription());
mTv_chatRoomName.setText(chatRoomInfos.get(0).getName());
}else {
mLl_chatRoomItem.setVisibility(View.GONE);
Expand All @@ -85,6 +84,12 @@ public void gotResult(int i, String s, String s2) {
}
});

mLl_chatRoomItem.setOnClickListener(v -> {
Intent intent = new Intent(SearchChatRoomActivity.this, ChatRoomDetailActivity.class);
intent.putExtra("chatRoomId", mRoomID);
startActivity(intent);
});

}

private void initView() {
Expand All @@ -97,4 +102,5 @@ private void initView() {
mAc_iv_press_back = (LinearLayout) findViewById(R.id.ac_iv_press_back);
mSearchEditText = (EditText) findViewById(R.id.ac_et_search);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public class SelectCreateGroupTypeActivity extends BaseActivity implements TextW
private EditText mEt_groupName;
private LinearLayout mLl_groupType;
private TextView mTv_groupSelect;
private TextView tvInGroupDesc;
private Button mBtn_createGroup;
private ChoosePhoto mChoosePhoto;
private File avatarFile;
Expand Down Expand Up @@ -108,7 +109,7 @@ public void gotResult(int responseCode, String responseMessage) {
}
});
} else {
JMessageClient.createRestrictedGroup(mEt_groupName.getText().toString(), "", avatarFile, "", new CreateGroupCallback() {
JMessageClient.createPublicGroup(mEt_groupName.getText().toString(), "", avatarFile, "", new CreateGroupCallback() {
@Override
public void gotResult(int responseCode, String responseMsg, final long groupId) {
if (responseCode == 0) {
Expand Down Expand Up @@ -188,6 +189,7 @@ private void initView() {
mEt_groupName = (EditText) findViewById(R.id.et_groupName);
mLl_groupType = (LinearLayout) findViewById(R.id.ll_groupType);
mTv_groupSelect = (TextView) findViewById(R.id.tv_groupSelect);
tvInGroupDesc = (TextView) findViewById(R.id.tvInGroupDesc);
mBtn_createGroup = (Button) findViewById(R.id.btn_createGroup);

mBtn_createGroup.setClickable(false);
Expand Down Expand Up @@ -217,10 +219,12 @@ public void showDialog() {
switch (v.getId()) {
case R.id.man_rl:
mTv_groupSelect.setText("私有群");
tvInGroupDesc.setText("只能通过群成员邀请入群,无需审核");
genderDialog.dismiss();
break;
case R.id.woman_rl:
mTv_groupSelect.setText("公开群");
tvInGroupDesc.setText("用户可主动申请入群,需群主审核");
genderDialog.dismiss();
break;
case R.id.rl_secrecy:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import android.view.View;
import android.view.ViewGroup;

import com.google.gson.Gson;

import java.util.ArrayList;
import java.util.List;

Expand All @@ -23,7 +25,6 @@
import cn.jpush.im.android.api.model.GroupInfo;
import cn.jpush.im.android.api.model.UserInfo;
import cn.jpush.im.android.eventbus.EventBus;
import cn.jpush.im.android.utils.JsonUtil;
import jiguang.chat.R;
import jiguang.chat.application.JGApplication;
import jiguang.chat.controller.ContactsController;
Expand Down Expand Up @@ -253,6 +254,7 @@ public void onEvent(GroupApprovalEvent event) {
@Override
public void gotResult(int i, String s, UserInfo fromUserInfo) {
if (i == 0) {
Gson gson = new Gson();
event.getApprovalUserInfoList(new GetUserInfoListCallback() {
@Override
public void gotResult(int i, String s, List<UserInfo> list) {
Expand All @@ -267,12 +269,12 @@ public void gotResult(int i, String s, List<UserInfo> list) {
if (fromUserInfo.getAvatar() != null) {
entry = new GroupApplyEntry(fromUserInfo.getUserName(), list.get(0).getUserName(), fromUserInfo.getAppKey(),
list.get(0).getAvatarFile().getPath(), fromUserInfo.getDisplayName(), list.get(0).getDisplayName(),
null, GroupApplyInvitation.INVITED.getValue(), JsonUtil.toJson(event), gid + "",
null, GroupApplyInvitation.INVITED.getValue(), gson.toJson(event), gid + "",
user, 0, 0);//邀请type=0
} else {
entry = new GroupApplyEntry(fromUserInfo.getUserName(), list.get(0).getUserName(), fromUserInfo.getAppKey(),
null, fromUserInfo.getDisplayName(), list.get(0).getDisplayName(),
null, GroupApplyInvitation.INVITED.getValue(), JsonUtil.toJson(event), gid + "",
null, GroupApplyInvitation.INVITED.getValue(), gson.toJson(event), gid + "",
user, 0, 0);//邀请type=0
}
} else {
Expand All @@ -283,12 +285,12 @@ public void gotResult(int i, String s, List<UserInfo> list) {
if (fromUserInfo.getAvatar() != null) {
entry = new GroupApplyEntry(list.get(0).getUserName(), list.get(0).getUserName(), list.get(0).getAppKey(),
list.get(0).getAvatarFile().getPath(), list.get(0).getDisplayName(), list.get(0).getDisplayName(),
event.getReason(), GroupApplyInvitation.INVITED.getValue(), JsonUtil.toJson(event), gid + "",
event.getReason(), GroupApplyInvitation.INVITED.getValue(), gson.toJson(event), gid + "",
user, 0, 1);//申请type=1
} else {
entry = new GroupApplyEntry(list.get(0).getUserName(), list.get(0).getUserName(), list.get(0).getAppKey(),
null, fromUserInfo.getDisplayName(), list.get(0).getDisplayName(),
event.getReason(), GroupApplyInvitation.INVITED.getValue(), JsonUtil.toJson(event), gid + "",
event.getReason(), GroupApplyInvitation.INVITED.getValue(), gson.toJson(event), gid + "",
user, 0, 1);//申请type=1
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public void gotResult(int responseCode, String responseMessage, Bitmap avatarBit
*/
public void onEvent(OfflineMessageEvent event) {
Conversation conv = event.getConversation();
if (!conv.getTargetId().equals("feedback_Android")) {
if (!conv.getTargetId().equals("feedback_Android") && conv.getType() != ConversationType.chatroom) {
mBackgroundHandler.sendMessage(mBackgroundHandler.obtainMessage(REFRESH_CONVERSATION_LIST, conv));
}
}
Expand All @@ -226,7 +226,7 @@ public void onEventMainThread(MessageReceiptStatusChangeEvent event) {
*/
public void onEvent(ConversationRefreshEvent event) {
Conversation conv = event.getConversation();
if (!conv.getTargetId().equals("feedback_Android")) {
if (!conv.getTargetId().equals("feedback_Android") && conv.getType() != ConversationType.chatroom) {
mBackgroundHandler.sendMessage(mBackgroundHandler.obtainMessage(REFRESH_CONVERSATION_LIST, conv));
//多端在线未读数改变时刷新
if (event.getReason().equals(ConversationRefreshEvent.Reason.UNREAD_CNT_UPDATED)) {
Expand All @@ -246,7 +246,9 @@ public void handleMessage(android.os.Message msg) {
switch (msg.what) {
case REFRESH_CONVERSATION_LIST:
Conversation conv = (Conversation) msg.obj;
mConvListController.getAdapter().setToTop(conv);
if (conv.getType() != ConversationType.chatroom) {
mConvListController.getAdapter().setToTop(conv);
}
break;
case DISMISS_REFRESH_HEADER:
mContext.runOnUiThread(new Runnable() {
Expand Down
11 changes: 2 additions & 9 deletions chatapp/src/main/java/jiguang/chat/adapter/ChatRoomAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

import java.util.List;

import cn.jpush.im.android.api.callback.RequestCallback;
import cn.jpush.im.android.api.model.ChatRoomInfo;
import jiguang.chat.R;
import jiguang.chat.view.ChatRoomView;
Expand Down Expand Up @@ -63,14 +62,8 @@ public View getView(int position, View convertView, ViewGroup viewGroup) {

ChatRoomInfo chatRoomInfo = mChatRoomInfoList.get(position);
holder.tv_chatRoomName.setText(chatRoomInfo.getName());
chatRoomInfo.getDescription(new RequestCallback<String>() {
@Override
public void gotResult(int i, String s, String s2) {
if (i == 0) {
holder.tv_chatRoomContent.setText(s2);
}
}
});
holder.tv_chatRoomContent.setText(chatRoomInfo.getDescription());


return convertView;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
import android.widget.TextView;
import android.widget.Toast;

import com.google.gson.Gson;

import java.io.File;
import java.util.List;

Expand All @@ -22,7 +24,6 @@
import cn.jpush.im.android.api.event.GroupApprovalEvent;
import cn.jpush.im.android.api.model.GroupInfo;
import cn.jpush.im.android.api.model.UserInfo;
import cn.jpush.im.android.utils.JsonUtil;
import cn.jpush.im.api.BasicCallback;
import jiguang.chat.R;
import jiguang.chat.database.GroupApplyEntry;
Expand Down Expand Up @@ -123,7 +124,8 @@ public void gotResult(int i, String s, GroupInfo groupInfo) {

//申请
//0为初始状态
GroupApprovalEvent event = JsonUtil.fromJson(entry.eventJson, GroupApprovalEvent.class);
Gson gson = new Gson();
GroupApprovalEvent event = gson.fromJson(entry.eventJson, GroupApprovalEvent.class);
if (entry.btnState == 0) {
holder.item_add_btn.setBackgroundColor(Color.parseColor("#2DD0CF"));
holder.item_add_btn.setTextColor(Color.parseColor("#FFFFFF"));
Expand Down
Loading

0 comments on commit dbf579e

Please sign in to comment.