diff --git a/app/build.gradle b/app/build.gradle index d04b660a5..2cc71a578 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -264,8 +264,6 @@ dependencies { implementation 'com.github.YvesCheung:RollingText:1.2.3' // 引入原有第三方裁图源码,方便修改 api project(':android_crop_lib') - //网易七鱼客服 - implementation 'com.qiyukf.unicorn:unicorn:4.9.1' //rx权限请求框架 implementation('com.github.tbruyelle:rxpermissions:0.10.2') { diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index 846285b4f..fa12ebab9 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -302,9 +302,6 @@ -dontwarn edu.umd.cs.** -dontwarn org.apache.** -dontwarn com.amap.** -#网易七鱼客服系统 --dontwarn com.qiyukf.** --keep class com.qiyukf.** {*;} # 确保openFileChooser方法不被混淆 -keepclassmembers class * extends android.webkit.WebChromeClient{ diff --git a/app/src/main/java/com/yizhuan/erban/MainActivity.java b/app/src/main/java/com/yizhuan/erban/MainActivity.java index f7d40f9a7..1fc9c3ec2 100644 --- a/app/src/main/java/com/yizhuan/erban/MainActivity.java +++ b/app/src/main/java/com/yizhuan/erban/MainActivity.java @@ -1,6 +1,5 @@ package com.yizhuan.erban; -import android.Manifest; import android.animation.ObjectAnimator; import android.annotation.SuppressLint; import android.app.Activity; @@ -45,7 +44,6 @@ import com.netease.nimlib.sdk.team.constant.TeamMessageNotifyTypeEnum; import com.netease.nimlib.sdk.team.model.Team; import com.netease.nimlib.sdk.uinfo.model.NimUserInfo; import com.orhanobut.logger.Logger; -import com.qiyukf.unicorn.api.Unicorn; import com.tencent.bugly.crashreport.CrashReport; import com.trello.rxlifecycle3.android.ActivityEvent; import com.yizhuan.erban.application.ActivityStackManager; @@ -123,7 +121,6 @@ import com.yizhuan.xchat_android_core.community.attachment.DynamicSysAttachment; import com.yizhuan.xchat_android_core.community.event.SquareTaskEvent; import com.yizhuan.xchat_android_core.community.event.UnReadCountEvent; import com.yizhuan.xchat_android_core.community.im.WorldDynamicAttachment; -import com.yizhuan.xchat_android_core.customer_server.event.CustomerServerMsgEvent; import com.yizhuan.xchat_android_core.home.model.HomeModel; import com.yizhuan.xchat_android_core.im.custom.bean.AssistantAttachment; import com.yizhuan.xchat_android_core.im.custom.bean.CarAttachment; @@ -151,11 +148,11 @@ import com.yizhuan.xchat_android_core.level.event.CharmLevelUpEvent; import com.yizhuan.xchat_android_core.level.event.LevelUpEvent; import com.yizhuan.xchat_android_core.linked.LinkedModel; import com.yizhuan.xchat_android_core.linked.bean.LinkedInfo; +import com.yizhuan.xchat_android_core.manager.AudioEngineManager; import com.yizhuan.xchat_android_core.manager.AvRoomDataManager; import com.yizhuan.xchat_android_core.manager.IMBroadcastManager; import com.yizhuan.xchat_android_core.manager.IMMessageManager; import com.yizhuan.xchat_android_core.manager.RoomEvent; -import com.yizhuan.xchat_android_core.manager.AudioEngineManager; import com.yizhuan.xchat_android_core.market_verify.MarketVerifyModel; import com.yizhuan.xchat_android_core.market_verify.event.MarketVerifyUpdateEvent; import com.yizhuan.xchat_android_core.miniworld.bean.OpenAudioPartyAttachment; @@ -636,7 +633,7 @@ public class MainActivity extends BaseMvpActivity //登录成功查询未读信息数量 mMainTabLayout.setmUnReadDynamicCount(0); - int unreadCount = IMMessageManager.get().queryUnreadMsg() + Unicorn.getUnreadCount(); + int unreadCount = IMMessageManager.get().queryUnreadMsg(); mMainTabLayout.setMsgNum(unreadCount); // 互动消息未读数量 HomeModel.get().getUnreadCount(AuthModel.get().getCurrentUid()) @@ -706,13 +703,7 @@ public class MainActivity extends BaseMvpActivity } } - int unreadCount = IMMessageManager.get().queryUnreadMsg() + Unicorn.getUnreadCount() - countIgnore; - mMainTabLayout.setMsgNum(unreadCount); - } - - @Subscribe(threadMode = ThreadMode.MAIN) - public void onCustomerServerMsgEvent(CustomerServerMsgEvent event) { - int unreadCount = IMMessageManager.get().queryUnreadMsg() + event.unreadCount; + int unreadCount = IMMessageManager.get().queryUnreadMsg() + countIgnore; mMainTabLayout.setMsgNum(unreadCount); } @@ -724,7 +715,7 @@ public class MainActivity extends BaseMvpActivity @Subscribe(threadMode = ThreadMode.MAIN) public void onLoginUserInfoUpdateEvent(LoginUserInfoUpdateEvent event) { - int unreadCount = IMMessageManager.get().queryUnreadMsg() + Unicorn.getUnreadCount(); + int unreadCount = IMMessageManager.get().queryUnreadMsg(); mMainTabLayout.setMsgNum(unreadCount); } diff --git a/app/src/main/java/com/yizhuan/erban/application/XChatApplication.java b/app/src/main/java/com/yizhuan/erban/application/XChatApplication.java index 1b7109bcd..620b2ad15 100644 --- a/app/src/main/java/com/yizhuan/erban/application/XChatApplication.java +++ b/app/src/main/java/com/yizhuan/erban/application/XChatApplication.java @@ -27,11 +27,8 @@ import com.bumptech.glide.request.target.ViewTarget; import com.coorchice.library.utils.LogUtils; import com.huawei.hms.support.common.ActivityMgr; import com.idlefish.flutterboost.FlutterBoost; -import com.ishumei.smantifraud.SmAntiFraud; import com.llew.huawei.verifier.LoadedApkHuaWei; import com.microquation.linkedme.android.LinkedME; -import com.mob.MobSDK; -import com.netease.mobsec.rjsb.watchman; import com.netease.nim.uikit.api.NimUIKit; import com.netease.nim.uikit.common.util.log.LogUtil; import com.netease.nimlib.sdk.NIMClient; @@ -73,7 +70,6 @@ import com.yizhuan.xchat_android_core.Env; import com.yizhuan.xchat_android_core.UriProvider; import com.yizhuan.xchat_android_core.auth.AuthModel; import com.yizhuan.xchat_android_core.channel.ChannelModel; -import com.yizhuan.xchat_android_core.customer_server.CustomerServerModel; import com.yizhuan.xchat_android_core.family.model.FamilyModel; import com.yizhuan.xchat_android_core.gift.GiftModel; import com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment; @@ -674,8 +670,6 @@ public class XChatApplication extends Application { private void init(String channel) { initNimUIKit(); - initYiDun(); - MobSDK.init(this); UriProvider.initUri(BuildConfig.BASE_URL_DEBUG, BuildConfig.BASE_URL_STAGING, BuildConfig.BASE_URL_RELEASE); SVGAParser.Companion.shareParser().init(this); try { @@ -741,9 +735,6 @@ public class XChatApplication extends Application { // HallModel.get(); // 师徒 MentoringRelationshipModel.get(); - - //初始化客服系统 - CustomerServerModel.getInstance().init(this); //全局处理 GlobalHandleManager.get().init(); @@ -756,46 +747,6 @@ public class XChatApplication extends Application { NimUIKit.init(this); } - private void initYiDun() { - // 网易易盾初始化 - watchman.init(this, XChatConstants.YI_DUN_PRODUCT_NUMBER); - } - - private void initShuMeiTianWang(String channel) { - // 数美天网初始化 - if (Objects.equals(ProcessUtil.getCurProcessName(this), this.getPackageName())) { - SmAntiFraud.SmOption option = new SmAntiFraud.SmOption(); - String DEBUG_ORG = XChatConstants.SHU_MEI_TIAN_WANG_ORGANIZATION;// organization 代码 不要传 AccessKey - option.setOrganization(DEBUG_ORG); - option.setChannel(channel);//渠道代码 - SmAntiFraud.create(this, option); - } - } - - - private static void enabledStrictMode() { - StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder() - .detectAll() //检测所有的想检测的 -// .detectCustomSlowCalls() //自定义的耗时调用 -// .detectDiskReads() /*检测磁盘读操作*/ -// .detectDiskWrites() /*检测磁盘写入操作*/ -// .detectNetwork() //检测网络 -// .detectResourceMismatches() - .penaltyLog() - .penaltyDeath() - .build()); - - StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder() - .detectAll()/*也可以采用detectAll()来检测所有想检测的东西*/ -// .detectActivityLeaks()/*检测Activity内存泄露*/ -// .detectLeakedClosableObjects()/*检测未关闭的Closable对象*/ -// .detectLeakedSqlLiteObjects() /*检测Sqlite对象是否关闭*/ - .penaltyLog() - .penaltyDeath() - .build() - ); - } - /** * debug 环境 受到实验室模式影响 */ diff --git a/app/src/main/java/com/yizhuan/erban/other/activity/SplashActivity.java b/app/src/main/java/com/yizhuan/erban/other/activity/SplashActivity.java index 01d2057aa..9076456bb 100644 --- a/app/src/main/java/com/yizhuan/erban/other/activity/SplashActivity.java +++ b/app/src/main/java/com/yizhuan/erban/other/activity/SplashActivity.java @@ -15,6 +15,7 @@ import com.idlefish.flutterboost.FlutterBoost; import com.idlefish.flutterboost.containers.FlutterBoostFragment; import com.microquation.linkedme.android.LinkedME; import com.mob.MobSDK; +import com.netease.mobsec.rjsb.watchman; import com.netease.nim.uikit.StatusBarUtil; import com.netease.nim.uikit.support.glide.GlideApp; import com.umeng.analytics.MobclickAgent; @@ -112,6 +113,9 @@ public class SplashActivity extends BaseActivity implements View.OnClickListener private void initOtherSDK(String channel) { LinkedME.getInstance().setImmediate(true); + // 网易易盾初始化 + watchman.init(this.getApplicationContext(), XChatConstants.YI_DUN_PRODUCT_NUMBER); // 网易易盾初始化 + MobSDK.init(this.getApplicationContext()); MobSDK.submitPolicyGrantResult(true, null); // 友盟统计初始化 UMConfigure.init(this.getApplicationContext(), XChatConstants.UMENG_APP_KEY, diff --git a/app/src/main/java/com/yizhuan/erban/ui/im/recent/RecentContactsFragment.java b/app/src/main/java/com/yizhuan/erban/ui/im/recent/RecentContactsFragment.java index 5f27be296..d3bc7a158 100644 --- a/app/src/main/java/com/yizhuan/erban/ui/im/recent/RecentContactsFragment.java +++ b/app/src/main/java/com/yizhuan/erban/ui/im/recent/RecentContactsFragment.java @@ -25,10 +25,8 @@ import com.netease.nim.uikit.common.fragment.TFragment; import com.netease.nim.uikit.common.ui.dialog.CustomAlertDialog; import com.netease.nim.uikit.common.ui.drop.DropCover; import com.netease.nim.uikit.common.ui.drop.DropManager; -import com.netease.nim.uikit.common.ui.imageview.HeadImageView; import com.netease.nim.uikit.common.ui.recyclerview.listener.SimpleClickListener; import com.netease.nim.uikit.impl.NimUIKitImpl; -import com.netease.nim.uikit.support.glide.GlideApp; import com.netease.nimlib.sdk.NIMClient; import com.netease.nimlib.sdk.Observer; import com.netease.nimlib.sdk.RequestCallback; @@ -43,14 +41,9 @@ import com.netease.nimlib.sdk.msg.model.QueryDirectionEnum; import com.netease.nimlib.sdk.msg.model.RecentContact; import com.netease.nimlib.sdk.team.model.Team; import com.netease.nimlib.sdk.team.model.TeamMember; -import com.qiyukf.unicorn.api.Unicorn; -import com.qiyukf.unicorn.api.msg.MsgTypeEnum; -import com.qiyukf.unicorn.api.msg.UnicornMessage; import com.yizhuan.erban.R; import com.yizhuan.erban.home.event.ContactTrashEvent; import com.yizhuan.erban.ui.im.recent.adapter.RecentContactAdapter; -import com.yizhuan.xchat_android_core.customer_server.CustomerServerModel; -import com.yizhuan.xchat_android_core.customer_server.event.CustomerServerMsgEvent; import com.yizhuan.xchat_android_core.utils.CheckUtils; import com.yizhuan.xchat_android_core.utils.SystemUidUtil; import com.yizhuan.xchat_android_library.utils.SingleToastUtil; @@ -115,9 +108,6 @@ public class RecentContactsFragment extends TFragment { registerObservers(true); registerDropCompletedListener(true); registerOnlineStateChangeListener(true); - - initKFView(); - EventBus.getDefault().register(this); } @@ -144,7 +134,7 @@ public class RecentContactsFragment extends TFragment { private void notifyDataSetChanged() { adapter.notifyDataSetChanged(); - boolean empty = items.isEmpty() && msgLoaded && !isHaveKFHeadView(); + boolean empty = items.isEmpty() && msgLoaded; emptyBg.setVisibility(empty ? View.VISIBLE : View.GONE); emptyHint.setText("你还没有聊天记录哦!\n快去和好友聊天吧!"); } @@ -654,14 +644,6 @@ public class RecentContactsFragment extends TFragment { protected void refreshViewHolderByIndex(final int index) { if (recyclerView == null) return; recyclerView.post(() -> adapter.notifyItemChanged(index)); -// if (getActivity() == null) return; -// getActivity().runOnUiThread(new Runnable() { -// -// @Override -// public void run() { -// adapter.notifyItemChanged(index); -// } -// }); } public void setCallback(RecentContactsCallback callback) { @@ -755,102 +737,9 @@ public class RecentContactsFragment extends TFragment { } - private View kfView; - private HeadImageView ivKfAvatar; - private TextView tvLastMsg; - private TextView tvMsgCount; - - private void initKFView() { - kfView = LayoutInflater.from(getContext()).inflate(R.layout.header_customer_server, null, false); - ivKfAvatar = kfView.findViewById(R.id.iv_kf_avatar); - GlideApp.with(getContext()) - .load(CustomerServerModel.AVATAR_URL) - .dontAnimate() - .into(ivKfAvatar); - tvLastMsg = kfView.findViewById(R.id.tv_last_msg); - tvMsgCount = kfView.findViewById(R.id.tv_msg_count); - kfView.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - CustomerServerModel.getInstance().contactCustomerServer("", "聊天", null).subscribe(); - } - }); - - kfView.setOnLongClickListener(new View.OnLongClickListener() { - @Override - public boolean onLongClick(View v) { - CustomAlertDialog alertDialog = new CustomAlertDialog(getActivity()); - alertDialog.setTitle("官方客服"); - String title = getString(R.string.main_msg_list_delete_chatting); - alertDialog.addItem(title, new onSeparateItemClickListener() { - @Override - public void onClick() { - Unicorn.clearCache(); - removeKFView(); - } - }); - alertDialog.show(); - - return true; - } - }); - onCustomerServerMsgEvent(new CustomerServerMsgEvent(Unicorn.getUnreadCount())); - } - - @Subscribe(threadMode = ThreadMode.MAIN) - public void onCustomerServerMsgEvent(CustomerServerMsgEvent event) { - UnicornMessage message = Unicorn.queryLastMessage(); - if (message != null) { - if (message.getMsgType().equals(MsgTypeEnum.text)) { - tvLastMsg.setText(message.getContent()); - } else if (message.getMsgType().equals(MsgTypeEnum.image)) { - tvLastMsg.setText("[图片]"); - } else if (message.getMsgType().equals(MsgTypeEnum.audio)) { - tvLastMsg.setText("[语音]"); - } else if (message.getMsgType().equals(MsgTypeEnum.video)) { - tvLastMsg.setText("[视频]"); - } else { - tvLastMsg.setText("[收到一条消息]"); - } - if (!isHaveKFHeadView()) { - addKFView(); - } - emptyBg.setVisibility(View.GONE); - } - if (event.unreadCount > 0) { - tvMsgCount.setVisibility(View.VISIBLE); - tvMsgCount.setText(event.unreadCount + ""); - - } else { - tvMsgCount.setVisibility(View.INVISIBLE); - tvMsgCount.setText(""); - } - } - @Subscribe(threadMode = ThreadMode.MAIN) public void onContactTrashEvent(ContactTrashEvent event) { NIMClient.getService(MsgService.class).clearAllUnreadCount(); } - private boolean isHaveKFHeadView() { - if (adapter.getHeaderLayout() == null) { - return false; - } - for (int i = 0; i < adapter.getHeaderLayout().getChildCount(); i++) { - if (adapter.getHeaderLayout().getChildAt(i) == kfView) { - return true; - } - } - return false; - } - - public void addKFView() { - adapter.addHeaderView(kfView); - adapter.notifyDataSetChanged(); - } - - public void removeKFView() { - adapter.removeHeaderView(kfView); - adapter.notifyDataSetChanged(); - } } diff --git a/app/src/main/java/com/yizhuan/erban/ui/login/helper/LogoutHelper.java b/app/src/main/java/com/yizhuan/erban/ui/login/helper/LogoutHelper.java index 6e36d6067..cbda8a319 100644 --- a/app/src/main/java/com/yizhuan/erban/ui/login/helper/LogoutHelper.java +++ b/app/src/main/java/com/yizhuan/erban/ui/login/helper/LogoutHelper.java @@ -2,7 +2,6 @@ package com.yizhuan.erban.ui.login.helper; import com.yizhuan.xchat_android_core.PreferencesUtils; import com.yizhuan.xchat_android_core.auth.AuthModel; -import com.yizhuan.xchat_android_core.customer_server.CustomerServerModel; /** * create by lvzebiao @2019/12/9 @@ -12,7 +11,6 @@ public class LogoutHelper { public static void logout() { AuthModel.get().logout().subscribe(); PreferencesUtils.setFristQQ(true); - CustomerServerModel.getInstance().logout(); } } diff --git a/app/src/main/java/com/yizhuan/erban/ui/widget/MainTabLayout.java b/app/src/main/java/com/yizhuan/erban/ui/widget/MainTabLayout.java index f2fd8ac63..0dcb37640 100644 --- a/app/src/main/java/com/yizhuan/erban/ui/widget/MainTabLayout.java +++ b/app/src/main/java/com/yizhuan/erban/ui/widget/MainTabLayout.java @@ -1,23 +1,18 @@ package com.yizhuan.erban.ui.widget; - import android.content.Context; - -import androidx.annotation.Nullable; - import android.util.AttributeSet; import android.view.View; import android.widget.LinearLayout; +import androidx.annotation.Nullable; + import com.netease.nimlib.sdk.NIMClient; import com.netease.nimlib.sdk.msg.MsgService; import com.yizhuan.erban.R; -import com.yizhuan.xchat_android_core.customer_server.event.CustomerServerMsgEvent; import com.yizhuan.xchat_android_core.statistic.StatisticManager; import com.yizhuan.xchat_android_core.statistic.protocol.StatisticsProtocol; -import org.greenrobot.eventbus.EventBus; - /** *

底部tab导航

* Created by Administrator on 2017/11/14. @@ -41,7 +36,6 @@ public class MainTabLayout extends LinearLayout implements View.OnClickListener private MainRedPointTab.RedPointDismissListener msgListener = new MainRedPointTab.RedPointDismissListener() { @Override public void dismiss() { - EventBus.getDefault().post(new CustomerServerMsgEvent(0)); NIMClient.getService(MsgService.class).clearAllUnreadCount(); } }; diff --git a/app/src/model_customer_server/res/color/selector_item_pop_list_text_color.xml b/app/src/main/res/color/selector_item_pop_list_text_color.xml similarity index 100% rename from app/src/model_customer_server/res/color/selector_item_pop_list_text_color.xml rename to app/src/main/res/color/selector_item_pop_list_text_color.xml diff --git a/app/src/model_customer_server/res/drawable/bg_selector_get_code.xml b/app/src/main/res/drawable/bg_selector_get_code.xml similarity index 100% rename from app/src/model_customer_server/res/drawable/bg_selector_get_code.xml rename to app/src/main/res/drawable/bg_selector_get_code.xml diff --git a/app/src/model_customer_server/res/layout/activity_login_code.xml b/app/src/main/res/layout/activity_login_code.xml similarity index 100% rename from app/src/model_customer_server/res/layout/activity_login_code.xml rename to app/src/main/res/layout/activity_login_code.xml diff --git a/app/src/model_customer_server/res/layout/activity_login_phone.xml b/app/src/main/res/layout/activity_login_phone.xml similarity index 100% rename from app/src/model_customer_server/res/layout/activity_login_phone.xml rename to app/src/main/res/layout/activity_login_phone.xml diff --git a/app/src/main/res/layout/fragment_me.xml b/app/src/main/res/layout/fragment_me.xml index a351dfb43..bbe044e9e 100644 --- a/app/src/main/res/layout/fragment_me.xml +++ b/app/src/main/res/layout/fragment_me.xml @@ -543,7 +543,6 @@ android:layout_marginEnd="@dimen/dp_me_text_padding_to_icon" android:background="@color/line_353548" /> - userData = new ArrayList<>(); - userData.add(new CustomerItemInfo("real_name").setValue(UserModel.get().getCacheLoginUserInfo().getNick())); - userData.add(new CustomerItemInfo("mobile_phone").setValue(UserModel.get().getCacheLoginUserInfo().getPhone())); - userData.add(new CustomerItemInfo("email").setValue("")); - userData.add(new CustomerItemInfo("avatar").setValue(UserModel.get().getCacheLoginUserInfo().getAvatar())); - userData.add(new CustomerItemInfo("nick") - .setLabel("用户昵称:") - .setValue(UserModel.get().getCacheLoginUserInfo().getNick()) - .setIndex(0)); - - userData.add(new CustomerItemInfo("gender") - .setLabel("性别:") - .setValue(UserModel.get().getCacheLoginUserInfo().getGender() == 1 ? "男" : "女") - .setIndex(1)); - - userData.add(new CustomerItemInfo("erbanNo") - .setLabel("音游号:") - .setValue(UserModel.get().getCacheLoginUserInfo().getErbanNo() + "") - .setIndex(2)); - - userData.add(new CustomerItemInfo("nobleName") - .setLabel("爵位名称:") - .setValue(UserModel.get().getCacheLoginUserInfo().getNobleInfo() == null ? "无贵族信息" : UserModel.get().getCacheLoginUserInfo().getNobleInfo().getName()) - .setIndex(3)); - - userData.add(new CustomerItemInfo("phone") - .setLabel("手机号:") - .setValue(UserModel.get().getCacheLoginUserInfo().getPhone()) - .setIndex(4)); - - userData.add(new CustomerItemInfo("newUser") - .setLabel("是否新用户:") - .setValue(UserModel.get().getCacheLoginUserInfo().isNewUser() ? "是" : "否") - .setIndex(5)); - - userData.add(new CustomerItemInfo("familyName") - .setLabel("家族名称:") - .setValue(FamilyModel.Instance().getMyFamily() == null ? "暂无家族" : FamilyModel.Instance().getMyFamily().getFamilyName()) - .setIndex(6)); - - userData.add(new CustomerItemInfo("familyId") - .setLabel("家族ID:") - .setValue(FamilyModel.Instance().getMyFamily() == null ? "暂无家族" : FamilyModel.Instance().getMyFamily().getFamilyId()) - .setIndex(7)); - - ysfUserInfo.data = new Gson().toJson(userData); - Unicorn.setUserInfo(ysfUserInfo); - } - } - - @Override - public void init(Context context) { - if (isInit) { - return; - } - isInit = true; - options = new YSFOptions(); - options.statusBarNotificationConfig = new com.qiyukf.unicorn.api.StatusBarNotificationConfig(); - options.inputPanelOptions = new InputPanelOptions(); - options.inputPanelOptions.showActionPanel = true; - options.inputPanelOptions.actionPanelOptions = new ActionPanelOptions(); - options.inputPanelOptions.actionPanelOptions.actionListProvider = new ActionListProvider() { - //实现 getActionList 方法,返回输入更多弹框的列表,SDK 中默认提供了 AlbumAction(相册)、CameraAction(相机)等 Action - @Override - public List getActionList() { - List list = new ArrayList<>(); - ImageAction imageAction = new ImageAction(com.netease.nim.uikit.R.drawable.nim_message_plus_photo_selector, com.netease.nim.uikit.R.string.input_panel_photo); - imageAction.setActionFontColor(Color.BLACK); - list.add(imageAction); - return list; - } - }; - options.uiCustomization = new UICustomization(); - options.uiCustomization.titleBarStyle = 0; - options.uiCustomization.titleBackgroundResId = R.drawable.customer_server_title_bar_bg; - options.uiCustomization.leftAvatar = AVATAR_URL; - - options.uiCustomization.hideKeyboardOnEnterConsult = true; - options.uiCustomization.titleCenter = true; - options.uiCustomization.buttonBackgroundColorList = R.color.kf_button_color_state_list; - options.uiCustomization.msgItemBackgroundLeft = R.drawable.nim_message_item_left_selector; - options.uiCustomization.msgItemBackgroundRight = R.drawable.nim_message_item_right_selector; - options.uiCustomization.msgBackgroundColor = context.getResources().getColor(R.color.color_f0f0f0); - - // appKey 可以在七鱼管理系统->设置->App 接入 页面找到 - Unicorn.init(context, XChatConstants.QI_YU_KF_KEY, options, new UnicornImageLoader() { - @Nullable - @Override - public Bitmap loadImageSync(String uri, int width, int height) { - return null; - } - - @Override - public void loadImage(String uri, int width, int height, ImageLoaderListener listener) { - if (width <= 0 || height <= 0) { - width = height = Integer.MIN_VALUE; - } - Glide.with(context) - .asBitmap() - .load(uri) - .into(new SimpleTarget(width, height) { - @Override - public void onResourceReady(Bitmap resource, Transition transition) { - if (listener != null) { - listener.onLoadComplete(resource); - } - } - - @Override - public void onLoadFailed(@Nullable Drawable errorDrawable) { - super.onLoadFailed(errorDrawable); - if (listener != null) { - listener.onLoadFailed(new Exception("获取图片失败!")); - } - } - }); - } - }); - - Unicorn.addUnreadCountChangeListener(listener, true); - Unicorn.addPushMessageListener(pushMessageListener); - } - - private UnreadCountChangeListener listener = new UnreadCountChangeListener() { // 声明一个成员变量 - @Override - public void onUnreadCountChange(int count) { - EventBus.getDefault().post(new CustomerServerMsgEvent(count)); - } - }; - - private OnPushMessageListener pushMessageListener = new OnPushMessageListener() { - @Override - public void onReceive(UnicornMessage message, PushMessageExtension extension) { - EventBus.getDefault().post(new CustomerServerMsgEvent(0)); - } - }; - - @Override - public Single contactCustomerServer(String uri, String title, String custom) { - return Single.create(new SingleOnSubscribe() { - @Override - public void subscribe(SingleEmitter e) throws Exception { - if (!isInit) { - e.onError(new Throwable("客服未初始化!")); - return; - } - if (UserModel.get().getCacheLoginUserInfo() == null) { - e.onError(new Throwable("无用户信息。")); - return; - } - if (!AuthModel.get().isImLogin()) { - e.onError(new Throwable("IM未登录")); - return; - } - - ConsultSource source = new ConsultSource(uri, title, custom); - Unicorn.openServiceActivity(getContext(), TITLE, source); - e.onSuccess("客服连接成功"); - } - }); - } - - @Override - public Single logout() { - Unicorn.addUnreadCountChangeListener(listener, false); - Unicorn.removePushMessageListener(pushMessageListener); - Unicorn.logout(); - isInit = false; // 切换帐号重新初始化 - return Single.just("客服系统登出成功."); - } - -} diff --git a/app/src/model_customer_server/java/com/yizhuan/xchat_android_core/customer_server/ICustomerServerModel.java b/app/src/model_customer_server/java/com/yizhuan/xchat_android_core/customer_server/ICustomerServerModel.java deleted file mode 100644 index 5bc8fe5a3..000000000 --- a/app/src/model_customer_server/java/com/yizhuan/xchat_android_core/customer_server/ICustomerServerModel.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.yizhuan.xchat_android_core.customer_server; - -import android.content.Context; - -import io.reactivex.Single; - -/** - * @author jack - * @Description - * @Date 2019/3/18 - */ -public interface ICustomerServerModel { - public void init(Context context); - - public Single contactCustomerServer(String uri, String title, String custom); - - Single logout(); -} diff --git a/app/src/model_customer_server/java/com/yizhuan/xchat_android_core/customer_server/bean/CustomerItemInfo.java b/app/src/model_customer_server/java/com/yizhuan/xchat_android_core/customer_server/bean/CustomerItemInfo.java deleted file mode 100644 index fd2e784d5..000000000 --- a/app/src/model_customer_server/java/com/yizhuan/xchat_android_core/customer_server/bean/CustomerItemInfo.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.yizhuan.xchat_android_core.customer_server.bean; - -/** - * @author jack - * @Description @link YSFUserInfo - * @Date 2019/3/18 - */ -public class CustomerItemInfo { - private String key;//数据项的名称,用于区别不同的数据。 - private int index;//用于排序,显示数据时数据项按index值升序排列;不设定index的数据项将排在后面;index相同或未设定的数据项将按照其在 JSON 中出现的顺序排列。 - private String label;//该项数据显示的名称。 - private String value;//该数据显示的值,类型不做限定,根据实际需要进行设定。 - private String href;//超链接地址。若指定该值,则该项数据将显示为超链接样式,点击后跳转到其值所指定的 URL 地址。 - private boolean hidden;//是否隐藏该item。目前仅对mobile和email有效。 - - - public CustomerItemInfo(String key) { - this.key = key; - } - - public CustomerItemInfo setIndex(int index) { - this.index = index; - return this; - } - - public CustomerItemInfo setLabel(String label) { - this.label = label; - return this; - } - - public CustomerItemInfo setValue(String value) { - this.value = value; - return this; - } - - public CustomerItemInfo setHref(String href) { - this.href = href; - return this; - } - - public CustomerItemInfo setHidden(boolean hidden) { - this.hidden = hidden; - return this; - } -} diff --git a/app/src/model_customer_server/java/com/yizhuan/xchat_android_core/customer_server/event/CustomerServerMsgEvent.java b/app/src/model_customer_server/java/com/yizhuan/xchat_android_core/customer_server/event/CustomerServerMsgEvent.java deleted file mode 100644 index ae0d4ca4a..000000000 --- a/app/src/model_customer_server/java/com/yizhuan/xchat_android_core/customer_server/event/CustomerServerMsgEvent.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.yizhuan.xchat_android_core.customer_server.event; - -/** - * @author jack - * @Description - * @Date 2019/3/19 - */ -public class CustomerServerMsgEvent { - public int unreadCount = 0; - - public CustomerServerMsgEvent(int count) { - this.unreadCount = count; - } -} diff --git a/app/src/model_customer_server/res/color/kf_button_color_state_list.xml b/app/src/model_customer_server/res/color/kf_button_color_state_list.xml deleted file mode 100644 index df67c36b5..000000000 --- a/app/src/model_customer_server/res/color/kf_button_color_state_list.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/src/model_customer_server/res/drawable/customer_server_title_bar_bg.xml b/app/src/model_customer_server/res/drawable/customer_server_title_bar_bg.xml deleted file mode 100644 index 944c72296..000000000 --- a/app/src/model_customer_server/res/drawable/customer_server_title_bar_bg.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/app/src/model_customer_server/res/drawable/shape_unread_msg_dot.xml b/app/src/model_customer_server/res/drawable/shape_unread_msg_dot.xml deleted file mode 100644 index 767193e1e..000000000 --- a/app/src/model_customer_server/res/drawable/shape_unread_msg_dot.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - diff --git a/app/src/model_customer_server/res/layout/header_customer_server.xml b/app/src/model_customer_server/res/layout/header_customer_server.xml deleted file mode 100644 index b4a8d9815..000000000 --- a/app/src/model_customer_server/res/layout/header_customer_server.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/module_mini_world/java/com/yizhuan/erban/miniworld/activity/MiniWorldEditActivity.java b/app/src/module_mini_world/java/com/yizhuan/erban/miniworld/activity/MiniWorldEditActivity.java index 47f670983..65aa63b4a 100644 --- a/app/src/module_mini_world/java/com/yizhuan/erban/miniworld/activity/MiniWorldEditActivity.java +++ b/app/src/module_mini_world/java/com/yizhuan/erban/miniworld/activity/MiniWorldEditActivity.java @@ -26,7 +26,6 @@ import com.yizhuan.erban.miniworld.viewmodel.MiniWorldEditableInfoVM; import com.yizhuan.erban.miniworld.widget.MiniWorldEditChooseClassifyDialog; import com.yizhuan.erban.ui.utils.ImageLoadUtils; import com.yizhuan.erban.ui.widget.ButtonItem; -import com.yizhuan.xchat_android_core.customer_server.CustomerServerModel; import com.yizhuan.xchat_android_core.file.FileModel; import com.yizhuan.xchat_android_core.statistic.StatisticManager; import com.yizhuan.xchat_android_core.statistic.protocol.StatisticsProtocol; @@ -315,8 +314,6 @@ public class MiniWorldEditActivity extends BaseMvpActivity