修復一些測試反饋問題
This commit is contained in:
parent
9795d46941
commit
19ab654342
@ -296,63 +296,27 @@ public class ChatMessageFragment extends AbsConversationFragment {
|
|||||||
public void onViewClicks() {
|
public void onViewClicks() {
|
||||||
if (call.getTag() != null) {
|
if (call.getTag() != null) {
|
||||||
ToastUtil.show(R.string.toast_call_not_unlock);
|
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;
|
return;
|
||||||
}
|
}
|
||||||
if (CallClientManager.getManager().isCalling()) {
|
if (CallClientManager.getManager().isCalling()) {
|
||||||
ToastUtil.show(R.string.now_call_tips);
|
ToastUtil.show(R.string.now_call_tips);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
ViewClicksAntiShake.clicksAntiShake(call, new ViewClicksAntiShake.ViewClicksCallBack() {
|
ViewClicksAntiShake.clicksAntiShake(call, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||||
@ -360,64 +324,27 @@ public class ChatMessageFragment extends AbsConversationFragment {
|
|||||||
public void onViewClicks() {
|
public void onViewClicks() {
|
||||||
if (call.getTag() != null) {
|
if (call.getTag() != null) {
|
||||||
ToastUtil.show(R.string.toast_call_not_unlock);
|
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;
|
return;
|
||||||
}
|
}
|
||||||
if (CallClientManager.getManager().isCalling() || isFloatWindows()) {
|
if (CallClientManager.getManager().isCalling() || isFloatWindows()) {
|
||||||
ToastUtil.show(R.string.now_call_tips);
|
ToastUtil.show(R.string.now_call_tips);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
ViewClicksAntiShake.clicksAntiShake(img, new ViewClicksAntiShake.ViewClicksCallBack() {
|
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()));
|
UserInfo info = new UserInfo(data.getUser().getId() + "", data.getUser().getUserNicename(), Uri.parse(data.getUser().getAvatar()));
|
||||||
info.setExtra(JSONObject.toJSONString(data));
|
info.setExtra(JSONObject.toJSONString(data));
|
||||||
RongUserInfoManager.getInstance().refreshUserInfoCache(info);
|
RongUserInfoManager.getInstance().refreshUserInfoCache(info);
|
||||||
AppManager.runDebugCode(() -> {
|
|
||||||
call.setTag(null);
|
|
||||||
call.setImageResource(R.mipmap.ic_msg_call);
|
|
||||||
video.setImageResource(R.mipmap.ic_msg_video);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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
|
@Subscribe
|
||||||
public void moneyEvent(MoneyUpdateEvent event) {
|
public void moneyEvent(MoneyUpdateEvent event) {
|
||||||
if (giftPanel != null) {
|
if (giftPanel != null) {
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.shayu.onetoone.activity.fragments.message;
|
package com.shayu.onetoone.activity.fragments.message;
|
||||||
|
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.text.SpannableString;
|
import android.text.SpannableString;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
@ -11,6 +12,7 @@ import androidx.annotation.NonNull;
|
|||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.shayu.onetoone.R;
|
import com.shayu.onetoone.R;
|
||||||
import com.shayu.onetoone.activity.fragments.BaseFragment;
|
import com.shayu.onetoone.activity.fragments.BaseFragment;
|
||||||
import com.shayu.onetoone.adapter.MsgMessageRecyclerViewAdapter;
|
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.Bus;
|
||||||
import com.yunbao.common.utils.DpUtil;
|
import com.yunbao.common.utils.DpUtil;
|
||||||
import com.yunbao.common.utils.StringUtil;
|
import com.yunbao.common.utils.StringUtil;
|
||||||
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
|
|
||||||
import org.greenrobot.eventbus.Subscribe;
|
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.BaseUiConversation;
|
||||||
import io.rong.imkit.conversationlist.model.GatheredConversation;
|
import io.rong.imkit.conversationlist.model.GatheredConversation;
|
||||||
import io.rong.imkit.conversationlist.model.SingleConversation;
|
import io.rong.imkit.conversationlist.model.SingleConversation;
|
||||||
|
import io.rong.imkit.userinfo.RongUserInfoManager;
|
||||||
import io.rong.imkit.utils.RouteUtils;
|
import io.rong.imkit.utils.RouteUtils;
|
||||||
import io.rong.imkit.widget.FixedLinearLayoutManager;
|
import io.rong.imkit.widget.FixedLinearLayoutManager;
|
||||||
import io.rong.imkit.widget.adapter.BaseAdapter;
|
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.imkit.widget.refresh.wrapper.RongRefreshHeader;
|
||||||
import io.rong.imlib.RongIMClient;
|
import io.rong.imlib.RongIMClient;
|
||||||
import io.rong.imlib.model.Conversation;
|
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.setLayoutManager(layoutManager);
|
||||||
mList.setAdapter(this.mAdapter);
|
mList.setAdapter(this.mAdapter);
|
||||||
initRefreshView();
|
initRefreshView();
|
||||||
|
initData();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -153,7 +160,7 @@ public class MsgFriendFragment extends BaseFragment implements BaseAdapter.OnIte
|
|||||||
if (page == 1) {
|
if (page == 1) {
|
||||||
list.clear();
|
list.clear();
|
||||||
}
|
}
|
||||||
itemBeans=data;
|
itemBeans = data;
|
||||||
if (data.isEmpty()) {
|
if (data.isEmpty()) {
|
||||||
mAdapter.setDataCollection(list);
|
mAdapter.setDataCollection(list);
|
||||||
mAdapter.notifyDataSetChanged();
|
mAdapter.notifyDataSetChanged();
|
||||||
@ -174,8 +181,8 @@ public class MsgFriendFragment extends BaseFragment implements BaseAdapter.OnIte
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void getNewData(List<HomeItemBean> data) {
|
public void getNewData(List<HomeItemBean> data) {
|
||||||
if(data==null){
|
if (data == null) {
|
||||||
page=1;
|
page = 1;
|
||||||
initData();
|
initData();
|
||||||
return;
|
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>() {
|
RongIMClient.getInstance().getConversation(Conversation.ConversationType.PRIVATE, item.getId() + "", new RongIMClient.ResultCallback<Conversation>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(Conversation conversation) {
|
public void onSuccess(Conversation conversation) {
|
||||||
|
SingleConversation singleConversation = null;
|
||||||
if (conversation == null) {
|
if (conversation == null) {
|
||||||
conversation = new Conversation();
|
singleConversation = setTopData(item.getUser_nicename(),
|
||||||
}
|
"你们什么都没聊",
|
||||||
SingleConversation singleConversation = new SingleConversation(mContext, conversation);
|
0,
|
||||||
if (StringUtil.isEmpty(singleConversation.mConversationContent.toString())) {
|
item.getAvatar(),
|
||||||
singleConversation.mConversationContent = new SpannableString("你们什么都没聊");
|
0,
|
||||||
}
|
item.getId(),
|
||||||
|
item.getSex(),
|
||||||
|
JSONObject.toJSONString(item)
|
||||||
|
);
|
||||||
list.add(singleConversation);
|
list.add(singleConversation);
|
||||||
|
} else {
|
||||||
|
list.add(new SingleConversation(mContext,conversation));
|
||||||
|
}
|
||||||
if (over) {
|
if (over) {
|
||||||
mAdapter.setDataCollection(list);
|
mAdapter.setDataCollection(list);
|
||||||
mAdapter.notifyDataSetChanged();
|
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
|
@Override
|
||||||
public void onItemClick(View view, ViewHolder holder, int position) {
|
public void onItemClick(View view, ViewHolder holder, int position) {
|
||||||
if (position >= 0 && position < this.mAdapter.getData().size()) {
|
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) {
|
if (event.getType() == MessageMsgBusEvent.TYPE_UPDATE_POINT) {
|
||||||
/* page = 1;
|
/* page = 1;
|
||||||
initData();*/
|
initData();*/
|
||||||
getNewData(itemBeans);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,7 @@ import com.shayu.onetoone.bean.GiftBean;
|
|||||||
import com.shayu.onetoone.bean.MessageChatGiftContent;
|
import com.shayu.onetoone.bean.MessageChatGiftContent;
|
||||||
import com.shayu.onetoone.bean.PurseBean;
|
import com.shayu.onetoone.bean.PurseBean;
|
||||||
import com.shayu.onetoone.bean.SendConsumeBean;
|
import com.shayu.onetoone.bean.SendConsumeBean;
|
||||||
|
import com.shayu.onetoone.event.MessageMsgBusEvent;
|
||||||
import com.shayu.onetoone.listener.OnDialogClickListener;
|
import com.shayu.onetoone.listener.OnDialogClickListener;
|
||||||
import com.shayu.onetoone.listener.OnSendMessageListener;
|
import com.shayu.onetoone.listener.OnSendMessageListener;
|
||||||
import com.shayu.onetoone.manager.OTONetManager;
|
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.http.base.HttpCallback;
|
||||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||||
import com.yunbao.common.manager.IMLoginManager;
|
import com.yunbao.common.manager.IMLoginManager;
|
||||||
|
import com.yunbao.common.utils.Bus;
|
||||||
import com.yunbao.common.utils.ToastUtil;
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
import com.yunbao.common.utils.WordUtil;
|
import com.yunbao.common.utils.WordUtil;
|
||||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||||
|
|
||||||
|
import org.greenrobot.eventbus.Subscribe;
|
||||||
|
import org.greenrobot.eventbus.ThreadMode;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -82,6 +87,7 @@ public class GiftDialog extends AbsDialogPopupWindow {
|
|||||||
@Override
|
@Override
|
||||||
protected void onCreate() {
|
protected void onCreate() {
|
||||||
super.onCreate();
|
super.onCreate();
|
||||||
|
Bus.getOn(this);
|
||||||
gifList = findViewById(R.id.gift_list);
|
gifList = findViewById(R.id.gift_list);
|
||||||
money = findViewById(R.id.money);
|
money = findViewById(R.id.money);
|
||||||
topUpBtn = findViewById(R.id.top_up_btn);
|
topUpBtn = findViewById(R.id.top_up_btn);
|
||||||
@ -182,17 +188,24 @@ public class GiftDialog extends AbsDialogPopupWindow {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void iniPurse() {
|
private void iniPurse() {
|
||||||
OTONetManager.getInstance(mContext)
|
UserManager.getMoney(mContext, targetId, new OnItemClickListener<String>() {
|
||||||
.getPurseInfo(new HttpCallback<PurseBean>() {
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(PurseBean data) {
|
public void onItemClick(String bean, int position) {
|
||||||
money.setText(data.getStart() + "");
|
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_POINT =1;
|
||||||
public static final int TYPE_UPDATE_SYSTEM =2;
|
public static final int TYPE_UPDATE_SYSTEM =2;
|
||||||
public static final int TYPE_TO_HOME_PAGE =3;
|
public static final int TYPE_TO_HOME_PAGE =3;
|
||||||
|
public static final int TYPE_UPDATE_STAR =4;
|
||||||
|
|
||||||
private int num;
|
private int num;
|
||||||
|
private String content;
|
||||||
|
|
||||||
public MessageMsgBusEvent(int type, int num) {
|
public MessageMsgBusEvent(int type, int num) {
|
||||||
super(type);
|
super(type);
|
||||||
this.num = num;
|
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) {
|
public MessageMsgBusEvent(int type) {
|
||||||
super(type);
|
super(type);
|
||||||
}
|
}
|
||||||
@ -24,4 +37,14 @@ public class MessageMsgBusEvent extends AbsBusEvent {
|
|||||||
public void setNum(int num) {
|
public void setNum(int num) {
|
||||||
this.num = 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;
|
import io.rong.imlib.model.Conversation;
|
||||||
|
|
||||||
public class CallClientManager {
|
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_RECEIVED_CALL = "receivedVideoCall";//接听
|
||||||
public static final String VIDEO_CALL = "callVideo";//拨打
|
public static final String VIDEO_CALL = "callVideo";//拨打
|
||||||
public static final String VIDEO_FLOAT = "videoFloatWindow";//浮窗
|
public static final String VIDEO_FLOAT = "videoFloatWindow";//浮窗
|
||||||
@ -236,7 +236,7 @@ public class CallClientManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean isCalling() {
|
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) {
|
public boolean isCallVideo(RongCallSession callSession) {
|
||||||
@ -261,7 +261,7 @@ public class CallClientManager {
|
|||||||
private String targetId;
|
private String targetId;
|
||||||
private String sessionId;
|
private String sessionId;
|
||||||
private boolean isCallVideo = false;
|
private boolean isCallVideo = false;
|
||||||
long warningTime=-999;
|
long warningTime = -999;
|
||||||
long activeTime;
|
long activeTime;
|
||||||
|
|
||||||
public CallTimeTask(String targetId) {
|
public CallTimeTask(String targetId) {
|
||||||
@ -317,7 +317,7 @@ public class CallClientManager {
|
|||||||
handler.post(() -> {
|
handler.post(() -> {
|
||||||
for (OnCallStatusListener listener : listeners.values()) {
|
for (OnCallStatusListener listener : listeners.values()) {
|
||||||
listener.onTime(extra);
|
listener.onTime(extra);
|
||||||
if (warningTime!=-999 && warningTime <= 60) {
|
if (warningTime != -999 && warningTime <= 60) {
|
||||||
listener.onTimeWarning(warningTime--);
|
listener.onTimeWarning(warningTime--);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -360,7 +360,7 @@ public class CallClientManager {
|
|||||||
} else {
|
} else {
|
||||||
warningTime = bean.getMp3Time();
|
warningTime = bean.getMp3Time();
|
||||||
}
|
}
|
||||||
if (warningTime!=-999 && warningTime <= 60) {
|
if (warningTime != -999 && warningTime <= 60) {
|
||||||
for (OnCallStatusListener listener : listeners.values()) {
|
for (OnCallStatusListener listener : listeners.values()) {
|
||||||
listener.onTimeWarning(warningTime);
|
listener.onTimeWarning(warningTime);
|
||||||
}
|
}
|
||||||
@ -610,7 +610,7 @@ public class CallClientManager {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(RongCallCommon.CallErrorCode errorCode) {
|
public void onError(RongCallCommon.CallErrorCode errorCode) {
|
||||||
Log.e(TAG,"CallStatusListener.onError "+errorCode);
|
Log.e(TAG, "CallStatusListener.onError " + errorCode);
|
||||||
if (statusListener != null) {
|
if (statusListener != null) {
|
||||||
statusListener.onCallEnd();
|
statusListener.onCallEnd();
|
||||||
}
|
}
|
||||||
|
@ -179,7 +179,6 @@ public class SendMessageManager {
|
|||||||
@Override
|
@Override
|
||||||
public void onSuccess(SendConsumeBean consumeBean) {
|
public void onSuccess(SendConsumeBean consumeBean) {
|
||||||
if (consumeBean.getCode() != 0) {
|
if (consumeBean.getCode() != 0) {
|
||||||
UserManager.saveMoney(consumeBean.getMoney());
|
|
||||||
if (consumeBean.getCode() == 503 || consumeBean.getCode()==500) {
|
if (consumeBean.getCode() == 503 || consumeBean.getCode()==500) {
|
||||||
messageListener.onError(OnSendMessageListener.STATUS_NOT_PRICE, consumeBean.getMsg(), consumeBean);
|
messageListener.onError(OnSendMessageListener.STATUS_NOT_PRICE, consumeBean.getMsg(), consumeBean);
|
||||||
} else {
|
} else {
|
||||||
@ -187,6 +186,7 @@ public class SendMessageManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
UserManager.saveMoney(consumeBean.getMoney());
|
||||||
String token = null;
|
String token = null;
|
||||||
if (sendData.needToken) {
|
if (sendData.needToken) {
|
||||||
token = UUID.randomUUID().toString();
|
token = UUID.randomUUID().toString();
|
||||||
|
@ -1,10 +1,13 @@
|
|||||||
package com.shayu.onetoone.utils;
|
package com.shayu.onetoone.utils;
|
||||||
|
|
||||||
|
import android.app.Dialog;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import com.shayu.onetoone.bean.MessageConsumeConfigBean;
|
import com.shayu.onetoone.bean.MessageConsumeConfigBean;
|
||||||
import com.shayu.onetoone.bean.UserBean;
|
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.listener.OnSendMessageListener;
|
||||||
import com.shayu.onetoone.manager.OTONetManager;
|
import com.shayu.onetoone.manager.OTONetManager;
|
||||||
import com.yunbao.common.http.base.HttpCallback;
|
import com.yunbao.common.http.base.HttpCallback;
|
||||||
@ -12,7 +15,7 @@ import com.yunbao.common.interfaces.OnItemClickListener;
|
|||||||
import com.yunbao.common.utils.AppManager;
|
import com.yunbao.common.utils.AppManager;
|
||||||
|
|
||||||
public class MsgCheckUtils {
|
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)
|
OTONetManager.getInstance(mContext)
|
||||||
.getMessageConsumeConfig(targetId, new HttpCallback<MessageConsumeConfigBean>() {
|
.getMessageConsumeConfig(targetId, new HttpCallback<MessageConsumeConfigBean>() {
|
||||||
@Override
|
@Override
|
||||||
@ -26,22 +29,36 @@ 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)
|
OTONetManager.getInstance(mContext)
|
||||||
.getTargetUserInfo(Integer.parseInt(targetId), new HttpCallback<UserBean>() {
|
.getTargetUserInfo(Integer.parseInt(targetId), new HttpCallback<UserBean>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(UserBean data) {
|
public void onSuccess(UserBean data) {
|
||||||
if (data.getInfo().getName_auth() == 2) {
|
if (data.getInfo().getName_auth() == 2) {
|
||||||
//listener.onSuccess("", null);
|
listener.onSuccess("", null);
|
||||||
} else if (data.getInfo().getName_auth() == 3) {
|
} else if (data.getInfo().getName_auth() == 3) {
|
||||||
listener.onError(data.getInfo().getName_auth(), "當前正在審核中,請耐心等待");
|
listener.onError(data.getInfo().getName_auth(), "當前正在審核中,請耐心等待");
|
||||||
}else {
|
} else {
|
||||||
listener.onError(data.getInfo().getName_auth(), "");
|
listener.onError(data.getInfo().getName_auth(), "");
|
||||||
}
|
}
|
||||||
|
if (data.getInfo().getName_auth() != 2) {
|
||||||
AppManager.runDebugCode(() -> {
|
AppManager.runDebugCode(() -> {
|
||||||
|
new TipsDialog(mContext)
|
||||||
|
.setTitle("测试模式,是否强行拨打")
|
||||||
|
.setApplyText("确定")
|
||||||
|
.setCancelText("取消")
|
||||||
|
.setOnDialogClickListener(new OnDialogClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onApply(Dialog dialog) {
|
||||||
|
super.onApply(dialog);
|
||||||
listener.onSuccess("", null);
|
listener.onSuccess("", null);
|
||||||
|
}
|
||||||
|
}).showDialog();
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(String error) {
|
public void onError(String error) {
|
||||||
|
@ -11,6 +11,7 @@ import com.shayu.onetoone.bean.LabelBean;
|
|||||||
import com.shayu.onetoone.bean.MessageConsumeConfigBean;
|
import com.shayu.onetoone.bean.MessageConsumeConfigBean;
|
||||||
import com.shayu.onetoone.bean.PurseBean;
|
import com.shayu.onetoone.bean.PurseBean;
|
||||||
import com.shayu.onetoone.bean.UserBean;
|
import com.shayu.onetoone.bean.UserBean;
|
||||||
|
import com.shayu.onetoone.event.MessageMsgBusEvent;
|
||||||
import com.shayu.onetoone.listener.OnDialogClickListener;
|
import com.shayu.onetoone.listener.OnDialogClickListener;
|
||||||
import com.shayu.onetoone.listener.OnSendMessageListener;
|
import com.shayu.onetoone.listener.OnSendMessageListener;
|
||||||
import com.shayu.onetoone.manager.OTONetManager;
|
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.http.base.HttpCallback;
|
||||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||||
import com.yunbao.common.manager.IMLoginManager;
|
import com.yunbao.common.manager.IMLoginManager;
|
||||||
|
import com.yunbao.common.utils.Bus;
|
||||||
import com.yunbao.common.utils.SpUtil;
|
import com.yunbao.common.utils.SpUtil;
|
||||||
import com.yunbao.common.utils.StringUtil;
|
import com.yunbao.common.utils.StringUtil;
|
||||||
import com.yunbao.common.utils.ToastUtil;
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
@ -77,6 +79,7 @@ public class UserManager {
|
|||||||
if (StringUtil.isEmpty(money)) {
|
if (StringUtil.isEmpty(money)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Bus.get().post(new MessageMsgBusEvent(MessageMsgBusEvent.TYPE_UPDATE_STAR,money));
|
||||||
SpUtil.setStringValue("oto_user_money", money);
|
SpUtil.setStringValue("oto_user_money", money);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,6 +5,14 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="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
|
<io.rong.imkit.widget.refresh.SmartRefreshLayout
|
||||||
android:id="@+id/swipeRefreshLayout"
|
android:id="@+id/swipeRefreshLayout"
|
||||||
@ -12,7 +20,7 @@
|
|||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent">
|
app:layout_constraintTop_toBottomOf="@+id/rc_conversationlist_notice_container">
|
||||||
|
|
||||||
<com.yanzhenjie.recyclerview.SwipeRecyclerView
|
<com.yanzhenjie.recyclerview.SwipeRecyclerView
|
||||||
android:id="@+id/recyclerView"
|
android:id="@+id/recyclerView"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user