修复测试反馈问题
This commit is contained in:
@@ -1,11 +1,16 @@
|
||||
package com.shayu.onetoone;
|
||||
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.os.Process;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.facebook.FacebookSdk;
|
||||
import com.shayu.onetoone.activity.fragments.message.ChatMessageFragment;
|
||||
@@ -24,6 +29,7 @@ import com.shayu.onetoone.utils.ChatPluginExtensionConfig;
|
||||
import com.shayu.onetoone.utils.NeverCrashUtils;
|
||||
import com.yunbao.common.BuildConfig;
|
||||
import com.yunbao.common.CommonAppContext;
|
||||
import com.yunbao.common.bean.CrashSaveBean;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.manager.imrongcloud.InstructorSendReward;
|
||||
import com.yunbao.common.manager.imrongcloud.InstructorSendRewardProvider;
|
||||
@@ -34,7 +40,9 @@ import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.SpUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import io.rong.callkit.CallEndMessageItemProvider;
|
||||
import io.rong.imkit.RongIM;
|
||||
@@ -53,11 +61,29 @@ import io.rong.message.CommandMessage;
|
||||
import io.rong.message.TextMessage;
|
||||
|
||||
public class AppContext extends CommonAppContext {
|
||||
private final static List<WeakReference<Activity>> activities = new ArrayList<>();
|
||||
|
||||
public static void exit() {
|
||||
for (WeakReference<Activity> activity : activities) {
|
||||
try {
|
||||
if (activity.get() != null) {
|
||||
activity.get().finish();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
L.setDeBug(true);
|
||||
SpUtil.getInstance();
|
||||
registerActivityLifecycleCallbacks(new AdjustLifecycleCallbacks());
|
||||
|
||||
NeverCrashUtils.getInstance()
|
||||
.setDebugMode(BuildConfig.DEBUG)
|
||||
.setMainCrashHandler((t, e) -> {
|
||||
@@ -109,7 +135,6 @@ public class AppContext extends CommonAppContext {
|
||||
});
|
||||
|
||||
|
||||
|
||||
RongcloudIMManager.addRongcloudIMOnReceiveMessageListener(new RongIMClient.OnReceiveMessageWrapperListener() {
|
||||
@Override
|
||||
public boolean onReceived(Message message, int left, boolean hasPackage, boolean offline) {
|
||||
@@ -126,9 +151,52 @@ public class AppContext extends CommonAppContext {
|
||||
IMLoginManager.get(this).setLanguage(false);
|
||||
|
||||
|
||||
RongConfigCenter.conversationConfig().replaceMessageProvider(CallEndMessageItemProvider.class,new OTOCallEndMessageItemProvider());
|
||||
RongConfigCenter.conversationConfig().replaceMessageProvider(CallEndMessageItemProvider.class, new OTOCallEndMessageItemProvider());
|
||||
RongExtensionManager.getInstance().setExtensionConfig(new ChatPluginExtensionConfig());
|
||||
|
||||
}
|
||||
|
||||
private static final class AdjustLifecycleCallbacks implements ActivityLifecycleCallbacks {
|
||||
@Override
|
||||
public void onActivityResumed(Activity activity) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityPaused(Activity activity) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityStopped(@NonNull Activity activity) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivitySaveInstanceState(@NonNull Activity activity, @NonNull Bundle outState) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityDestroyed(@NonNull Activity activity) {
|
||||
for (WeakReference<Activity> reference : activities) {
|
||||
if (reference.get() == activity) {
|
||||
activities.remove(reference);
|
||||
return;
|
||||
}
|
||||
}
|
||||
AppManager.getInstance().removeActivity(activity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityCreated(@NonNull Activity activity, @Nullable Bundle savedInstanceState) {
|
||||
activities.add(new WeakReference<>(activity));
|
||||
CrashSaveBean.getInstance().setActivitySize(activities);
|
||||
AppManager.getInstance().addActivity(activity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityStarted(@NonNull Activity activity) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -173,8 +173,8 @@ public class DiamondExchangeActivity extends AbsOTOActivity {
|
||||
|
||||
private void initData() {
|
||||
|
||||
if (getIntent() != null && getIntent().getBundleExtra("bundle") != null) {
|
||||
type = getIntent().getBundleExtra("bundle").getString("type");
|
||||
if (getIntent() != null && getIntent().getExtras() != null) {
|
||||
type = getIntent().getExtras().getString("type");
|
||||
if (TextUtils.equals(type, "yuanbao")) {
|
||||
title.setText(getString(R.string.my_arnings_exchange_star));
|
||||
} else {
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.angcyo.tablayout.DslTabLayout;
|
||||
import com.angcyo.tablayout.DslTabLayoutConfig;
|
||||
import com.angcyo.tablayout.delegate2.ViewPager2Delegate;
|
||||
import com.shayu.onetoone.AppContext;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.shayu.onetoone.R;
|
||||
import com.shayu.onetoone.activity.fragments.BaseFragment;
|
||||
@@ -32,6 +33,7 @@ import com.shayu.onetoone.manager.CallClientManager;
|
||||
import com.shayu.onetoone.manager.OTONetManager;
|
||||
import com.shayu.onetoone.manager.RouteManager;
|
||||
import com.shayu.onetoone.manager.SendMessageManager;
|
||||
import com.shayu.onetoone.utils.UserManager;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.bean.ConfigBean;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
@@ -232,9 +234,10 @@ public class MainActivity extends AbsOTOActivity {
|
||||
* 检测用户是否设置个人信息
|
||||
*/
|
||||
private void checkUserInfoIsSet() {
|
||||
OTONetManager.getInstance(mContext).getBaseInfos(true, new com.yunbao.common.http.base.HttpCallback<com.shayu.onetoone.bean.UserBean>() {
|
||||
OTONetManager.getInstance(mContext).getBaseInfos(false, new com.yunbao.common.http.base.HttpCallback<com.shayu.onetoone.bean.UserBean>() {
|
||||
@Override
|
||||
public void onSuccess(com.shayu.onetoone.bean.UserBean data) {
|
||||
UserManager.saveUserBean(data);
|
||||
if (data.getStatus() == 0) {
|
||||
RouteManager.forwardCompleteActivity();
|
||||
}
|
||||
@@ -289,7 +292,8 @@ public class MainActivity extends AbsOTOActivity {
|
||||
ToastUtil.show(R.string.main_click_next_exit);
|
||||
return;
|
||||
}
|
||||
super.onBackPressed();
|
||||
//super.onBackPressed();
|
||||
AppContext.exit();
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
|
||||
@@ -17,6 +17,7 @@ import com.shayu.onetoone.manager.RouteManager;
|
||||
import com.yanzhenjie.recyclerview.SwipeRecyclerView;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
import java.util.List;
|
||||
@@ -87,7 +88,14 @@ public class MyArnActivity extends AbsOTOActivity {
|
||||
RouteManager.forwardActivity(RouteManager.ACTIVITY_DIAMOND_EXCHANGE, bundle);
|
||||
}
|
||||
});
|
||||
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.info), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
RouteManager.forwardWebViewActivity(WordUtil.getNewString(R.string.my_arnings_reward_description),
|
||||
"file:android_asset/Reward_instructions.html"
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void refreshMyArn() {
|
||||
|
||||
@@ -68,7 +68,7 @@ public class WebViewActivity extends AbsOTOActivity {
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
if (!url.contains("token")) {
|
||||
if (!url.contains("token")&&url.startsWith("http")) {
|
||||
IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo();
|
||||
url += "&uid=" + userInfo.getId() + "&token=" + userInfo.getToken() + "&isZh=" + (WordUtil.isNewZh() ? "1" : "0");
|
||||
}
|
||||
|
||||
@@ -106,13 +106,16 @@ public class FriendsFragment extends BaseFragment {
|
||||
@Override
|
||||
public void onError(int status, String msg, SendConsumeBean bean) {
|
||||
super.onError(status, msg, bean);
|
||||
if(status==503){
|
||||
RouteManager.forwardActivity(RouteManager.ACTIVITY_MATCHING);
|
||||
return;
|
||||
}
|
||||
int money = 100;
|
||||
if (configBean != null) {
|
||||
money = configBean.getMatePrice();
|
||||
}
|
||||
new TipsDialog(mContext)
|
||||
.setTitle(WordUtil.getNewString(R.string.not_money))
|
||||
.setContent(String.format(WordUtil.getNewString(R.string.not_money_video_tips), money))
|
||||
.setTitle(WordUtil.getNewString(R.string.gift_not_money))
|
||||
.setCancelText(WordUtil.getNewString(R.string.dialog_cancel_tip))
|
||||
.setApplyText(WordUtil.getNewString(R.string.dialog_to_money_tip))
|
||||
.showDialog();
|
||||
|
||||
@@ -320,9 +320,12 @@ public class MyFragment extends BaseFragment implements OnItemClickListener<User
|
||||
private void initAuth(AuthBean data) {
|
||||
if (data.getName_auth() == 2) {
|
||||
authStatus.setVisibility(View.VISIBLE);
|
||||
mName.setMaxEms(4);
|
||||
} else {
|
||||
authStatus.setVisibility(View.GONE);
|
||||
mName.setMaxEms(6);
|
||||
}
|
||||
mName.invalidate();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -345,6 +348,7 @@ public class MyFragment extends BaseFragment implements OnItemClickListener<User
|
||||
if (mAdapter == null) {
|
||||
mAdapter = new MainMeAdapter(mContext, list);
|
||||
mAdapter.setOnItemClickListener(this);
|
||||
mAdapter.setList(list);
|
||||
mRecyclerView.setAdapter(mAdapter);
|
||||
} else {
|
||||
mAdapter.setList(list);
|
||||
@@ -512,6 +516,9 @@ public class MyFragment extends BaseFragment implements OnItemClickListener<User
|
||||
case 13:
|
||||
forwardSetting();
|
||||
break;
|
||||
case 14:
|
||||
RouteManager.forwardActivity(RouteManager.ACTIVITY_MY_ARN);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -46,6 +46,7 @@ import com.shayu.onetoone.manager.CallClientManager;
|
||||
import com.shayu.onetoone.manager.OTONetManager;
|
||||
import com.shayu.onetoone.manager.RouteManager;
|
||||
import com.shayu.onetoone.manager.SendMessageManager;
|
||||
import com.shayu.onetoone.utils.MsgCheckUtils;
|
||||
import com.shayu.onetoone.view.MsgInputPanelForAudio;
|
||||
import com.shayu.onetoone.view.MsgInputPanelForGift;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
@@ -114,7 +115,6 @@ public class ChatMessageFragment extends AbsConversationFragment {
|
||||
|
||||
private String token;
|
||||
private static final String TAG = "聊天界面";
|
||||
private MessageConsumeConfigBean configBean;
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
@@ -132,7 +132,6 @@ public class ChatMessageFragment extends AbsConversationFragment {
|
||||
numLayout.setVisibility(View.INVISIBLE);
|
||||
initBtn();
|
||||
initChat();
|
||||
initPriceBean();
|
||||
cameraUtil = new ProcessImageUtil(getActivity(), mContext.getPackageName() + ".fileprovider");
|
||||
|
||||
mRongExtension.setVisibility(View.VISIBLE);
|
||||
@@ -156,17 +155,23 @@ public class ChatMessageFragment extends AbsConversationFragment {
|
||||
public void onError(int status, String msg) {
|
||||
super.onError(status, msg);
|
||||
if (status == OnSendMessageListener.STATUS_NOT_PRICE) {
|
||||
new TipsDialog(mContext)
|
||||
.setTitle(WordUtil.getNewString(R.string.not_money))
|
||||
.setContent(String.format(WordUtil.getNewString(R.string.not_money_tips), msg))
|
||||
.setApplyText(WordUtil.getNewString(R.string.dialog_apply))
|
||||
.setOnDialogClickListener(new OnDialogClickListener() {
|
||||
MsgCheckUtils.checkPrice(mContext, targetId, new OnItemClickListener<MessageConsumeConfigBean>() {
|
||||
@Override
|
||||
public void onItemClick(MessageConsumeConfigBean bean, int position) {
|
||||
new TipsDialog(mContext)
|
||||
.setTitle(WordUtil.getNewString(R.string.not_money))
|
||||
.setContent(String.format(WordUtil.getNewString(R.string.not_money_tips), bean.getPrice()))
|
||||
.setApplyText(WordUtil.getNewString(R.string.dialog_apply))
|
||||
.setOnDialogClickListener(new OnDialogClickListener() {
|
||||
|
||||
@Override
|
||||
public void onApply(Dialog dialog) {
|
||||
super.onApply(dialog);
|
||||
}
|
||||
}).showDialog();
|
||||
}
|
||||
});
|
||||
|
||||
@Override
|
||||
public void onApply(Dialog dialog) {
|
||||
super.onApply(dialog);
|
||||
}
|
||||
}).showDialog();
|
||||
} else {
|
||||
ToastUtil.show(msg);
|
||||
}
|
||||
@@ -268,43 +273,47 @@ public class ChatMessageFragment extends AbsConversationFragment {
|
||||
ToastUtil.show(R.string.toast_call_not_unlock);
|
||||
return;
|
||||
}
|
||||
if(CallClientManager.getManager().isCalling()){
|
||||
if (CallClientManager.getManager().isCalling()) {
|
||||
ToastUtil.show(R.string.now_call_tips);
|
||||
return;
|
||||
}
|
||||
checkAuth(new OnSendMessageListener() {
|
||||
MsgCheckUtils.checkAuth(mContext,targetId,new OnSendMessageListener() {
|
||||
@Override
|
||||
public void onSuccess(String token, SendConsumeBean bean) {
|
||||
super.onSuccess(token, bean);
|
||||
new BottomListDialog(mContext).setSelect(new OnItemClickListener<String>() {
|
||||
@Override
|
||||
public void onItemClick(String bean, int position) {
|
||||
CallClientManager.getManager().checkMoney(targetId, true, new OnSendMessageListener() {
|
||||
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 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);
|
||||
}
|
||||
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();
|
||||
@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();
|
||||
|
||||
}).setStrings(Collections.singletonList(String.format(WordUtil.getNewString(R.string.chat_video_tips), configBean.getVideoPrice())))
|
||||
.showDialog();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@@ -324,44 +333,50 @@ public class ChatMessageFragment extends AbsConversationFragment {
|
||||
ToastUtil.show(R.string.toast_call_not_unlock);
|
||||
return;
|
||||
}
|
||||
if(CallClientManager.getManager().isCalling() || isFloatWindows()){
|
||||
if (CallClientManager.getManager().isCalling() || isFloatWindows()) {
|
||||
ToastUtil.show(R.string.now_call_tips);
|
||||
return;
|
||||
}
|
||||
|
||||
checkAuth(new OnSendMessageListener() {
|
||||
MsgCheckUtils.checkAuth(mContext,targetId,new OnSendMessageListener() {
|
||||
@Override
|
||||
public void onSuccess(String token, SendConsumeBean bean) {
|
||||
super.onSuccess(token, bean);
|
||||
new BottomListDialog(mContext).setSelect(new OnItemClickListener<String>() {
|
||||
@Override
|
||||
public void onItemClick(String bean, int position) {
|
||||
CallClientManager.getManager().checkMoney(targetId, false, new OnSendMessageListener() {
|
||||
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 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);
|
||||
}
|
||||
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();
|
||||
}
|
||||
});
|
||||
@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();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}).setStrings(Collections.singletonList(String.format(WordUtil.getNewString(R.string.chat_audio_tips), configBean.getMp3Price())))
|
||||
.showDialog();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -407,17 +422,23 @@ public class ChatMessageFragment extends AbsConversationFragment {
|
||||
@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_tips), msg))
|
||||
.setApplyText(WordUtil.getNewString(R.string.dialog_apply))
|
||||
.setOnDialogClickListener(new OnDialogClickListener() {
|
||||
MsgCheckUtils.checkPrice(mContext, targetId, new OnItemClickListener<MessageConsumeConfigBean>() {
|
||||
@Override
|
||||
public void onItemClick(MessageConsumeConfigBean bean, int position) {
|
||||
new TipsDialog(mContext)
|
||||
.setTitle(WordUtil.getNewString(R.string.not_money))
|
||||
.setContent(String.format(WordUtil.getNewString(R.string.not_money_tips), bean.getPrice()))
|
||||
.setApplyText(WordUtil.getNewString(R.string.dialog_apply))
|
||||
.setOnDialogClickListener(new OnDialogClickListener() {
|
||||
|
||||
@Override
|
||||
public void onApply(Dialog dialog) {
|
||||
super.onApply(dialog);
|
||||
}
|
||||
}).showDialog();
|
||||
}
|
||||
});
|
||||
|
||||
@Override
|
||||
public void onApply(Dialog dialog) {
|
||||
super.onApply(dialog);
|
||||
}
|
||||
}).showDialog();
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -433,27 +454,7 @@ public class ChatMessageFragment extends AbsConversationFragment {
|
||||
return EasyFloat.isShow("call");
|
||||
}
|
||||
|
||||
private void checkAuth(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);
|
||||
} else if (data.getInfo().getName_auth() == 3) {
|
||||
listener.onError(data.getInfo().getName_auth(), "當前正在審核中,請耐心等待");
|
||||
}
|
||||
AppManager.runDebugCode(()->{
|
||||
listener.onSuccess("", null);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
Log.e(TAG, "onError: " + error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void sendAuthRequest() {
|
||||
MessageChatAuthContent content = MessageChatAuthContent.obtain("");
|
||||
@@ -632,7 +633,7 @@ public class ChatMessageFragment extends AbsConversationFragment {
|
||||
video.setImageResource(R.mipmap.ic_msg_video_lock);
|
||||
call.setTag("true");
|
||||
}
|
||||
AppManager.runDebugCode(()->{
|
||||
AppManager.runDebugCode(() -> {
|
||||
call.setTag(null);
|
||||
call.setImageResource(R.mipmap.ic_msg_call);
|
||||
video.setImageResource(R.mipmap.ic_msg_video);
|
||||
@@ -771,43 +772,28 @@ public class ChatMessageFragment extends AbsConversationFragment {
|
||||
}
|
||||
}
|
||||
|
||||
private void initPriceBean() {
|
||||
OTONetManager.getInstance(mContext)
|
||||
.getMessageConsumeConfig(targetId, new HttpCallback<MessageConsumeConfigBean>() {
|
||||
private void showRedPoint() {
|
||||
RongIMClient.getInstance().getUnreadCount(new Conversation.ConversationType[]{Conversation.ConversationType.PRIVATE}
|
||||
, false
|
||||
, new RongIMClient.ResultCallback<Integer>() {
|
||||
@Override
|
||||
public void onSuccess(MessageConsumeConfigBean data) {
|
||||
configBean = data;
|
||||
public void onSuccess(Integer integer) {
|
||||
Integer tmp = integer + MsgMessageFragment.systemPoint;
|
||||
if (tmp <= 0) {
|
||||
numLayout.setVisibility(View.INVISIBLE);
|
||||
return;
|
||||
}
|
||||
numLayout.setVisibility(View.VISIBLE);
|
||||
num.setText(tmp + "");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
public void onError(RongIMClient.ErrorCode e) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void showRedPoint() {
|
||||
RongIMClient.getInstance().getUnreadCount(new Conversation.ConversationType[]{Conversation.ConversationType.PRIVATE}
|
||||
,false
|
||||
,new RongIMClient.ResultCallback<Integer>() {
|
||||
@Override
|
||||
public void onSuccess(Integer integer) {
|
||||
Integer tmp = integer + MsgMessageFragment.systemPoint;
|
||||
if (tmp <= 0) {
|
||||
numLayout.setVisibility(View.INVISIBLE);
|
||||
return;
|
||||
}
|
||||
numLayout.setVisibility(View.VISIBLE);
|
||||
num.setText(tmp + "");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(RongIMClient.ErrorCode e) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void moneyEvent(MoneyUpdateEvent event) {
|
||||
if (giftPanel != null) {
|
||||
|
||||
@@ -558,7 +558,7 @@ public class CallVideoActivity extends AbsOTOActivity {
|
||||
//
|
||||
@Override
|
||||
public void onCallEnd() {
|
||||
if (!sessionId.equals(targetId)){
|
||||
if (sessionId!=null&&!sessionId.equals(targetId)){
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("model", CallClientManager.VIDEO_CALL);
|
||||
bundle.putString("targetId", targetId);
|
||||
|
||||
@@ -114,7 +114,7 @@ public class SettingActivity extends AbsActivity {
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
private void intiData() {
|
||||
versionCode.setText(VersionUtil.getVersion());
|
||||
versionCode.setText(VersionUtil.getVersion()+"("+VersionUtil.getVersionCode()+")");
|
||||
cacheSize.setText(GlideCatchUtil.getInstance().getCacheSize());
|
||||
}
|
||||
|
||||
|
||||
@@ -87,12 +87,7 @@ public class HomeRankListAdapter extends RecyclerView.Adapter<HomeRankListAdapte
|
||||
|
||||
private void setData(HomeRankBean bean, int position) {
|
||||
rank.setText(position + 4 + "");
|
||||
|
||||
if (bean.getUserNicename().length() > 5) {
|
||||
user_name.setText(bean.getUserNicename().substring(0, 4) + "...");
|
||||
} else {
|
||||
user_name.setText(bean.getUserNicename());
|
||||
}
|
||||
user_name.setText(bean.getUserNicename());
|
||||
level.setText("Lv." + bean.getLevel());
|
||||
money.setText(bean.getMoney());
|
||||
|
||||
@@ -102,7 +97,7 @@ public class HomeRankListAdapter extends RecyclerView.Adapter<HomeRankListAdapte
|
||||
sex.setImageResource(R.mipmap.ic_message_tab_woman);
|
||||
}
|
||||
if (bean.isFollow()) {
|
||||
follow.setVisibility(View.GONE);
|
||||
follow.setVisibility(View.INVISIBLE);
|
||||
} else {
|
||||
follow.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ public class MessageInteractionConversationListAdapter extends MessageListAdapte
|
||||
holder.setText(R.id.text, bean.getUser_nicename());
|
||||
holder.setText(R.id.time, new SimpleDateFormat("yyyy-MM-dd HH:mm", Locale.getDefault()).format(new Date(bean.getAddtime() * 1000)));
|
||||
ImgLoader.display(holder.getContext(), bean.getAvatar(), holder.getView(R.id.ico));
|
||||
ImgLoader.display(holder.getContext(), bean.getAvatar(), holder.getView(R.id.img_item_interaction));
|
||||
//ImgLoader.display(holder.getContext(), bean.getAvatar(), holder.getView(R.id.img_item_interaction));//右侧头像
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,6 +37,10 @@ public class MsgGreetConfigAdapter extends RecyclerView.Adapter<MsgGreetConfigAd
|
||||
}
|
||||
|
||||
public void setList(List<GreetBean> mList) {
|
||||
if(mList.isEmpty()){
|
||||
GreetBean bean=new GreetBean();
|
||||
mList.add(bean);
|
||||
}
|
||||
this.mList = mList;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
@@ -83,6 +87,7 @@ public class MsgGreetConfigAdapter extends RecyclerView.Adapter<MsgGreetConfigAd
|
||||
|
||||
public void clear() {
|
||||
mList.clear();
|
||||
mList.add(new GreetBean());
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@@ -118,6 +123,7 @@ public class MsgGreetConfigAdapter extends RecyclerView.Adapter<MsgGreetConfigAd
|
||||
if (bean.getContent() == null) {
|
||||
editText.setEnabled(true);
|
||||
editText.setText("");
|
||||
editText.requestFocus();
|
||||
} else {
|
||||
editText.setText(bean.getContent());
|
||||
editText.setEnabled(false);
|
||||
@@ -126,7 +132,7 @@ public class MsgGreetConfigAdapter extends RecyclerView.Adapter<MsgGreetConfigAd
|
||||
editText.setOnFocusChangeListener(new View.OnFocusChangeListener() {
|
||||
@Override
|
||||
public void onFocusChange(View v, boolean hasFocus) {
|
||||
if (!hasFocus && editText.getText().toString().length() > 0) {
|
||||
if (!hasFocus && editText.getText().toString().length() > 0 && mList.size() > position) {
|
||||
mList.get(position).setContent(editText.getText().toString());
|
||||
editText.setEnabled(false);
|
||||
}
|
||||
|
||||
@@ -69,12 +69,12 @@ public class UserBean extends BaseModel {
|
||||
private int b_y;
|
||||
private int b_ym;
|
||||
private String b_ymd;
|
||||
private int name_auth;//1 未提交 2 已认证 3已提交
|
||||
private int name_auth;//1 未提交 2 已认证 3已提交 4被驳回
|
||||
private long name_auth_time;
|
||||
private String auth_front;
|
||||
private String auth_back;
|
||||
private String auth_remark;
|
||||
private int sage_auth;
|
||||
private int sage_auth;//1 未提交 2 已认证 3已提交 4被驳回
|
||||
private long sage_auth_time;
|
||||
private int is_hot;
|
||||
private String vodie_price;
|
||||
|
||||
@@ -7,8 +7,12 @@ import androidx.annotation.NonNull;
|
||||
|
||||
import com.lxj.xpopup.core.AttachPopupView;
|
||||
import com.shayu.onetoone.R;
|
||||
import com.shayu.onetoone.bean.UserBean;
|
||||
import com.shayu.onetoone.event.MessageMsgBusEvent;
|
||||
import com.shayu.onetoone.manager.RouteManager;
|
||||
import com.shayu.onetoone.utils.UserManager;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
|
||||
/**
|
||||
@@ -33,6 +37,10 @@ public class MsgMoreDialog extends AttachPopupView implements View.OnClickListen
|
||||
read = findViewById(R.id.ll_read);
|
||||
config.setOnClickListener(this);
|
||||
read.setOnClickListener(this);
|
||||
UserBean bean = UserManager.getUserBean();
|
||||
if (bean.getInfo().getSage_auth()!=2) {
|
||||
config.setVisibility(GONE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -50,7 +50,7 @@ public class CallClientManager {
|
||||
public static final String AUDIO_FLOAT = "audioFloatWindow";//浮窗
|
||||
private static CallClientManager manager;
|
||||
private SurfaceView localVideo, remoteVideo;
|
||||
private Map<Class,OnCallStatusListener> listeners;
|
||||
private Map<Class, OnCallStatusListener> listeners;
|
||||
private CallTimeTask timeTask = null;
|
||||
|
||||
public static CallClientManager getManager() {
|
||||
@@ -84,8 +84,8 @@ public class CallClientManager {
|
||||
RongCallClient.setReceivedCallListener(new CallMeListener());
|
||||
}
|
||||
|
||||
public void addOnVoIPCallListener(Class zlass,OnCallStatusListener statusListener) {
|
||||
listeners.put(zlass,statusListener);
|
||||
public void addOnVoIPCallListener(Class zlass, OnCallStatusListener statusListener) {
|
||||
listeners.put(zlass, statusListener);
|
||||
RongCallClient.getInstance().setVoIPCallListener(new CallStatusListener(new OnCallStatusListener() {
|
||||
@Override
|
||||
public void onCallWait(SurfaceView localVideo) {
|
||||
@@ -96,7 +96,7 @@ public class CallClientManager {
|
||||
|
||||
@Override
|
||||
public void onCallStart(String userId, SurfaceView remoteVideo) {
|
||||
for (OnCallStatusListener listener : listeners.values()) {
|
||||
for (OnCallStatusListener listener : listeners.values()) {
|
||||
listener.onCallStart(userId, remoteVideo);
|
||||
}
|
||||
startTimer(null);
|
||||
@@ -104,7 +104,7 @@ public class CallClientManager {
|
||||
|
||||
@Override
|
||||
public void onCallEnd() {
|
||||
for (OnCallStatusListener listener : listeners.values()) {
|
||||
for (OnCallStatusListener listener : listeners.values()) {
|
||||
listener.onCallEnd();
|
||||
}
|
||||
endTimer();
|
||||
@@ -112,7 +112,7 @@ public class CallClientManager {
|
||||
|
||||
@Override
|
||||
public void onStartFirstFrame() {
|
||||
for (OnCallStatusListener listener : listeners.values()) {
|
||||
for (OnCallStatusListener listener : listeners.values()) {
|
||||
listener.onStartFirstFrame();
|
||||
}
|
||||
}
|
||||
@@ -150,14 +150,14 @@ public class CallClientManager {
|
||||
RongCallClient.getInstance().setVoIPCallListener(new CallStatusListener(new OnCallStatusListener() {
|
||||
@Override
|
||||
public void onCallWait(SurfaceView localVideo) {
|
||||
for (OnCallStatusListener listener : listeners.values()) {
|
||||
for (OnCallStatusListener listener : listeners.values()) {
|
||||
listener.onCallWait(localVideo);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCallStart(String userId, SurfaceView remoteVideo) {
|
||||
for (OnCallStatusListener listener : listeners.values()) {
|
||||
for (OnCallStatusListener listener : listeners.values()) {
|
||||
listener.onCallStart(userId, remoteVideo);
|
||||
}
|
||||
startTimer(targetId);
|
||||
@@ -165,7 +165,7 @@ public class CallClientManager {
|
||||
|
||||
@Override
|
||||
public void onCallEnd() {
|
||||
for (OnCallStatusListener listener : listeners.values()) {
|
||||
for (OnCallStatusListener listener : listeners.values()) {
|
||||
listener.onCallEnd();
|
||||
}
|
||||
endTimer();
|
||||
@@ -173,7 +173,7 @@ public class CallClientManager {
|
||||
|
||||
@Override
|
||||
public void onStartFirstFrame() {
|
||||
for (OnCallStatusListener listener : listeners.values()) {
|
||||
for (OnCallStatusListener listener : listeners.values()) {
|
||||
listener.onStartFirstFrame();
|
||||
}
|
||||
}
|
||||
@@ -187,14 +187,14 @@ public class CallClientManager {
|
||||
RongCallClient.getInstance().setVoIPCallListener(new CallStatusListener(new OnCallStatusListener() {
|
||||
@Override
|
||||
public void onCallWait(SurfaceView localVideo) {
|
||||
for (OnCallStatusListener listener : listeners.values()) {
|
||||
for (OnCallStatusListener listener : listeners.values()) {
|
||||
listener.onCallWait(localVideo);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCallStart(String userId, SurfaceView remoteVideo) {
|
||||
for (OnCallStatusListener listener : listeners.values()) {
|
||||
for (OnCallStatusListener listener : listeners.values()) {
|
||||
listener.onCallStart(userId, remoteVideo);
|
||||
}
|
||||
startTimer(targetId);
|
||||
@@ -202,7 +202,7 @@ public class CallClientManager {
|
||||
|
||||
@Override
|
||||
public void onCallEnd() {
|
||||
for (OnCallStatusListener listener : listeners.values()) {
|
||||
for (OnCallStatusListener listener : listeners.values()) {
|
||||
listener.onCallEnd();
|
||||
}
|
||||
endTimer();
|
||||
@@ -210,7 +210,7 @@ public class CallClientManager {
|
||||
|
||||
@Override
|
||||
public void onStartFirstFrame() {
|
||||
for (OnCallStatusListener listener : listeners.values()) {
|
||||
for (OnCallStatusListener listener : listeners.values()) {
|
||||
listener.onStartFirstFrame();
|
||||
}
|
||||
}
|
||||
@@ -244,7 +244,7 @@ public class CallClientManager {
|
||||
|
||||
public String getSessionId() {
|
||||
RongCallSession callSession = RongCallClient.getInstance().getCallSession();
|
||||
if(callSession==null){
|
||||
if (callSession == null) {
|
||||
return "";
|
||||
}
|
||||
return callSession.getCallerUserId();
|
||||
@@ -265,7 +265,8 @@ public class CallClientManager {
|
||||
|
||||
@Override
|
||||
public boolean cancel() {
|
||||
if (sessionId.equals(targetId)) {
|
||||
long id = IMLoginManager.get(CommonAppContext.sInstance).getUserInfo().getId();
|
||||
if (sessionId.equals(targetId) || !sessionId.equals(id + "")) {
|
||||
System.err.println("接听方不计费 结束");
|
||||
return super.cancel();
|
||||
}
|
||||
@@ -309,7 +310,7 @@ public class CallClientManager {
|
||||
extra = String.format(Locale.ROOT, "%02d:%02d", (time % 3600) / 60, (time % 60));
|
||||
}
|
||||
handler.post(() -> {
|
||||
for (OnCallStatusListener listener : listeners.values()) {
|
||||
for (OnCallStatusListener listener : listeners.values()) {
|
||||
listener.onTime(extra);
|
||||
if (warningTime <= 60) {
|
||||
listener.onTimeWarning(warningTime--);
|
||||
@@ -355,7 +356,7 @@ public class CallClientManager {
|
||||
warningTime = bean.getMp3Time();
|
||||
}
|
||||
if (warningTime <= 60) {
|
||||
for (OnCallStatusListener listener : listeners.values()) {
|
||||
for (OnCallStatusListener listener : listeners.values()) {
|
||||
listener.onTimeWarning(warningTime);
|
||||
}
|
||||
}
|
||||
@@ -365,7 +366,7 @@ public class CallClientManager {
|
||||
public void onError(int status, String msg) {
|
||||
super.onError(status, msg);
|
||||
if (status == OnSendMessageListener.STATUS_NOT_PRICE) {
|
||||
for (OnCallStatusListener listener : listeners.values()) {
|
||||
for (OnCallStatusListener listener : listeners.values()) {
|
||||
listener.onErrorNotPrice(msg);
|
||||
}
|
||||
endCall();
|
||||
@@ -553,12 +554,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) {
|
||||
|
||||
@@ -72,6 +72,10 @@ public class SendMessageManager {
|
||||
}
|
||||
|
||||
public static void pingVideoMessage(String toUid, String time, OnSendMessageListener listener) {
|
||||
if ("0".equals(time)) {
|
||||
listener.onError(504,"时间错误");
|
||||
return;
|
||||
}
|
||||
SendData sendData = new SendData(toUid,
|
||||
2,
|
||||
"not",
|
||||
@@ -135,7 +139,7 @@ public class SendMessageManager {
|
||||
@Override
|
||||
public void onSuccess(SendConsumeBean consumeBean) {
|
||||
if (consumeBean.getCode() != 0) {
|
||||
if (consumeBean.getCode() == 500) {
|
||||
if (consumeBean.getCode() == 503 || consumeBean.getCode()==500) {
|
||||
messageListener.onError(OnSendMessageListener.STATUS_NOT_PRICE, consumeBean.getMsg(), consumeBean);
|
||||
} else {
|
||||
messageListener.onError(OnSendMessageListener.STATUS_ERROR, consumeBean.getMsg(), consumeBean);
|
||||
|
||||
@@ -22,6 +22,7 @@ import com.shayu.onetoone.manager.OTONetManager;
|
||||
import com.shayu.onetoone.manager.RouteManager;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.utils.AppManager;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
|
||||
import java.util.Collections;
|
||||
@@ -133,13 +134,15 @@ public class OTOCallEndMessageItemProvider extends CallEndMessageItemProvider {
|
||||
private void checkAuth(String targetId, OnSendMessageListener listener) {
|
||||
OTONetManager.getInstance(null)
|
||||
.getTargetUserInfo(Integer.parseInt(targetId), new HttpCallback<UserBean>() {
|
||||
@Override
|
||||
public void onSuccess(UserBean data) {
|
||||
if (data.getInfo().getName_auth() == 1) {
|
||||
listener.onError(0, "");
|
||||
} else {
|
||||
if (data.getInfo().getName_auth() == 2) {
|
||||
listener.onSuccess("", null);
|
||||
} else if (data.getInfo().getName_auth() == 3) {
|
||||
listener.onError(data.getInfo().getName_auth(), "當前正在審核中,請耐心等待");
|
||||
}
|
||||
AppManager.runDebugCode(() -> {
|
||||
//listener.onSuccess("", null);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.shayu.onetoone.utils;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
import com.shayu.onetoone.bean.MessageConsumeConfigBean;
|
||||
import com.shayu.onetoone.bean.UserBean;
|
||||
import com.shayu.onetoone.listener.OnSendMessageListener;
|
||||
import com.shayu.onetoone.manager.OTONetManager;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
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) {
|
||||
OTONetManager.getInstance(mContext)
|
||||
.getMessageConsumeConfig(targetId, new HttpCallback<MessageConsumeConfigBean>() {
|
||||
@Override
|
||||
public void onSuccess(MessageConsumeConfigBean data) {
|
||||
listener.onItemClick(data, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
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);
|
||||
} else if (data.getInfo().getName_auth() == 3) {
|
||||
listener.onError(data.getInfo().getName_auth(), "當前正在審核中,請耐心等待");
|
||||
}else {
|
||||
listener.onError(data.getInfo().getName_auth(), "");
|
||||
}
|
||||
AppManager.runDebugCode(() -> {
|
||||
//listener.onSuccess("", null);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
Log.e("ChatAuth", "onError: " + error);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.shayu.onetoone.utils;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.shayu.onetoone.bean.UserBean;
|
||||
import com.yunbao.common.utils.SpUtil;
|
||||
|
||||
public class UserManager {
|
||||
public static UserBean userBean;
|
||||
public static UserBean getUserBean(){
|
||||
if(userBean==null){
|
||||
userBean=JSONObject.parseObject(SpUtil.getStringValue("oto_user_info"),UserBean.class);
|
||||
}
|
||||
return userBean;
|
||||
}
|
||||
public static void saveUserBean(UserBean bean){
|
||||
userBean=bean;
|
||||
SpUtil.setStringValue("oto_user_info", JSONObject.toJSONString(bean));
|
||||
}
|
||||
}
|
||||
@@ -13,11 +13,14 @@ import android.widget.Toast;
|
||||
|
||||
import com.blankj.utilcode.util.PermissionUtils;
|
||||
import com.shayu.onetoone.R;
|
||||
import com.shayu.onetoone.bean.MessageConsumeConfigBean;
|
||||
import com.shayu.onetoone.bean.SendConsumeBean;
|
||||
import com.shayu.onetoone.dialog.TipsDialog;
|
||||
import com.shayu.onetoone.listener.OnDialogClickListener;
|
||||
import com.shayu.onetoone.listener.OnSendMessageListener;
|
||||
import com.shayu.onetoone.manager.SendMessageManager;
|
||||
import com.shayu.onetoone.utils.MsgCheckUtils;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
|
||||
@@ -143,16 +146,22 @@ public class MsgInputPanelForAudio extends AbsInputPanel {
|
||||
AudioRecordManager.getInstance().stopRecord();
|
||||
isAudio = false;
|
||||
mUpDirection = false;
|
||||
new TipsDialog(mContext)
|
||||
.setTitle(WordUtil.getNewString(R.string.not_money))
|
||||
.setContent(String.format(WordUtil.getNewString(R.string.not_money_text_tips), msg))
|
||||
.setOnDialogClickListener(new OnDialogClickListener() {
|
||||
MsgCheckUtils.checkPrice(mContext, targetId, new OnItemClickListener<MessageConsumeConfigBean>() {
|
||||
@Override
|
||||
public void onItemClick(MessageConsumeConfigBean bean, int position) {
|
||||
new TipsDialog(mContext)
|
||||
.setTitle(WordUtil.getNewString(R.string.not_money))
|
||||
.setContent(String.format(WordUtil.getNewString(R.string.not_money_text_tips), bean.getPrice()))
|
||||
.setOnDialogClickListener(new OnDialogClickListener() {
|
||||
|
||||
@Override
|
||||
public void onApply(Dialog dialog) {
|
||||
super.onApply(dialog);
|
||||
}
|
||||
}).showDialog();
|
||||
}
|
||||
});
|
||||
|
||||
@Override
|
||||
public void onApply(Dialog dialog) {
|
||||
super.onApply(dialog);
|
||||
}
|
||||
}).showDialog();
|
||||
} else {
|
||||
ToastUtil.show(msg);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user