第N+6次提交专属红包
This commit is contained in:
@@ -100,16 +100,27 @@ public class RedPacketViewHolder extends ChatBaseMessageViewHolder {
|
||||
if (Integer.parseInt(circleShareBean.data.getStatus()) > 0) {
|
||||
ChatDataUtils.set(binding.bigLy.getContext(), "redpack_" + circleShareBean.data.getId(), Integer.parseInt(circleShareBean.data.getStatus()));
|
||||
}
|
||||
try {
|
||||
if (ChatDataUtils.get(binding.bigLy.getContext(), "redpack_" + circleShareBean.data.getId(), 0) > 0) {
|
||||
circleShareBean.data.setStatus(ChatDataUtils.get(binding.bigLy.getContext(), "redpack_" + circleShareBean.data.getId(), 0) + "");
|
||||
}
|
||||
int status = ChatDataUtils.get(binding.bigLy.getContext(), "redpack_" + circleShareBean.data.getId(), 0);
|
||||
}catch (Exception e){
|
||||
circleShareBean.data.setStatus("0");
|
||||
|
||||
}
|
||||
int status = 0;
|
||||
try {
|
||||
status = ChatDataUtils.get(binding.bigLy.getContext(), "redpack_" + circleShareBean.data.getId(), 0);
|
||||
}catch (ClassCastException e){
|
||||
status = 0;
|
||||
}
|
||||
|
||||
int finalStatus = status;
|
||||
RxBus.getInstance().toObservable(RxHongBaoBean.class)
|
||||
.subscribeOn(rx.schedulers.Schedulers.io())
|
||||
.unsubscribeOn(rx.schedulers.Schedulers.io())
|
||||
.subscribe(changeImageViewBean -> {//回顶部
|
||||
if (status < 1) {
|
||||
if (finalStatus < 1) {
|
||||
if (changeImageViewBean.id.equals(circleShareBean.data.getId())) {
|
||||
changeInfo(circleShareBean.data, binding, message, null, null);
|
||||
if(!TextUtils.isEmpty(circleShareBean.data.getReceiverUid())){//专属红包收款人才需要网络更新
|
||||
@@ -372,14 +383,18 @@ public class RedPacketViewHolder extends ChatBaseMessageViewHolder {
|
||||
LogUtils.i("红包类型", "名片获取到的数据红包类型1:" + GsonUtils.beanToJSONString(data));
|
||||
|
||||
if (data.getCoinType().equals("0")) {
|
||||
binding.mingpianTv.setText("拼手气红包");
|
||||
if(TextUtils.isEmpty(data.getGroupId())){
|
||||
binding.mingpianTv.setText("红包");
|
||||
}else {
|
||||
binding.mingpianTv.setText("拼手气红包");
|
||||
|
||||
if(!TextUtils.isEmpty(data.getReceiverUid())){
|
||||
LogUtils.i("红包类型", "名片获取到的数据红包类型2:" + GsonUtils.beanToJSONString(data));
|
||||
binding.mingpianTv.setText("专属红包");
|
||||
getTeamInfos(binding.itemTitleTv,data.getGroupId(),data.getReceiverUid());
|
||||
if (!TextUtils.isEmpty(data.getReceiverUid())&&!data.getReceiverUid().equals("(null)")) {
|
||||
LogUtils.i("红包类型", "名片获取到的数据红包类型2:" + GsonUtils.beanToJSONString(data));
|
||||
binding.mingpianTv.setText("专属红包");
|
||||
getTeamInfos(binding.itemTitleTv, data.getGroupId(), data.getReceiverUid());
|
||||
// binding.itemTitleTv.setText("给"+data.getReceiverUid()+"的专属红包");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -71,29 +71,29 @@ public class TransferViewHolder extends ChatBaseMessageViewHolder {
|
||||
Log.i("名片", "名片获取到的数据0:" + name);
|
||||
Log.i("名片", "名片获取到的数据2:" + GsonUtils.beanToJSONString(circleShareBean));
|
||||
// binding.itemTitleTv.setVisibility(View.INVISIBLE);//去掉title
|
||||
// if (message.getMessageData().getMessage().getFromAccount().equals(IMKitClient.account())) {
|
||||
// NimUserInfo user = NIMClient.getService(UserService.class).getUserInfo(message.getMessageData().getMessage().getSessionId());
|
||||
// if (user != null) {
|
||||
// binding.itemTitleTv.setText(String.format(binding.itemTitleTv.getResources().getString(R.string.xiangshuizhuanzhang_txt), user.getName()));
|
||||
// }
|
||||
// if (IMKitClient.account().equals(circleShareBean.data.getReceiverUid() + "")) {
|
||||
// NimUserInfo user1 = NIMClient.getService(UserService.class).getUserInfo(message.getMessageData().getMessage().getFromAccount());
|
||||
// if (user != null) {
|
||||
// binding.itemTitleTv.setText(String.format(binding.itemTitleTv.getResources().getString(R.string.xiangshuizhuanzhang1_txt), user1.getName()));
|
||||
// }
|
||||
// }
|
||||
// } else {
|
||||
// NimUserInfo user = NIMClient.getService(UserService.class).getUserInfo(message.getMessageData().getMessage().getFromAccount());
|
||||
// if (user != null) {
|
||||
// binding.itemTitleTv.setText(String.format(binding.itemTitleTv.getResources().getString(R.string.xiangshuizhuanzhang1_txt), user.getName()));
|
||||
// }
|
||||
// if (IMKitClient.account().equals(circleShareBean.data.getSenderUid() + "")) {
|
||||
// NimUserInfo user1 = NIMClient.getService(UserService.class).getUserInfo(message.getMessageData().getMessage().getFromAccount());
|
||||
// if (user != null) {
|
||||
// binding.itemTitleTv.setText(String.format(binding.itemTitleTv.getResources().getString(R.string.xiangshuizhuanzhang_txt), user1.getName()));
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
if (message.getMessageData().getMessage().getFromAccount().equals(IMKitClient.account())) {
|
||||
NimUserInfo user = NIMClient.getService(UserService.class).getUserInfo(message.getMessageData().getMessage().getSessionId());
|
||||
if (user != null) {
|
||||
binding.itemTitleTv.setText(String.format(binding.itemTitleTv.getResources().getString(R.string.xiangshuizhuanzhang_txt), user.getName()));
|
||||
}
|
||||
if (IMKitClient.account().equals(circleShareBean.data.getReceiverUid() + "")) {
|
||||
NimUserInfo user1 = NIMClient.getService(UserService.class).getUserInfo(message.getMessageData().getMessage().getFromAccount());
|
||||
if (user != null) {
|
||||
binding.itemTitleTv.setText(String.format(binding.itemTitleTv.getResources().getString(R.string.xiangshuizhuanzhang1_txt), user1.getName()));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
NimUserInfo user = NIMClient.getService(UserService.class).getUserInfo(message.getMessageData().getMessage().getFromAccount());
|
||||
if (user != null) {
|
||||
binding.itemTitleTv.setText(String.format(binding.itemTitleTv.getResources().getString(R.string.xiangshuizhuanzhang1_txt), user.getName()));
|
||||
}
|
||||
if (IMKitClient.account().equals(circleShareBean.data.getSenderUid() + "")) {
|
||||
NimUserInfo user1 = NIMClient.getService(UserService.class).getUserInfo(message.getMessageData().getMessage().getFromAccount());
|
||||
if (user != null) {
|
||||
binding.itemTitleTv.setText(String.format(binding.itemTitleTv.getResources().getString(R.string.xiangshuizhuanzhang_txt), user1.getName()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
binding.itemNumberTv.setText(String.format("%.2f", Integer.parseInt(circleShareBean.data.getAmount()) / 100f));
|
||||
|
||||
@@ -155,10 +155,12 @@ public class TransferViewHolder extends ChatBaseMessageViewHolder {
|
||||
}
|
||||
|
||||
private void changeInfo(ChatMessageBean message, TransferBean1 circleShareBean, TransferViewheadBinding binding) {
|
||||
FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) binding.bigLy.getLayoutParams();
|
||||
// FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) binding.bigLy.getLayoutParams();
|
||||
if (circleShareBean.getCoinType().equals("0")) {
|
||||
layoutParams.height = dip2px(binding.bigLy.getContext(), 79);
|
||||
binding.mingpianTv.setText(binding.mingpianTv.getResources().getString(R.string.jinbizhuanzhang_des_txt));
|
||||
// layoutParams.height = dip2px(binding.bigLy.getContext(), 79);
|
||||
// binding.mingpianTv.setText(binding.mingpianTv.getResources().getString(R.string.jinbizhuanzhang_des_txt));
|
||||
binding.mingpianTv.setText("钱包转账");
|
||||
|
||||
if (Integer.parseInt(circleShareBean.getStatus()) > 0) {
|
||||
binding.bigLy.setBackgroundResource(R.drawable.zhuanzhang_f_g);
|
||||
} else {
|
||||
@@ -166,7 +168,7 @@ public class TransferViewHolder extends ChatBaseMessageViewHolder {
|
||||
|
||||
}
|
||||
} else {
|
||||
layoutParams.height = dip2px(binding.bigLy.getContext(), 92);
|
||||
// layoutParams.height = dip2px(binding.bigLy.getContext(), 92);
|
||||
binding.mingpianTv.setText(binding.mingpianTv.getResources().getString(R.string.jinbizhuanzhang_des_txt1));
|
||||
if (Integer.parseInt(circleShareBean.getStatus()) > 0) {
|
||||
binding.bigLy.setBackgroundResource(R.drawable.zhuanzhang_f_s);
|
||||
@@ -175,7 +177,7 @@ public class TransferViewHolder extends ChatBaseMessageViewHolder {
|
||||
|
||||
}
|
||||
}
|
||||
binding.bigLy.setLayoutParams(layoutParams);
|
||||
// binding.bigLy.setLayoutParams(layoutParams);
|
||||
|
||||
switch (circleShareBean.getStatus()) {
|
||||
case "0":
|
||||
|
||||
@@ -80,19 +80,23 @@ public class FunBottomActionFactory {
|
||||
// R.drawable.ic_location1,
|
||||
// R.string.chat_message_location));
|
||||
// actions.add(new ActionItem(ActionConstants.ACTION_TYPE_ALBUMS, R.drawable.ic_action_share_albums, R.string.sharealbums_txt));
|
||||
// if (getConfig(IMKitClient.getApplicationContext(), "redpkg_score", false)) { //积分赠送
|
||||
// //礼品积分红包
|
||||
// actions.add(new ActionItem(ActionConstants.ACTION_TYPE_REP_PACKET, R.drawable.ic_action_red_packet, R.string.hongbao_txt));
|
||||
// if (sessionType == SessionTypeEnum.P2P) {
|
||||
//// if (getConfig(IMKitClient.getApplicationContext(), "redpkg_score", false)) { //积分赠送
|
||||
// //礼品积分红包
|
||||
//// }
|
||||
// }
|
||||
//赠送功能入口
|
||||
// if (sessionType == SessionTypeEnum.P2P) {
|
||||
if (sessionType == SessionTypeEnum.P2P) {
|
||||
// if (getConfig(IMKitClient.getApplicationContext(), "transfer_score", false)) { //积分赠送
|
||||
// actions.add(new ActionItem(ActionConstants.ACTION_TYPE_TRANSFER, R.drawable.ic_action_tur, R.string.zhuanzhang_txtq));
|
||||
// }
|
||||
//// if (getConfig(IMKitClient.getApplicationContext(), "transfer_cash", false)) { //cash赠送
|
||||
//// actions.add(new ActionItem(ActionConstants.ACTION_TYPE_TRANSFER_CASH, R.drawable.ic_action_tur, R.string.zhuanzhang_cash_txtq));
|
||||
//// }
|
||||
// }
|
||||
if (getConfig(IMKitClient.getApplicationContext(), "transfer_cash", false)) { //cash赠送
|
||||
|
||||
actions.add(new ActionItem(ActionConstants.ACTION_TYPE_REP_PACKET, R.drawable.ic_action_red_packet, R.string.hongbao_txt));
|
||||
|
||||
actions.add(new ActionItem(ActionConstants.ACTION_TYPE_TRANSFER_CASH, R.drawable.ic_action_tur, R.string.zhuanzhang_cash_txtq));
|
||||
}
|
||||
}
|
||||
// actions.add(
|
||||
// new ActionItem(
|
||||
// ActionConstants.ACTION_TYPE_FILE, R.drawable.ic_send_file, R.string.chat_message_file));
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.netease.yunxin.kit.chatkit.ui.model;
|
||||
|
||||
/**
|
||||
* **********************
|
||||
*
|
||||
* @Author bug machine
|
||||
* 创建时间: 2025/5/13 14:36
|
||||
* 用途
|
||||
* **********************
|
||||
*/
|
||||
public class SwitchGroupBean {
|
||||
|
||||
private int id;
|
||||
private String groupId;
|
||||
private Long userUid;
|
||||
private int allowSend;
|
||||
private int allowGrab;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getGroupId() {
|
||||
return groupId;
|
||||
}
|
||||
|
||||
public void setGroupId(String groupId) {
|
||||
this.groupId = groupId;
|
||||
}
|
||||
|
||||
public Long getUserUid() {
|
||||
return userUid;
|
||||
}
|
||||
|
||||
public void setUserUid(Long userUid) {
|
||||
this.userUid = userUid;
|
||||
}
|
||||
|
||||
public int getAllowSend() {
|
||||
return allowSend;
|
||||
}
|
||||
|
||||
public void setAllowSend(int allowSend) {
|
||||
this.allowSend = allowSend;
|
||||
}
|
||||
|
||||
public int getAllowGrab() {
|
||||
return allowGrab;
|
||||
}
|
||||
|
||||
public void setAllowGrab(int allowGrab) {
|
||||
this.allowGrab = allowGrab;
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ package com.netease.yunxin.kit.chatkit.ui.network;
|
||||
import com.netease.yunxin.kit.chatkit.ui.model.BindBean;
|
||||
import com.netease.yunxin.kit.chatkit.ui.model.RedpacketBean;
|
||||
import com.netease.yunxin.kit.chatkit.ui.model.RedpacketGroupBean;
|
||||
import com.netease.yunxin.kit.chatkit.ui.model.SwitchGroupBean;
|
||||
import com.netease.yunxin.kit.chatkit.ui.model.TransferBean;
|
||||
import com.netease.yunxin.kit.chatkit.ui.model.UserAlbumBean1;
|
||||
|
||||
@@ -142,6 +143,12 @@ public interface ApiService {
|
||||
*/
|
||||
@GET("/album/user/{userId}")
|
||||
Observable<Result<List<UserAlbumBean1>>> getUserAlbums(@Path("userId") String userId);
|
||||
|
||||
/**
|
||||
* 群红包开关列表
|
||||
*/
|
||||
@GET("/group/{groupId}/switches")
|
||||
Observable<Result<List<SwitchGroupBean>>> groupSwitches(@Path("groupId") String page);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -142,6 +142,7 @@ import com.netease.yunxin.kit.chatkit.ui.model.RedpacketBean;
|
||||
import com.netease.yunxin.kit.chatkit.ui.model.RedpacketBean1;
|
||||
import com.netease.yunxin.kit.chatkit.ui.model.RedpacketGroupBean;
|
||||
import com.netease.yunxin.kit.chatkit.ui.model.RxBusToVoom;
|
||||
import com.netease.yunxin.kit.chatkit.ui.model.SwitchGroupBean;
|
||||
import com.netease.yunxin.kit.chatkit.ui.model.TransferBean;
|
||||
import com.netease.yunxin.kit.chatkit.ui.model.TransferShareBean;
|
||||
import com.netease.yunxin.kit.chatkit.ui.model.UserAlbumBean1;
|
||||
@@ -163,10 +164,13 @@ import com.netease.yunxin.kit.chatkit.ui.view.message.audio.ChatMessageAudioCont
|
||||
import com.netease.yunxin.kit.chatkit.ui.view.popmenu.ChatPopMenu;
|
||||
import com.netease.yunxin.kit.chatkit.ui.view.popmenu.IChatPopMenuClickListener;
|
||||
import com.netease.yunxin.kit.chatkit.utils.SendMediaHelper;
|
||||
import com.netease.yunxin.kit.common.ui.action.ActionItem;
|
||||
import com.netease.yunxin.kit.common.ui.dialog.ChoiceListener;
|
||||
import com.netease.yunxin.kit.common.ui.dialog.CommonChoiceDialog;
|
||||
import com.netease.yunxin.kit.common.ui.dialog.ListAlertDialog;
|
||||
import com.netease.yunxin.kit.common.ui.fragments.BaseFragment;
|
||||
import com.netease.yunxin.kit.common.ui.utils.ToastX;
|
||||
import com.netease.yunxin.kit.common.ui.viewholder.BaseBean;
|
||||
import com.netease.yunxin.kit.common.ui.viewmodel.FetchResult;
|
||||
import com.netease.yunxin.kit.common.ui.viewmodel.LoadStatus;
|
||||
import com.netease.yunxin.kit.common.ui.widgets.BackTitleBar;
|
||||
@@ -296,6 +300,7 @@ public abstract class ChatBaseFragment extends BaseFragment {
|
||||
public boolean isGuanFang;
|
||||
|
||||
public int isManage = 0;
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(
|
||||
@@ -852,12 +857,8 @@ public abstract class ChatBaseFragment extends BaseFragment {
|
||||
showDialogBlack(getString(R.string.no_to_black_hongbao_tv));
|
||||
return;
|
||||
}
|
||||
checkCanSendRed(false,null);
|
||||
|
||||
Intent intent = new Intent();
|
||||
intent.setClassName(getContext(), "com.hbl.lewan.redpack.SendRedPacketActivity");
|
||||
intent.putExtra("receiverUid", sessionID);
|
||||
intent.putExtra("isGroup", sessionType != SessionTypeEnum.P2P);
|
||||
startActivityForResult(intent, 456);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -975,6 +976,75 @@ public abstract class ChatBaseFragment extends BaseFragment {
|
||||
return sessionType;
|
||||
}
|
||||
};
|
||||
private void checkCanSendRed(boolean isZhuanShu,UserInfo userInfo){
|
||||
|
||||
Api.getInstance().groupSwitches(sessionID)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new BaseObserver<Result<List< SwitchGroupBean >>>() {
|
||||
@Override
|
||||
public void onSuccess(Result<List<SwitchGroupBean>> feedbackResp) {
|
||||
if(getSwitchValue(feedbackResp.data)){
|
||||
toNextSendGroup(isZhuanShu,userInfo);
|
||||
}else{
|
||||
// ToastX.showShortToast("无此权限,请联系管理员");
|
||||
ActionConfirmDialog actionDialog = new ActionConfirmDialog(getActivity(),
|
||||
"无此权限,请联系管理员", false);
|
||||
actionDialog.setOnToActionListener(new ActionConfirmDialog.OnToActionListener() {
|
||||
@Override
|
||||
public void toSumbit() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toCancel() {
|
||||
|
||||
}
|
||||
});
|
||||
actionDialog.show();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int code, String msg) {
|
||||
ToastX.showShortToast(msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
public boolean getSwitchValue(List< SwitchGroupBean > switchGroupBeans) {
|
||||
if (switchGroupBeans != null && switchGroupBeans.size() > 0) {
|
||||
boolean isIn = false;
|
||||
for (SwitchGroupBean s : switchGroupBeans) {
|
||||
if (IMKitClient.account().equals(s.getUserUid()+"")) {
|
||||
return s.getAllowSend() == 1;
|
||||
}
|
||||
|
||||
}
|
||||
if (!isIn) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private void toNextSendGroup(boolean isZhuanShu, UserInfo userInfo) {
|
||||
if(isZhuanShu){
|
||||
Intent intent = new Intent();
|
||||
intent.setClassName(getContext(), "com.hbl.lewan.redpack.SendRedPacketActivity");
|
||||
intent.putExtra("receiverUid", sessionID);
|
||||
intent.putExtra("isGroup", sessionType != SessionTypeEnum.P2P);
|
||||
intent.putExtra("user_Bean",userInfo);
|
||||
intent.putExtra("is_zhuanshu",true);
|
||||
startActivityForResult(intent, 456);
|
||||
}else{
|
||||
Intent intent = new Intent();
|
||||
intent.setClassName(getContext(), "com.hbl.lewan.redpack.SendRedPacketActivity");
|
||||
intent.putExtra("receiverUid", sessionID);
|
||||
intent.putExtra("isGroup", sessionType != SessionTypeEnum.P2P);
|
||||
startActivityForResult(intent, 456);
|
||||
}
|
||||
}
|
||||
|
||||
private void getUserAlbums() {
|
||||
Api.getInstance().getUserAlbums(IMKitClient.account())
|
||||
@@ -1622,21 +1692,21 @@ public abstract class ChatBaseFragment extends BaseFragment {
|
||||
chatView.getMessageListView().getLocationOnScreen(location);
|
||||
if ((sessionType == SessionTypeEnum.SUPER_TEAM || sessionType == SessionTypeEnum.Team)) {
|
||||
|
||||
NIMClient.getService(TeamService.class).queryTeamMember(sessionID,messageBean.getMessageData().getFromUser().getAccount()).setCallback(new RequestCallback<TeamMember>() {
|
||||
NIMClient.getService(TeamService.class).queryTeamMember(sessionID, messageBean.getMessageData().getFromUser().getAccount()).setCallback(new RequestCallback<TeamMember>() {
|
||||
@Override
|
||||
public void onSuccess(TeamMember members) {
|
||||
// Log.i("LAILIAOLIAO","LAILIAOLIAO 乱七八糟:"+GsonUtils.beanToJSONString(members));
|
||||
if(members!=null){
|
||||
if(members.getType() == TeamMemberType.Manager){
|
||||
popMenu.show(view, messageBean, location[1],isManage,2,members.isMute());
|
||||
if (members != null) {
|
||||
if (members.getType() == TeamMemberType.Manager) {
|
||||
popMenu.show(view, messageBean, location[1], isManage, 2, members.isMute());
|
||||
|
||||
}else if(members.getType() == TeamMemberType.Owner){
|
||||
popMenu.show(view, messageBean, location[1],isManage,1,members.isMute());
|
||||
}else {
|
||||
popMenu.show(view, messageBean, location[1],isManage,0,members.isMute());
|
||||
} else if (members.getType() == TeamMemberType.Owner) {
|
||||
popMenu.show(view, messageBean, location[1], isManage, 1, members.isMute());
|
||||
} else {
|
||||
popMenu.show(view, messageBean, location[1], isManage, 0, members.isMute());
|
||||
}
|
||||
}else{
|
||||
popMenu.show(view, messageBean, location[1],isManage,0,members.isMute());
|
||||
} else {
|
||||
popMenu.show(view, messageBean, location[1], isManage, 0, members.isMute());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1657,8 +1727,8 @@ public abstract class ChatBaseFragment extends BaseFragment {
|
||||
});
|
||||
|
||||
|
||||
}else{
|
||||
popMenu.show(view, messageBean, location[1],0,0,false);
|
||||
} else {
|
||||
popMenu.show(view, messageBean, location[1], 0, 0, false);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1697,7 +1767,7 @@ public abstract class ChatBaseFragment extends BaseFragment {
|
||||
//如果是群,且群不允许群内添加好友 当前登录用户不是群主,以及userid 也不是群主 直接跳过
|
||||
if ((sessionType == SessionTypeEnum.SUPER_TEAM || sessionType == SessionTypeEnum.Team)) {
|
||||
|
||||
if(teamInfo!=null&&isManage>0){
|
||||
if (teamInfo != null && isManage > 0) {
|
||||
XKitRouter.withKey(getUserInfoRoutePath())
|
||||
.withContext(view.getContext())
|
||||
.withParam(
|
||||
@@ -1778,23 +1848,8 @@ public abstract class ChatBaseFragment extends BaseFragment {
|
||||
public boolean onUserIconLongClick(View view, int position, ChatMessageBean messageBean) {
|
||||
if (delegateListener == null
|
||||
|| !delegateListener.onUserIconLongClick(view, position, messageBean)) {
|
||||
if (aitManager != null && sessionType == SessionTypeEnum.Team) {
|
||||
String account = messageBean.getMessageData().getMessage().getFromAccount();
|
||||
UserInfo userInfo = messageBean.getMessageData().getFromUser();
|
||||
if (!TextUtils.equals(account, IMKitClient.account())) {
|
||||
if (userInfo == null) {
|
||||
userInfo = new UserInfo(account, account, null);
|
||||
}
|
||||
String name = MessageHelper.getTeamAitName(aitManager.getTid(), userInfo);
|
||||
if (TextUtils.isEmpty(name)) {
|
||||
if (messageBean.getMessageData().getFromUser() != null) {
|
||||
name = messageBean.getMessageData().getFromUser().getName();
|
||||
} else {
|
||||
name = account;
|
||||
}
|
||||
}
|
||||
aitManager.insertReplyAit(account, name);
|
||||
}
|
||||
if ( sessionType == SessionTypeEnum.Team) {
|
||||
showStickDialog(view, position, messageBean);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
@@ -1915,6 +1970,60 @@ public abstract class ChatBaseFragment extends BaseFragment {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
private void showStickDialog(View view, int position, ChatMessageBean messageBean) {
|
||||
|
||||
ListAlertDialog alertDialog = new ListAlertDialog();
|
||||
alertDialog.setContent(generateDialogContent(messageBean));
|
||||
alertDialog.setTitleVisibility(View.GONE);
|
||||
alertDialog.setDialogWidth(getResources().getDimension(R.dimen.alert_dialog_width));
|
||||
alertDialog.setItemClickListener(
|
||||
action -> {
|
||||
if (TextUtils.equals(action, "at_user")) {
|
||||
|
||||
String account = messageBean.getMessageData().getMessage().getFromAccount();
|
||||
UserInfo userInfo = messageBean.getMessageData().getFromUser();
|
||||
if (!TextUtils.equals(account, IMKitClient.account())) {
|
||||
if (userInfo == null) {
|
||||
userInfo = new UserInfo(account, account, null);
|
||||
}
|
||||
String name = MessageHelper.getTeamAitName(aitManager.getTid(), userInfo);
|
||||
if (TextUtils.isEmpty(name)) {
|
||||
if (messageBean.getMessageData().getFromUser() != null) {
|
||||
name = messageBean.getMessageData().getFromUser().getName();
|
||||
} else {
|
||||
name = account;
|
||||
}
|
||||
}
|
||||
aitManager.insertReplyAit(account, name);
|
||||
}
|
||||
} else if (TextUtils.equals(action, "zhuanshu_hb")) {
|
||||
checkCanSendRed(true,messageBean.getMessageData().getFromUser());
|
||||
|
||||
}
|
||||
alertDialog.dismiss();
|
||||
});
|
||||
alertDialog.show(getParentFragmentManager());
|
||||
|
||||
}
|
||||
|
||||
|
||||
protected List<ActionItem> generateDialogContent(ChatMessageBean messageBean) {
|
||||
List<ActionItem> contentList = new ArrayList<>();
|
||||
if(aitManager != null) {
|
||||
ActionItem stick =
|
||||
new ActionItem("at_user",
|
||||
0, R.string.at_ta_txt);
|
||||
contentList.add(stick);
|
||||
}
|
||||
ActionItem delete =
|
||||
new ActionItem("zhuanshu_hb", 0, R.string.zhuanshuhongbao_txt);
|
||||
contentList.add(delete);
|
||||
return contentList;
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected void loadReplyInfo(String uuid, boolean addAit) {
|
||||
if (TextUtils.isEmpty(uuid)) {
|
||||
return;
|
||||
@@ -2421,13 +2530,13 @@ public abstract class ChatBaseFragment extends BaseFragment {
|
||||
|
||||
@Override
|
||||
public boolean onJinYan(ChatMessageBean messageInfo) {
|
||||
toJinyan(messageInfo,true);
|
||||
toJinyan(messageInfo, true);
|
||||
return IChatPopMenuClickListener.super.onJinYan(messageInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onJieChuJinYan(ChatMessageBean messageInfo) {
|
||||
toJinyan(messageInfo,false);
|
||||
toJinyan(messageInfo, false);
|
||||
|
||||
return IChatPopMenuClickListener.super.onJieChuJinYan(messageInfo);
|
||||
}
|
||||
@@ -2436,7 +2545,7 @@ public abstract class ChatBaseFragment extends BaseFragment {
|
||||
private void toJinyan(ChatMessageBean messageInfo, boolean isMute) {
|
||||
TeamService v2TeamService = NIMClient.getService(TeamService.class);
|
||||
|
||||
v2TeamService.muteTeamMember(sessionID, messageInfo.getMessageData().getFromUser().getAccount(),isMute);
|
||||
v2TeamService.muteTeamMember(sessionID, messageInfo.getMessageData().getFromUser().getAccount(), isMute);
|
||||
|
||||
}
|
||||
|
||||
@@ -2568,7 +2677,6 @@ public abstract class ChatBaseFragment extends BaseFragment {
|
||||
result -> onForwardMessage(result, SessionTypeEnum.Team));
|
||||
|
||||
|
||||
|
||||
forwardTeamLauncher1 =
|
||||
registerForActivityResult(
|
||||
new ActivityResultContracts.StartActivityForResult(),
|
||||
@@ -2662,23 +2770,23 @@ public abstract class ChatBaseFragment extends BaseFragment {
|
||||
LinearLayoutManager layoutManager = (LinearLayoutManager) chatView.getMessageListView().getLayoutManager();
|
||||
int lastPosition = layoutManager.findLastCompletelyVisibleItemPosition();
|
||||
/**当我滑动到了上面 有新消息进来 不要顶上来 只有停留在顶部的时候才自动滑动到底部*/
|
||||
if (lastPosition==chatView.getMessageListView().getMessageAdapter().getMessageList().size()-1) {
|
||||
if (lastPosition == chatView.getMessageListView().getMessageAdapter().getMessageList().size() - 1) {
|
||||
chatView.appendMessageList(listFetchResult.getData());
|
||||
}else{
|
||||
chatView.appendMessageList(listFetchResult.getData(),false);
|
||||
} else {
|
||||
chatView.appendMessageList(listFetchResult.getData(), false);
|
||||
}
|
||||
|
||||
/**
|
||||
* 群聊禁言和解除禁言实时更新底部UI
|
||||
*/
|
||||
if(sessionType == SessionTypeEnum.Team||sessionType == SessionTypeEnum.SUPER_TEAM) {
|
||||
if (sessionType == SessionTypeEnum.Team || sessionType == SessionTypeEnum.SUPER_TEAM) {
|
||||
for (ChatMessageBean chatMessageBean : listFetchResult.getData()) {
|
||||
if (chatMessageBean.getMessageData().getMessage().getAttachment() instanceof NotificationAttachment) {
|
||||
NotificationAttachment attachment =
|
||||
(NotificationAttachment) chatMessageBean.getMessageData().getMessage().getAttachment();
|
||||
if(attachment.getType() == NotificationType.MuteTeamMember||attachment.getType() ==NotificationType.SUPER_TEAM_MUTE_TLIST){
|
||||
MuteMemberAttachment muteMemberAttachment = (MuteMemberAttachment) attachment;
|
||||
if(muteMemberAttachment.getTargets().contains(IMKitClient.account())){
|
||||
if (attachment.getType() == NotificationType.MuteTeamMember || attachment.getType() == NotificationType.SUPER_TEAM_MUTE_TLIST) {
|
||||
MuteMemberAttachment muteMemberAttachment = (MuteMemberAttachment) attachment;
|
||||
if (muteMemberAttachment.getTargets().contains(IMKitClient.account())) {
|
||||
RxBus.getInstance().post(-99999);
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 11 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 11 KiB |
@@ -36,6 +36,8 @@
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="62dp"
|
||||
android:paddingStart="@dimen/dimen_20_dp"
|
||||
android:paddingEnd="@dimen/dimen_20_dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:gravity="center_vertical"
|
||||
|
||||
@@ -5,8 +5,9 @@
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="218dp"
|
||||
android:layout_height="92dp"
|
||||
android:layout_height="104dp"
|
||||
android:id="@+id/big_ly"
|
||||
android:background="@drawable/zhuanzhang_f_g"
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
@@ -16,7 +17,7 @@
|
||||
android:gravity="center_vertical"
|
||||
android:lines="1"
|
||||
android:ellipsize="end"
|
||||
android:visibility="gone"
|
||||
android:visibility="visible"
|
||||
android:id="@+id/item_title_tv"
|
||||
android:text="来自 黄黄不是嬛嬛 的赠送"
|
||||
android:textColor="#ffffffff"
|
||||
@@ -30,7 +31,6 @@
|
||||
android:layout_marginRight="@dimen/dimen_10_dp"
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
android:layout_marginTop="@dimen/dimen_10_dp"
|
||||
android:id="@+id/item_number_tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -54,9 +54,8 @@
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="@dimen/dimen_24_dp"
|
||||
android:text="@string/jinbizhuanzhang_des_txt"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical"
|
||||
android:id="@+id/mingpian_tv"
|
||||
android:layout_marginLeft="@dimen/dimen_10_dp"
|
||||
|
||||
@@ -218,7 +218,7 @@
|
||||
<string name="zidingyi_txt">Custom</string>
|
||||
<string name="hongbao_txt">Points Bonus</string>
|
||||
<string name="zhuanzhang_txtq">Points Give away</string>
|
||||
<string name="zhuanzhang_cash_txtq">Cash Give away</string>
|
||||
<string name="zhuanzhang_cash_txtq">转账</string>
|
||||
<string name="mingpian_txt">Business card</string>
|
||||
<string name="fasongweizhi_txt">Sending location</string>
|
||||
<string name="sharealbums_txt">Share Album</string>
|
||||
@@ -243,7 +243,7 @@
|
||||
<string name="fun_chat_audio_record_max_time_tips">Recording will stop after %d \"</string>
|
||||
<string name="fun_chat_input_hint_tips">Please enter the chat content</string>
|
||||
<string name="fun_chat_audio_record_hint">Click to start recording</string>
|
||||
<string name="zhuangzhang_chat_txt">[Give away]</string>
|
||||
<string name="zhuangzhang_chat_txt">[转账]</string>
|
||||
<string name="jinbizhuanzhang_des_txt">Taomenggo chat Cash Give away</string>
|
||||
<string name="xiangshuizhuanzhang_txt">Give away to %s</string>
|
||||
<string name="xiangshuizhuanzhang1_txt">Give away from %s</string>
|
||||
@@ -332,5 +332,7 @@
|
||||
<string name="chat_message_forward_to1">Forward to %s and other %d people</string>
|
||||
<string name="chat_message_forward_to2">Forward to %s and other %d group</string>
|
||||
<string name="ninyibeijinyan_txt">您已被禁言</string>
|
||||
<string name="zhuanshuhongbao_txt">专属红包</string>
|
||||
<string name="at_ta_txt">\@TA</string>
|
||||
|
||||
</resources>
|
||||
@@ -218,7 +218,7 @@
|
||||
<string name="zidingyi_txt">カスタマイズ済み</string>
|
||||
<string name="hongbao_txt">ポイントボーナス</string>
|
||||
<string name="zhuanzhang_txtq">ポイント贈与</string>
|
||||
<string name="zhuanzhang_cash_txtq">Cash転送</string>
|
||||
<string name="zhuanzhang_cash_txtq">转账</string>
|
||||
<string name="mingpian_txt">名刺</string>
|
||||
<string name="fasongweizhi_txt">送信場所</string>
|
||||
<string name="sharealbums_txt">アルバムを共有</string>
|
||||
@@ -244,7 +244,7 @@
|
||||
<string name="fun_chat_input_hint_tips">チャットの内容を入力してください</string>
|
||||
|
||||
<string name="fun_chat_audio_record_hint">クリックして録音を開始します</string>
|
||||
<string name="zhuangzhang_chat_txt">[転送]</string>
|
||||
<string name="zhuangzhang_chat_txt">[转账]</string>
|
||||
<string name="jinbizhuanzhang_des_txt">桃蒙郷Cash転送</string>
|
||||
<string name="xiangshuizhuanzhang_txt">%s に転送</string>
|
||||
<string name="xiangshuizhuanzhang1_txt">%s からの転送</string>
|
||||
@@ -333,5 +333,7 @@
|
||||
<string name="chat_message_forward_to1">轉發給:%s等%d人</string>
|
||||
<string name="chat_message_forward_to2">轉發給:%s等%d群</string>
|
||||
<string name="ninyibeijinyan_txt">您已被禁言</string>
|
||||
<string name="zhuanshuhongbao_txt">专属红包</string>
|
||||
<string name="at_ta_txt">\@TA</string>
|
||||
|
||||
</resources>
|
||||
@@ -217,7 +217,7 @@
|
||||
<string name="zidingyi_txt">自定义</string>
|
||||
<string name="hongbao_txt">红包</string>
|
||||
<string name="zhuanzhang_txtq">积分赠送</string>
|
||||
<string name="zhuanzhang_cash_txtq">Cash 赠送</string>
|
||||
<string name="zhuanzhang_cash_txtq">转账</string>
|
||||
<string name="mingpian_txt">名片</string>
|
||||
<string name="fasongweizhi_txt">发送位置</string>
|
||||
<string name="sharealbums_txt">分享相册</string>
|
||||
@@ -243,13 +243,13 @@
|
||||
<string name="fun_chat_audio_record_max_time_tips">%d \" 后将停止录音</string>
|
||||
<string name="fun_chat_input_hint_tips">请输入聊天内容</string>
|
||||
<string name="fun_chat_audio_record_hint">点击开始录音</string>
|
||||
<string name="zhuangzhang_chat_txt">[赠送]</string>
|
||||
<string name="jinbizhuanzhang_des_txt">MM Cash赠送</string>
|
||||
<string name="xiangshuizhuanzhang_txt">向 %s 赠送</string>
|
||||
<string name="xiangshuizhuanzhang1_txt">来自 %s 的赠送</string>
|
||||
<string name="zhuangzhang_chat_txt">[转账]</string>
|
||||
<string name="jinbizhuanzhang_des_txt">转账</string>
|
||||
<string name="xiangshuizhuanzhang_txt">向 %s 转账</string>
|
||||
<string name="xiangshuizhuanzhang1_txt">来自 %s 的转账</string>
|
||||
<string name="jinbizhuanzhang_des_txt1">MM 礼品积分赠送</string>
|
||||
<string name="remarks_hit_txt">恭喜发财,大吉大利</string>
|
||||
<string name="daishoukuan_txt1">待領取</string>
|
||||
<string name="daishoukuan_txt1">待领取</string>
|
||||
<string name="received_txt1">已领取</string>
|
||||
<string name="yituihuan_txt">已退还</string>
|
||||
<string name="received_txt2">已领取</string>
|
||||
@@ -333,5 +333,7 @@
|
||||
<string name="chat_message_forward_to1">转发给:%s等%d人</string>
|
||||
<string name="chat_message_forward_to2">转发给:%s等%d群</string>
|
||||
<string name="ninyibeijinyan_txt">您已被禁言</string>
|
||||
<string name="zhuanshuhongbao_txt">专属红包</string>
|
||||
<string name="at_ta_txt">\@TA</string>
|
||||
|
||||
</resources>
|
||||
@@ -87,7 +87,7 @@
|
||||
<color name="ps_color_0077F6">#0077F6</color>
|
||||
<color name="ps_color_E4E4E4">#E4E4E4</color>
|
||||
<color name="color_6b3689">#6B3689</color>
|
||||
<color name="color_ffcad8">#ffcad8</color>
|
||||
<color name="color_ffcad8">#8DE776</color>
|
||||
<color name="color_f4f4f4">#f4f4f4</color>
|
||||
<color name="color_fcfcfc">#fcfcfc</color>
|
||||
<color name="color_7f7b81">#7F7B81</color>
|
||||
|
||||
4
chatkit-ui/src/main/res/values/dimens.xml
Normal file
4
chatkit-ui/src/main/res/values/dimens.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<dimen name="alert_dialog_width">188dp</dimen>
|
||||
</resources>
|
||||
@@ -217,7 +217,7 @@
|
||||
<string name="zidingyi_txt">自訂</string>
|
||||
<string name="hongbao_txt">紅包</string>
|
||||
<string name="zhuanzhang_txtq">積分贈送</string>
|
||||
<string name="zhuanzhang_cash_txtq">Cash贈送</string>
|
||||
<string name="zhuanzhang_cash_txtq">转账</string>
|
||||
<string name="mingpian_txt">名片</string>
|
||||
<string name="fasongweizhi_txt">發送位置</string>
|
||||
<string name="sharealbums_txt">分享相簿</string>
|
||||
@@ -243,21 +243,21 @@
|
||||
<string name="fun_chat_input_hint_tips">請輸入聊天內容</string>
|
||||
|
||||
<string name="fun_chat_audio_record_hint">點擊開始錄音</string>
|
||||
<string name="zhuangzhang_chat_txt">[贈送]</string>
|
||||
<string name="jinbizhuanzhang_des_txt">MM Cash贈送</string>
|
||||
<string name="xiangshuizhuanzhang_txt">向 %s 贈送</string>
|
||||
<string name="xiangshuizhuanzhang1_txt">來自 %s 的贈送</string>
|
||||
<string name="zhuangzhang_chat_txt">[转账]</string>
|
||||
<string name="jinbizhuanzhang_des_txt">转账</string>
|
||||
<string name="xiangshuizhuanzhang_txt">向 %s 转账</string>
|
||||
<string name="xiangshuizhuanzhang1_txt">来自 %s 的转账</string>
|
||||
<string name="jinbizhuanzhang_des_txt1">MM 禮品積分贈送</string>
|
||||
<string name="remarks_hit_txt">恭喜發財,大吉大利</string>
|
||||
<string name="daishoukuan_txt1">待領取</string>
|
||||
<string name="received_txt1">已領取</string>
|
||||
<string name="yituihuan_txt">已退還</string>
|
||||
<string name="received_txt2">已領取</string>
|
||||
<string name="yituihuan_txt1">已退還</string>
|
||||
<string name="yiguoqi_txt1">已過期</string>
|
||||
<string name="hongbao_des_txt">紅包</string>
|
||||
<string name="daishoukuan_txt1">待领取</string>
|
||||
<string name="received_txt1">已领取</string>
|
||||
<string name="yituihuan_txt">已退还</string>
|
||||
<string name="received_txt2">已领取</string>
|
||||
<string name="yituihuan_txt1">已退还</string>
|
||||
<string name="yiguoqi_txt1">已过期</string>
|
||||
<string name="hongbao_des_txt">红包</string>
|
||||
<string name="hongbao_des_txt1">MM 禮品積分紅包</string>
|
||||
<string name="hongbao_chat_txt">[紅包]</string>
|
||||
<string name="hongbao_chat_txt">[红包]</string>
|
||||
<string name="dailinqu_txt1">待領取</string>
|
||||
<string name="look_get_info_red_txt">查看領取詳情</string>
|
||||
<string name="fachudehongbao_txt">%s 發出的紅包</string>
|
||||
@@ -292,7 +292,7 @@
|
||||
<string name="jinjinlianxi_txt">最近聯繫</string>
|
||||
<string name="tebieguanxin_txt">特別關心</string>
|
||||
<string name="dailinqu_txt2">點擊領取</string>
|
||||
<string name="no_to_black_zhuanzhang_tv">不能向黑名單用戶贈送</string>
|
||||
<string name="no_to_black_zhuanzhang_tv">不能向黑名单用户转账</string>
|
||||
<string name="no_to_black_hongbao_tv">無法向黑名單用戶發送紅包</string>
|
||||
<string name="no_to_black_mingpian_tv">無法向黑名單用戶發送名片</string>
|
||||
<string name="no_to_black_chat_tv">屏蔽中,恢復對話請取消屏蔽</string>
|
||||
@@ -332,4 +332,6 @@
|
||||
<string name="chat_message_forward_to1">轉發給:%s等%d人</string>
|
||||
<string name="chat_message_forward_to2">轉發給:%s等%d群</string>
|
||||
<string name="ninyibeijinyan_txt">您已被禁言</string>
|
||||
<string name="zhuanshuhongbao_txt">专属红包</string>
|
||||
<string name="at_ta_txt">\@TA</string>
|
||||
</resources>
|
||||
Reference in New Issue
Block a user