fix(emergency): 完善应急就医群聊功能—急救员邀请+图标显示+头像兜底
- TUICallingViewManager 启用 initInviteUserFunction,急救员通话中显示右上角 + 号邀请按钮 - InputActionSetting 新增 firstAid 字段,setter 同步写入 SP 供跨模块读取 - createEmergencySetting 支持 firstAid 参数,急救员进入群聊时传入 true - TUIGroupChatFragment 右侧抽屉图标仅在 firstAid 为 true 时显示 - GlideEngine 新增 loadImageByDefault 兜底加载方法 - GroupMemberAdapter 头像加载使用兜底图标,修复空 URL 显示异常 - GroupMemberAdapter 修复 administrator 群组的成员过滤逻辑 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
f61d8c90c9
commit
adfa40313a
+53
-47
@@ -16,6 +16,7 @@ import com.tencent.qcloud.tuicore.TUIConstants;
|
||||
import com.tencent.qcloud.tuicore.TUICore;
|
||||
import com.tencent.qcloud.tuicore.TUILogin;
|
||||
import com.tencent.qcloud.tuicore.interfaces.ITUINotification;
|
||||
import com.tencent.qcloud.tuicore.util.SPUtils;
|
||||
import com.tencent.qcloud.tuicore.interfaces.ITUIService;
|
||||
import com.tencent.qcloud.tuicore.util.ToastUtil;
|
||||
import com.tencent.qcloud.tuikit.TUICommonDefine;
|
||||
@@ -728,53 +729,58 @@ public class TUICallingViewManager implements ITUINotification {
|
||||
}
|
||||
|
||||
private void initInviteUserFunction() {
|
||||
// ITUIService service = TUICore.getService(TUIConstants.TUIGroup.SERVICE_NAME);
|
||||
// boolean enableInviteUser = (service != null);
|
||||
//
|
||||
// if (enableInviteUser && mBaseCallView != null) {
|
||||
// Button inviteUserBtn = new Button(mContext);
|
||||
// TUICallDefine.MediaType mediaType = TUICallingStatusManager.sharedInstance(mContext).getMediaType();
|
||||
// int resId = TUICallDefine.MediaType.Video.equals(mediaType)
|
||||
// ? R.drawable.tuicalling_ic_add_user_white : R.drawable.tuicalling_ic_add_user_black;
|
||||
// inviteUserBtn.setBackgroundResource(resId);
|
||||
// inviteUserBtn.setOnClickListener(new View.OnClickListener() {
|
||||
// @Override
|
||||
// public void onClick(View v) {
|
||||
// String groupId = TUICallingStatusManager.sharedInstance(mContext).getGroupId();
|
||||
// if (TextUtils.isEmpty(groupId)) {
|
||||
// ToastUtil.toastShortMessage(mContext.getString(R.string.tuicalling_groupid_is_empty));
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// TUICallDefine.Status status = TUICallingStatusManager.sharedInstance(mContext).getCallStatus();
|
||||
// TUICallDefine.Role role = TUICallingStatusManager.sharedInstance(mContext).getCallRole();
|
||||
// if (TUICallDefine.Role.Called.equals(role) && !TUICallDefine.Status.Accept.equals(status)) {
|
||||
// ToastUtil.toastShortMessage(mContext.getString(R.string.tuicalling_status_is_not_accept));
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// ArrayList<String> list = new ArrayList<>();
|
||||
// list.add(mInviter.userId);
|
||||
// for (CallingUserModel model : mInviteeList) {
|
||||
// if (model != null && !TextUtils.isEmpty(model.userId) && !list.contains(model.userId)) {
|
||||
// list.add(model.userId);
|
||||
// }
|
||||
// }
|
||||
// if (!list.contains(TUILogin.getLoginUser())) {
|
||||
// list.add(TUILogin.getLoginUser());
|
||||
// }
|
||||
//
|
||||
// TUILog.i(TAG, "initInviteUserFunction, groupId: " + groupId + " ,list: " + list);
|
||||
//
|
||||
// Bundle bundle = new Bundle();
|
||||
// bundle.putString(TUIConstants.TUIGroup.GROUP_ID, groupId);
|
||||
// bundle.putString(TUIConstants.TUIGroup.USER_DATA, Constants.TUICALLKIT);
|
||||
// bundle.putStringArrayList(TUIConstants.TUIGroup.SELECTED_LIST, list);
|
||||
// TUICore.startActivity("GroupMemberActivity", bundle);
|
||||
// }
|
||||
// });
|
||||
// mBaseCallView.enableAddUserView(inviteUserBtn);
|
||||
// }
|
||||
boolean firstAid = SPUtils.getInstance().getBoolean("key_first_aid", false);
|
||||
if (!firstAid) {
|
||||
return;
|
||||
}
|
||||
|
||||
ITUIService service = TUICore.getService(TUIConstants.TUIGroup.SERVICE_NAME);
|
||||
boolean enableInviteUser = (service != null);
|
||||
|
||||
if (enableInviteUser && mBaseCallView != null) {
|
||||
Button inviteUserBtn = new Button(mContext);
|
||||
TUICallDefine.MediaType mediaType = TUICallingStatusManager.sharedInstance(mContext).getMediaType();
|
||||
int resId = TUICallDefine.MediaType.Video.equals(mediaType)
|
||||
? R.drawable.tuicalling_ic_add_user_white : R.drawable.tuicalling_ic_add_user_black;
|
||||
inviteUserBtn.setBackgroundResource(resId);
|
||||
inviteUserBtn.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
String groupId = TUICallingStatusManager.sharedInstance(mContext).getGroupId();
|
||||
if (TextUtils.isEmpty(groupId)) {
|
||||
ToastUtil.toastShortMessage(mContext.getString(R.string.tuicalling_groupid_is_empty));
|
||||
return;
|
||||
}
|
||||
|
||||
TUICallDefine.Status status = TUICallingStatusManager.sharedInstance(mContext).getCallStatus();
|
||||
TUICallDefine.Role role = TUICallingStatusManager.sharedInstance(mContext).getCallRole();
|
||||
if (TUICallDefine.Role.Called.equals(role) && !TUICallDefine.Status.Accept.equals(status)) {
|
||||
ToastUtil.toastShortMessage(mContext.getString(R.string.tuicalling_status_is_not_accept));
|
||||
return;
|
||||
}
|
||||
|
||||
ArrayList<String> list = new ArrayList<>();
|
||||
list.add(mInviter.userId);
|
||||
for (CallingUserModel model : mInviteeList) {
|
||||
if (model != null && !TextUtils.isEmpty(model.userId) && !list.contains(model.userId)) {
|
||||
list.add(model.userId);
|
||||
}
|
||||
}
|
||||
if (!list.contains(TUILogin.getLoginUser())) {
|
||||
list.add(TUILogin.getLoginUser());
|
||||
}
|
||||
|
||||
TUILog.i(TAG, "initInviteUserFunction, groupId: " + groupId + " ,list: " + list);
|
||||
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString(TUIConstants.TUIGroup.GROUP_ID, groupId);
|
||||
bundle.putString(TUIConstants.TUIGroup.USER_DATA, Constants.TUICALLKIT);
|
||||
bundle.putStringArrayList(TUIConstants.TUIGroup.SELECTED_LIST, list);
|
||||
TUICore.startActivity("GroupMemberActivity", bundle);
|
||||
}
|
||||
});
|
||||
mBaseCallView.enableAddUserView(inviteUserBtn);
|
||||
}
|
||||
}
|
||||
|
||||
private void inviteUsersToGroupCall(List<String> userIdList) {
|
||||
|
||||
Reference in New Issue
Block a user