修復一些測試反饋問題
This commit is contained in:
parent
9795d46941
commit
19ab654342
@ -296,63 +296,27 @@ public class ChatMessageFragment extends AbsConversationFragment {
|
||||
public void onViewClicks() {
|
||||
if (call.getTag() != null) {
|
||||
ToastUtil.show(R.string.toast_call_not_unlock);
|
||||
AppManager.runDebugCode(() -> {
|
||||
new TipsDialog(mContext)
|
||||
.setTitle("测试模式,是否强行拨打")
|
||||
.setApplyText("确定")
|
||||
.setCancelText("取消")
|
||||
.setOnDialogClickListener(new OnDialogClickListener() {
|
||||
@Override
|
||||
public void onApply(Dialog dialog) {
|
||||
super.onApply(dialog);
|
||||
callVideo();
|
||||
}
|
||||
}).showDialog();
|
||||
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (CallClientManager.getManager().isCalling()) {
|
||||
ToastUtil.show(R.string.now_call_tips);
|
||||
return;
|
||||
}
|
||||
|
||||
MsgCheckUtils.checkAuth(mContext, targetId, new OnSendMessageListener() {
|
||||
@Override
|
||||
public void onSuccess(String token, SendConsumeBean bean) {
|
||||
super.onSuccess(token, bean);
|
||||
MsgCheckUtils.checkPrice(mContext, targetId, new OnItemClickListener<MessageConsumeConfigBean>() {
|
||||
@Override
|
||||
public void onItemClick(MessageConsumeConfigBean configBean, int position) {
|
||||
new BottomListDialog(mContext).setSelect(new OnItemClickListener<String>() {
|
||||
@Override
|
||||
public void onItemClick(String bean, int position) {
|
||||
CallClientManager.getManager().checkMoney(targetId, true, new OnSendMessageListener() {
|
||||
@Override
|
||||
public void onSuccess(String token, SendConsumeBean bean) {
|
||||
super.onSuccess(token, bean);
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("model", CallClientManager.VIDEO_CALL);
|
||||
bundle.putString("targetId", targetId);
|
||||
bundle.putString("callId", targetId);
|
||||
RouteManager.forwardActivity(RouteManager.ACTIVITY_CALL_VIDEO, bundle);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int status, String msg) {
|
||||
super.onError(status, msg);
|
||||
new TipsDialog(mContext)
|
||||
.setTitle(WordUtil.getNewString(R.string.not_money))
|
||||
.setContent(String.format(WordUtil.getNewString(R.string.not_money_video_tips), configBean.getVideoPrice()))
|
||||
.setCancelText(WordUtil.getNewString(R.string.dialog_cancel_tip))
|
||||
.setApplyText(WordUtil.getNewString(R.string.dialog_to_money_tip))
|
||||
.showDialog();
|
||||
}
|
||||
});
|
||||
}
|
||||
}).setStrings(Collections.singletonList(String.format(WordUtil.getNewString(R.string.chat_video_tips), configBean.getVideoPrice())))
|
||||
.showDialog();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int status, String msg) {
|
||||
super.onError(status, msg);
|
||||
if (status == 1) {
|
||||
sendAuthRequest();
|
||||
} else if (!StringUtil.isEmpty(msg)) {
|
||||
ToastUtil.show(msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
callVideo();
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(call, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@ -360,64 +324,27 @@ public class ChatMessageFragment extends AbsConversationFragment {
|
||||
public void onViewClicks() {
|
||||
if (call.getTag() != null) {
|
||||
ToastUtil.show(R.string.toast_call_not_unlock);
|
||||
AppManager.runDebugCode(() -> {
|
||||
new TipsDialog(mContext)
|
||||
.setTitle("测试模式,是否强行拨打")
|
||||
.setApplyText("确定")
|
||||
.setCancelText("取消")
|
||||
.setOnDialogClickListener(new OnDialogClickListener() {
|
||||
@Override
|
||||
public void onApply(Dialog dialog) {
|
||||
super.onApply(dialog);
|
||||
callAudio();
|
||||
}
|
||||
}).showDialog();
|
||||
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (CallClientManager.getManager().isCalling() || isFloatWindows()) {
|
||||
ToastUtil.show(R.string.now_call_tips);
|
||||
return;
|
||||
}
|
||||
|
||||
MsgCheckUtils.checkAuth(mContext, targetId, new OnSendMessageListener() {
|
||||
@Override
|
||||
public void onSuccess(String token, SendConsumeBean bean) {
|
||||
super.onSuccess(token, bean);
|
||||
MsgCheckUtils.checkPrice(mContext, targetId, new OnItemClickListener<MessageConsumeConfigBean>() {
|
||||
@Override
|
||||
public void onItemClick(MessageConsumeConfigBean configBean, int position) {
|
||||
new BottomListDialog(mContext).setSelect(new OnItemClickListener<String>() {
|
||||
@Override
|
||||
public void onItemClick(String bean, int position) {
|
||||
CallClientManager.getManager().checkMoney(targetId, false, new OnSendMessageListener() {
|
||||
@Override
|
||||
public void onSuccess(String token, SendConsumeBean bean) {
|
||||
super.onSuccess(token, bean);
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("model", CallClientManager.AUDIO_CALL);
|
||||
bundle.putString("targetId", targetId);
|
||||
bundle.putString("callId", targetId);
|
||||
RouteManager.forwardActivity(RouteManager.ACTIVITY_CALL_AUDIO, bundle);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int status, String msg) {
|
||||
super.onError(status, msg);
|
||||
new TipsDialog(mContext)
|
||||
.setTitle(WordUtil.getNewString(R.string.not_money))
|
||||
.setContent(String.format(WordUtil.getNewString(R.string.not_money_audio_tips), configBean.getMp3Price()))
|
||||
.setCancelText(WordUtil.getNewString(R.string.dialog_cancel_tip))
|
||||
.setApplyText(WordUtil.getNewString(R.string.dialog_to_money_tip))
|
||||
.showDialog();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}).setStrings(Collections.singletonList(String.format(WordUtil.getNewString(R.string.chat_audio_tips), configBean.getMp3Price())))
|
||||
.showDialog();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int status, String msg) {
|
||||
super.onError(status, msg);
|
||||
if (status == 1) {
|
||||
sendAuthRequest();
|
||||
} else if (!StringUtil.isEmpty(msg)) {
|
||||
ToastUtil.show(msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
callAudio();
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(img, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@ -690,11 +617,6 @@ public class ChatMessageFragment extends AbsConversationFragment {
|
||||
UserInfo info = new UserInfo(data.getUser().getId() + "", data.getUser().getUserNicename(), Uri.parse(data.getUser().getAvatar()));
|
||||
info.setExtra(JSONObject.toJSONString(data));
|
||||
RongUserInfoManager.getInstance().refreshUserInfoCache(info);
|
||||
AppManager.runDebugCode(() -> {
|
||||
call.setTag(null);
|
||||
call.setImageResource(R.mipmap.ic_msg_call);
|
||||
video.setImageResource(R.mipmap.ic_msg_video);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -851,7 +773,111 @@ public class ChatMessageFragment extends AbsConversationFragment {
|
||||
}
|
||||
});
|
||||
}
|
||||
private void callVideo(){
|
||||
MsgCheckUtils.checkAuth(mContext, targetId, new OnSendMessageListener() {
|
||||
@Override
|
||||
public void onSuccess(String token, SendConsumeBean bean) {
|
||||
super.onSuccess(token, bean);
|
||||
MsgCheckUtils.checkPrice(mContext, targetId, new OnItemClickListener<MessageConsumeConfigBean>() {
|
||||
@Override
|
||||
public void onItemClick(MessageConsumeConfigBean configBean, int position) {
|
||||
new BottomListDialog(mContext).setSelect(new OnItemClickListener<String>() {
|
||||
@Override
|
||||
public void onItemClick(String bean, int position) {
|
||||
CallClientManager.getManager().checkMoney(targetId, true, new OnSendMessageListener() {
|
||||
@Override
|
||||
public void onSuccess(String token, SendConsumeBean bean) {
|
||||
super.onSuccess(token, bean);
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("model", CallClientManager.VIDEO_CALL);
|
||||
bundle.putString("targetId", targetId);
|
||||
bundle.putString("callId", targetId);
|
||||
RouteManager.forwardActivity(RouteManager.ACTIVITY_CALL_VIDEO, bundle);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int status, String msg) {
|
||||
super.onError(status, msg);
|
||||
new TipsDialog(mContext)
|
||||
.setTitle(WordUtil.getNewString(R.string.not_money))
|
||||
.setContent(String.format(WordUtil.getNewString(R.string.not_money_video_tips), configBean.getVideoPrice()))
|
||||
.setCancelText(WordUtil.getNewString(R.string.dialog_cancel_tip))
|
||||
.setApplyText(WordUtil.getNewString(R.string.dialog_to_money_tip))
|
||||
.showDialog();
|
||||
}
|
||||
});
|
||||
}
|
||||
}).setStrings(Collections.singletonList(String.format(WordUtil.getNewString(R.string.chat_video_tips), configBean.getVideoPrice())))
|
||||
.showDialog();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int status, String msg) {
|
||||
super.onError(status, msg);
|
||||
if (status == 1) {
|
||||
sendAuthRequest();
|
||||
} else if (!StringUtil.isEmpty(msg)) {
|
||||
ToastUtil.show(msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
private void callAudio(){
|
||||
MsgCheckUtils.checkAuth(mContext, targetId, new OnSendMessageListener() {
|
||||
@Override
|
||||
public void onSuccess(String token, SendConsumeBean bean) {
|
||||
super.onSuccess(token, bean);
|
||||
MsgCheckUtils.checkPrice(mContext, targetId, new OnItemClickListener<MessageConsumeConfigBean>() {
|
||||
@Override
|
||||
public void onItemClick(MessageConsumeConfigBean configBean, int position) {
|
||||
new BottomListDialog(mContext).setSelect(new OnItemClickListener<String>() {
|
||||
@Override
|
||||
public void onItemClick(String bean, int position) {
|
||||
CallClientManager.getManager().checkMoney(targetId, false, new OnSendMessageListener() {
|
||||
@Override
|
||||
public void onSuccess(String token, SendConsumeBean bean) {
|
||||
super.onSuccess(token, bean);
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("model", CallClientManager.AUDIO_CALL);
|
||||
bundle.putString("targetId", targetId);
|
||||
bundle.putString("callId", targetId);
|
||||
RouteManager.forwardActivity(RouteManager.ACTIVITY_CALL_AUDIO, bundle);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int status, String msg) {
|
||||
super.onError(status, msg);
|
||||
new TipsDialog(mContext)
|
||||
.setTitle(WordUtil.getNewString(R.string.not_money))
|
||||
.setContent(String.format(WordUtil.getNewString(R.string.not_money_audio_tips), configBean.getMp3Price()))
|
||||
.setCancelText(WordUtil.getNewString(R.string.dialog_cancel_tip))
|
||||
.setApplyText(WordUtil.getNewString(R.string.dialog_to_money_tip))
|
||||
.showDialog();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}).setStrings(Collections.singletonList(String.format(WordUtil.getNewString(R.string.chat_audio_tips), configBean.getMp3Price())))
|
||||
.showDialog();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int status, String msg) {
|
||||
super.onError(status, msg);
|
||||
if (status == 1) {
|
||||
sendAuthRequest();
|
||||
} else if (!StringUtil.isEmpty(msg)) {
|
||||
ToastUtil.show(msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
@Subscribe
|
||||
public void moneyEvent(MoneyUpdateEvent event) {
|
||||
if (giftPanel != null) {
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.shayu.onetoone.activity.fragments.message;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.text.SpannableString;
|
||||
import android.view.LayoutInflater;
|
||||
@ -11,6 +12,7 @@ import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.shayu.onetoone.R;
|
||||
import com.shayu.onetoone.activity.fragments.BaseFragment;
|
||||
import com.shayu.onetoone.adapter.MsgMessageRecyclerViewAdapter;
|
||||
@ -27,6 +29,7 @@ import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
|
||||
@ -39,6 +42,7 @@ import io.rong.imkit.config.RongConfigCenter;
|
||||
import io.rong.imkit.conversationlist.model.BaseUiConversation;
|
||||
import io.rong.imkit.conversationlist.model.GatheredConversation;
|
||||
import io.rong.imkit.conversationlist.model.SingleConversation;
|
||||
import io.rong.imkit.userinfo.RongUserInfoManager;
|
||||
import io.rong.imkit.utils.RouteUtils;
|
||||
import io.rong.imkit.widget.FixedLinearLayoutManager;
|
||||
import io.rong.imkit.widget.adapter.BaseAdapter;
|
||||
@ -50,6 +54,8 @@ import io.rong.imkit.widget.refresh.listener.OnRefreshListener;
|
||||
import io.rong.imkit.widget.refresh.wrapper.RongRefreshHeader;
|
||||
import io.rong.imlib.RongIMClient;
|
||||
import io.rong.imlib.model.Conversation;
|
||||
import io.rong.imlib.model.Message;
|
||||
import io.rong.imlib.model.UserInfo;
|
||||
|
||||
/**
|
||||
* 消息-好友
|
||||
@ -99,6 +105,7 @@ public class MsgFriendFragment extends BaseFragment implements BaseAdapter.OnIte
|
||||
mList.setLayoutManager(layoutManager);
|
||||
mList.setAdapter(this.mAdapter);
|
||||
initRefreshView();
|
||||
initData();
|
||||
|
||||
}
|
||||
|
||||
@ -153,7 +160,7 @@ public class MsgFriendFragment extends BaseFragment implements BaseAdapter.OnIte
|
||||
if (page == 1) {
|
||||
list.clear();
|
||||
}
|
||||
itemBeans=data;
|
||||
itemBeans = data;
|
||||
if (data.isEmpty()) {
|
||||
mAdapter.setDataCollection(list);
|
||||
mAdapter.notifyDataSetChanged();
|
||||
@ -174,8 +181,8 @@ public class MsgFriendFragment extends BaseFragment implements BaseAdapter.OnIte
|
||||
}
|
||||
|
||||
public void getNewData(List<HomeItemBean> data) {
|
||||
if(data==null){
|
||||
page=1;
|
||||
if (data == null) {
|
||||
page = 1;
|
||||
initData();
|
||||
return;
|
||||
}
|
||||
@ -185,14 +192,21 @@ public class MsgFriendFragment extends BaseFragment implements BaseAdapter.OnIte
|
||||
RongIMClient.getInstance().getConversation(Conversation.ConversationType.PRIVATE, item.getId() + "", new RongIMClient.ResultCallback<Conversation>() {
|
||||
@Override
|
||||
public void onSuccess(Conversation conversation) {
|
||||
SingleConversation singleConversation = null;
|
||||
if (conversation == null) {
|
||||
conversation = new Conversation();
|
||||
singleConversation = setTopData(item.getUser_nicename(),
|
||||
"你们什么都没聊",
|
||||
0,
|
||||
item.getAvatar(),
|
||||
0,
|
||||
item.getId(),
|
||||
item.getSex(),
|
||||
JSONObject.toJSONString(item)
|
||||
);
|
||||
list.add(singleConversation);
|
||||
} else {
|
||||
list.add(new SingleConversation(mContext,conversation));
|
||||
}
|
||||
SingleConversation singleConversation = new SingleConversation(mContext, conversation);
|
||||
if (StringUtil.isEmpty(singleConversation.mConversationContent.toString())) {
|
||||
singleConversation.mConversationContent = new SpannableString("你们什么都没聊");
|
||||
}
|
||||
list.add(singleConversation);
|
||||
if (over) {
|
||||
mAdapter.setDataCollection(list);
|
||||
mAdapter.notifyDataSetChanged();
|
||||
@ -211,6 +225,30 @@ public class MsgFriendFragment extends BaseFragment implements BaseAdapter.OnIte
|
||||
|
||||
}
|
||||
|
||||
private SingleConversation setTopData(String title, String content, long time, String avatar, int num, int id, int sex, String exp) {
|
||||
if (StringUtil.isEmpty(content)) {
|
||||
content = "";
|
||||
}
|
||||
SingleConversation conversation = new SingleConversation(getContext(), new Conversation());
|
||||
conversation.mCore.setConversationType(Conversation.ConversationType.PRIVATE);
|
||||
conversation.mCore.setSenderUserName(title);
|
||||
conversation.mCore.setConversationTitle(title);
|
||||
conversation.mCore.setSentTime(time);
|
||||
conversation.mCore.setSentStatus(Message.SentStatus.SENT);
|
||||
conversation.mConversationContent = new SpannableString(content);
|
||||
conversation.mCore.setUnreadMessageCount(num);
|
||||
conversation.mCore.setTargetId(id + "");
|
||||
conversation.mCore.setLatestMessageExtra(exp);
|
||||
conversation.mCore.setPortraitUrl(avatar);
|
||||
UserInfo info = new UserInfo(id + "", title, Uri.parse(avatar));
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("sex", sex);
|
||||
json.put("age", -1);
|
||||
info.setExtra(json.toJSONString());
|
||||
RongUserInfoManager.getInstance().refreshUserInfoCache(info);
|
||||
return conversation;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemClick(View view, ViewHolder holder, int position) {
|
||||
if (position >= 0 && position < this.mAdapter.getData().size()) {
|
||||
@ -243,7 +281,6 @@ public class MsgFriendFragment extends BaseFragment implements BaseAdapter.OnIte
|
||||
if (event.getType() == MessageMsgBusEvent.TYPE_UPDATE_POINT) {
|
||||
/* page = 1;
|
||||
initData();*/
|
||||
getNewData(itemBeans);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -16,6 +16,7 @@ import com.shayu.onetoone.bean.GiftBean;
|
||||
import com.shayu.onetoone.bean.MessageChatGiftContent;
|
||||
import com.shayu.onetoone.bean.PurseBean;
|
||||
import com.shayu.onetoone.bean.SendConsumeBean;
|
||||
import com.shayu.onetoone.event.MessageMsgBusEvent;
|
||||
import com.shayu.onetoone.listener.OnDialogClickListener;
|
||||
import com.shayu.onetoone.listener.OnSendMessageListener;
|
||||
import com.shayu.onetoone.manager.OTONetManager;
|
||||
@ -31,10 +32,14 @@ import com.yunbao.common.dialog.AbsDialogPopupWindow;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@ -82,6 +87,7 @@ public class GiftDialog extends AbsDialogPopupWindow {
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
Bus.getOn(this);
|
||||
gifList = findViewById(R.id.gift_list);
|
||||
money = findViewById(R.id.money);
|
||||
topUpBtn = findViewById(R.id.top_up_btn);
|
||||
@ -182,17 +188,24 @@ public class GiftDialog extends AbsDialogPopupWindow {
|
||||
}
|
||||
|
||||
private void iniPurse() {
|
||||
OTONetManager.getInstance(mContext)
|
||||
.getPurseInfo(new HttpCallback<PurseBean>() {
|
||||
@Override
|
||||
public void onSuccess(PurseBean data) {
|
||||
money.setText(data.getStart() + "");
|
||||
}
|
||||
UserManager.getMoney(mContext, targetId, new OnItemClickListener<String>() {
|
||||
@Override
|
||||
public void onItemClick(String bean, int position) {
|
||||
money.setText(bean);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
Bus.getOff(this);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void event(MessageMsgBusEvent event){
|
||||
if(event.getType()==MessageMsgBusEvent.TYPE_UPDATE_STAR){
|
||||
money.setText(event.getContent());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5,14 +5,27 @@ public class MessageMsgBusEvent extends AbsBusEvent {
|
||||
public static final int TYPE_UPDATE_POINT =1;
|
||||
public static final int TYPE_UPDATE_SYSTEM =2;
|
||||
public static final int TYPE_TO_HOME_PAGE =3;
|
||||
public static final int TYPE_UPDATE_STAR =4;
|
||||
|
||||
private int num;
|
||||
private String content;
|
||||
|
||||
public MessageMsgBusEvent(int type, int num) {
|
||||
super(type);
|
||||
this.num = num;
|
||||
}
|
||||
|
||||
public MessageMsgBusEvent(int type, String content) {
|
||||
super(type);
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public MessageMsgBusEvent(int type, int num, String content) {
|
||||
super(type);
|
||||
this.num = num;
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public MessageMsgBusEvent(int type) {
|
||||
super(type);
|
||||
}
|
||||
@ -24,4 +37,14 @@ public class MessageMsgBusEvent extends AbsBusEvent {
|
||||
public void setNum(int num) {
|
||||
this.num = num;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ import io.rong.imlib.RongIMClient;
|
||||
import io.rong.imlib.model.Conversation;
|
||||
|
||||
public class CallClientManager {
|
||||
public static final String TAG="拨打控制器";
|
||||
public static final String TAG = "拨打控制器";
|
||||
public static final String VIDEO_RECEIVED_CALL = "receivedVideoCall";//接听
|
||||
public static final String VIDEO_CALL = "callVideo";//拨打
|
||||
public static final String VIDEO_FLOAT = "videoFloatWindow";//浮窗
|
||||
@ -236,7 +236,7 @@ public class CallClientManager {
|
||||
}
|
||||
|
||||
public boolean isCalling() {
|
||||
return RongCallClient.getInstance() != null && RongCallClient.getInstance().getCallSession().getSessionId() != null;
|
||||
return RongCallClient.getInstance() != null && RongCallClient.getInstance().getCallSession() != null && RongCallClient.getInstance().getCallSession().getSessionId() != null;
|
||||
}
|
||||
|
||||
public boolean isCallVideo(RongCallSession callSession) {
|
||||
@ -261,7 +261,7 @@ public class CallClientManager {
|
||||
private String targetId;
|
||||
private String sessionId;
|
||||
private boolean isCallVideo = false;
|
||||
long warningTime=-999;
|
||||
long warningTime = -999;
|
||||
long activeTime;
|
||||
|
||||
public CallTimeTask(String targetId) {
|
||||
@ -317,7 +317,7 @@ public class CallClientManager {
|
||||
handler.post(() -> {
|
||||
for (OnCallStatusListener listener : listeners.values()) {
|
||||
listener.onTime(extra);
|
||||
if (warningTime!=-999 && warningTime <= 60) {
|
||||
if (warningTime != -999 && warningTime <= 60) {
|
||||
listener.onTimeWarning(warningTime--);
|
||||
}
|
||||
}
|
||||
@ -360,7 +360,7 @@ public class CallClientManager {
|
||||
} else {
|
||||
warningTime = bean.getMp3Time();
|
||||
}
|
||||
if (warningTime!=-999 && warningTime <= 60) {
|
||||
if (warningTime != -999 && warningTime <= 60) {
|
||||
for (OnCallStatusListener listener : listeners.values()) {
|
||||
listener.onTimeWarning(warningTime);
|
||||
}
|
||||
@ -559,12 +559,12 @@ public class CallClientManager {
|
||||
* 如果对端调用{@link RongCallClient#startCall(int, boolean, Conversation.ConversationType, String, List, List, RongCallCommon.CallMediaType, String, StartCameraCallback)} 或
|
||||
* {@link RongCallClient#acceptCall(String, int, boolean, StartCameraCallback)}开始的音视频通话,则可以使用如下设置改变对端视频流的镜像显示:<br />
|
||||
* <pre class="prettyprint">
|
||||
* public void onRemoteUserJoined(String userId, RongCallCommon.CallMediaType mediaType, int userType, SurfaceView remoteVideo) {
|
||||
* if (null != remoteVideo) {
|
||||
* ((RongRTCVideoView) remoteVideo).setMirror( boolean);//观看对方视频流是否镜像处理
|
||||
* }
|
||||
* }
|
||||
* </pre>
|
||||
* public void onRemoteUserJoined(String userId, RongCallCommon.CallMediaType mediaType, int userType, SurfaceView remoteVideo) {
|
||||
* if (null != remoteVideo) {
|
||||
* ((RongRTCVideoView) remoteVideo).setMirror( boolean);//观看对方视频流是否镜像处理
|
||||
* }
|
||||
* }
|
||||
* </pre>
|
||||
*/
|
||||
@Override
|
||||
public void onRemoteUserJoined(String userId, RongCallCommon.CallMediaType mediaType, int userType, SurfaceView remoteVideo) {
|
||||
@ -610,7 +610,7 @@ public class CallClientManager {
|
||||
|
||||
@Override
|
||||
public void onError(RongCallCommon.CallErrorCode errorCode) {
|
||||
Log.e(TAG,"CallStatusListener.onError "+errorCode);
|
||||
Log.e(TAG, "CallStatusListener.onError " + errorCode);
|
||||
if (statusListener != null) {
|
||||
statusListener.onCallEnd();
|
||||
}
|
||||
|
@ -179,7 +179,6 @@ public class SendMessageManager {
|
||||
@Override
|
||||
public void onSuccess(SendConsumeBean consumeBean) {
|
||||
if (consumeBean.getCode() != 0) {
|
||||
UserManager.saveMoney(consumeBean.getMoney());
|
||||
if (consumeBean.getCode() == 503 || consumeBean.getCode()==500) {
|
||||
messageListener.onError(OnSendMessageListener.STATUS_NOT_PRICE, consumeBean.getMsg(), consumeBean);
|
||||
} else {
|
||||
@ -187,6 +186,7 @@ public class SendMessageManager {
|
||||
}
|
||||
|
||||
} else {
|
||||
UserManager.saveMoney(consumeBean.getMoney());
|
||||
String token = null;
|
||||
if (sendData.needToken) {
|
||||
token = UUID.randomUUID().toString();
|
||||
|
@ -1,10 +1,13 @@
|
||||
package com.shayu.onetoone.utils;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
import com.shayu.onetoone.bean.MessageConsumeConfigBean;
|
||||
import com.shayu.onetoone.bean.UserBean;
|
||||
import com.shayu.onetoone.dialog.TipsDialog;
|
||||
import com.shayu.onetoone.listener.OnDialogClickListener;
|
||||
import com.shayu.onetoone.listener.OnSendMessageListener;
|
||||
import com.shayu.onetoone.manager.OTONetManager;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
@ -12,7 +15,7 @@ import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.utils.AppManager;
|
||||
|
||||
public class MsgCheckUtils {
|
||||
public static void checkPrice(Context mContext,String targetId,OnItemClickListener<MessageConsumeConfigBean> listener) {
|
||||
public static void checkPrice(Context mContext, String targetId, OnItemClickListener<MessageConsumeConfigBean> listener) {
|
||||
OTONetManager.getInstance(mContext)
|
||||
.getMessageConsumeConfig(targetId, new HttpCallback<MessageConsumeConfigBean>() {
|
||||
@Override
|
||||
@ -26,21 +29,35 @@ public class MsgCheckUtils {
|
||||
}
|
||||
});
|
||||
}
|
||||
public static void checkAuth(Context mContext,String targetId,OnSendMessageListener listener) {
|
||||
|
||||
public static void checkAuth(Context mContext, String targetId, OnSendMessageListener listener) {
|
||||
OTONetManager.getInstance(mContext)
|
||||
.getTargetUserInfo(Integer.parseInt(targetId), new HttpCallback<UserBean>() {
|
||||
@Override
|
||||
public void onSuccess(UserBean data) {
|
||||
if (data.getInfo().getName_auth() == 2) {
|
||||
//listener.onSuccess("", null);
|
||||
listener.onSuccess("", null);
|
||||
} else if (data.getInfo().getName_auth() == 3) {
|
||||
listener.onError(data.getInfo().getName_auth(), "當前正在審核中,請耐心等待");
|
||||
}else {
|
||||
} else {
|
||||
listener.onError(data.getInfo().getName_auth(), "");
|
||||
}
|
||||
AppManager.runDebugCode(() -> {
|
||||
listener.onSuccess("", null);
|
||||
});
|
||||
if (data.getInfo().getName_auth() != 2) {
|
||||
AppManager.runDebugCode(() -> {
|
||||
new TipsDialog(mContext)
|
||||
.setTitle("测试模式,是否强行拨打")
|
||||
.setApplyText("确定")
|
||||
.setCancelText("取消")
|
||||
.setOnDialogClickListener(new OnDialogClickListener() {
|
||||
@Override
|
||||
public void onApply(Dialog dialog) {
|
||||
super.onApply(dialog);
|
||||
listener.onSuccess("", null);
|
||||
}
|
||||
}).showDialog();
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -11,6 +11,7 @@ import com.shayu.onetoone.bean.LabelBean;
|
||||
import com.shayu.onetoone.bean.MessageConsumeConfigBean;
|
||||
import com.shayu.onetoone.bean.PurseBean;
|
||||
import com.shayu.onetoone.bean.UserBean;
|
||||
import com.shayu.onetoone.event.MessageMsgBusEvent;
|
||||
import com.shayu.onetoone.listener.OnDialogClickListener;
|
||||
import com.shayu.onetoone.listener.OnSendMessageListener;
|
||||
import com.shayu.onetoone.manager.OTONetManager;
|
||||
@ -21,6 +22,7 @@ import com.yunbao.common.http.CommonHttpConsts;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.SpUtil;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
@ -77,6 +79,7 @@ public class UserManager {
|
||||
if (StringUtil.isEmpty(money)) {
|
||||
return;
|
||||
}
|
||||
Bus.get().post(new MessageMsgBusEvent(MessageMsgBusEvent.TYPE_UPDATE_STAR,money));
|
||||
SpUtil.setStringValue("oto_user_money", money);
|
||||
}
|
||||
|
||||
|
@ -5,6 +5,14 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<include
|
||||
android:id="@+id/rc_conversationlist_notice_container"
|
||||
layout="@layout/rc_conversationlist_notice_view"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<io.rong.imkit.widget.refresh.SmartRefreshLayout
|
||||
android:id="@+id/swipeRefreshLayout"
|
||||
@ -12,7 +20,7 @@
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
app:layout_constraintTop_toBottomOf="@+id/rc_conversationlist_notice_container">
|
||||
|
||||
<com.yanzhenjie.recyclerview.SwipeRecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
|
Loading…
x
Reference in New Issue
Block a user