From 08118d989d0c985a9fefee6c4238e5830e896bf4 Mon Sep 17 00:00:00 2001 From: hu <799305676@qq.com> Date: Fri, 29 Mar 2019 17:46:27 +0800 Subject: [PATCH 01/65] =?UTF-8?q?5.x=20beta=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- udesksdk/.idea/gradle.xml | 39 +- udesksdk/.idea/misc.xml | 70 +- udesksdk/.idea/modules.xml | 21 +- udesksdk/UdeskSDKUI/build.gradle | 19 +- udesksdk/UdeskSDKUI/libs/udesk_sdk_4.1.6.jar | Bin 101408 -> 0 bytes .../UdeskSDKUI/src/main/AndroidManifest.xml | 8 - .../src/main/java/cn/udesk/JsonUtils.java | 1171 ++++-- .../main/java/cn/udesk/UdeskSDKManager.java | 301 +- .../src/main/java/cn/udesk/UdeskUtil.java | 669 +++- .../cn/udesk/activity/MessageAdatper.java | 1963 ---------- .../cn/udesk/activity/NavigationFragment.java | 12 +- .../activity/UdeskBaseWebViewActivity.java | 2 +- .../cn/udesk/activity/UdeskChatActivity.java | 3165 ++++++++--------- .../cn/udesk/activity/UdeskFormActivity.java | 5 +- .../udesk/activity/UdeskHelperActivity.java | 9 +- .../activity/UdeskHelperArticleActivity.java | 7 +- .../UdeskOptionsAgentGroupActivity.java | 112 +- .../cn/udesk/activity/UdeskRobotActivity.java | 185 - .../udesk/activity/UdeskWebChromeClient.java | 8 +- .../activity/UdeskWebViewUrlAcivity.java | 8 +- .../udesk/activity/UdeskZoomImageActivty.java | 55 +- .../cn/udesk/adapter/NavigationAdapter.java | 15 +- .../java/cn/udesk/adapter/SurvyAdapter.java | 4 - .../java/cn/udesk/adapter/TagAdapter.java | 2 - .../callback/IFunctionItemClickCallBack.java | 4 +- .../INavigationItemClickCallBack.java | 6 +- .../java/cn/udesk/camera/CameraInterface.java | 10 +- .../java/cn/udesk/camera/CaptureButton.java | 14 +- .../java/cn/udesk/camera/UdeskCameraView.java | 6 +- .../udesk/camera/state/BorrowVideoState.java | 4 +- .../cn/udesk/camera/util/CameraParamUtil.java | 1 + .../config/ImagePipelineConfigFactory.java | 4 +- .../java/cn/udesk/config/UdeskConfig.java | 99 +- .../main/java/cn/udesk/db/UdeskDBManager.java | 159 +- .../java/cn/udesk/emotion/EmojiManager.java | 3 +- .../cn/udesk/emotion/EmotionKeyboard.java | 6 +- .../java/cn/udesk/emotion/EmotionLayout.java | 7 +- .../emotion/EmotionViewPagerAdapter.java | 8 +- .../main/java/cn/udesk/emotion/MoonUtils.java | 9 +- .../java/cn/udesk/emotion/MyImageSpan.java | 1 + .../cn/udesk/messagemanager/Concurrents.java | 38 - .../messagemanager/UdeskMessageManager.java | 303 -- .../messagemanager/UdeskXmppManager.java | 276 +- .../java/cn/udesk/model/AgentGroupNode.java | 27 +- .../java/cn/udesk/model/OptionsModel.java | 22 +- .../java/cn/udesk/model/SDKIMSetting.java | 298 -- .../cn/udesk/model/SurveyOptionsModel.java | 25 +- .../java/cn/udesk/permission/RequestCode.java | 1 + .../cn/udesk/permission/XPermissionUtils.java | 12 +- .../udesk/photoselect/LocalMedialLoader.java | 6 +- .../photoselect/adapter/FolderAdapter.java | 3 +- .../photoselect/adapter/PhotosAdapter.java | 7 +- .../adapter/PreviewPhotosAdapter.java | 2 +- .../adapter/PreviewPhotosFragmentAdapter.java | 2 +- .../presenter/ChatActivityPresenter.java | 2143 ----------- .../cn/udesk/presenter/IChatActivityView.java | 49 - .../java/cn/udesk/presenter/MessageCache.java | 159 - .../cn/udesk/voice/AudioRecordButton.java | 8 +- .../cn/udesk/voice/AudioRecordManager.java | 2 + .../main/java/cn/udesk/voice/RecordPlay.java | 2 +- .../udesk/widget/UDPullGetMoreListView.java | 2 + .../udesk/widget/UdeskConfirmPopWindow.java | 2 +- .../udesk/widget/UdeskExpandableLayout.java | 30 +- .../cn/udesk/widget/UdeskSurvyPopwindow.java | 13 +- .../java/cn/udesk/widget/UdeskTitleBar.java | 242 +- .../res/drawable-xhdpi/udesk_ic_cheat_add.png | Bin 2756 -> 0 bytes .../res/drawable-xhdpi/udesk_ic_cheat_emo.png | Bin 3534 -> 0 bytes .../udesk_ic_cheat_keyboard.png | Bin 3095 -> 0 bytes .../drawable-xhdpi/udesk_ic_cheat_voice.png | Bin 3859 -> 0 bytes .../udesk_im_default_agent_avatar.png | Bin 8490 -> 1191 bytes .../udesk_im_record_left_default.png | Bin 2239 -> 925 bytes .../udesk_im_record_left_play1.png | Bin 1217 -> 575 bytes .../udesk_im_record_left_play2.png | Bin 467 -> 298 bytes .../udesk_im_record_right_default.png | Bin 1446 -> 666 bytes .../udesk_im_record_right_play1.png | Bin 786 -> 422 bytes .../udesk_im_record_right_play2.png | Bin 372 -> 224 bytes .../res/drawable-xhdpi/udesk_im_retry.png | Bin 2069 -> 463 bytes .../drawable-xhdpi/udesk_titlebar_back.png | Bin 469 -> 561 bytes .../main/res/drawable/udesk_navigation_bg.xml | 8 +- .../src/main/res/layout/udesk_activity_im.xml | 188 +- .../res/layout/udesk_activity_preview.xml | 4 +- .../main/res/layout/udesk_activity_select.xml | 4 +- .../main/res/layout/udesk_chat_event_item.xml | 65 - .../res/layout/udesk_chat_in_line_item.xml | 99 - .../layout/udesk_chat_leavemsg_item_txt_l.xml | 93 - .../layout/udesk_chat_leavemsg_item_txt_r.xml | 90 - .../layout/udesk_chat_msg_item_audiot_l.xml | 105 - .../layout/udesk_chat_msg_item_audiot_r.xml | 106 - .../res/layout/udesk_chat_msg_item_file_l.xml | 142 - .../res/layout/udesk_chat_msg_item_file_r.xml | 138 - .../res/layout/udesk_chat_msg_item_imgt_l.xml | 118 - .../res/layout/udesk_chat_msg_item_imgt_r.xml | 105 - .../layout/udesk_chat_msg_item_location_r.xml | 108 - .../layout/udesk_chat_msg_item_product_r.xml | 117 - .../layout/udesk_chat_msg_item_redirect.xml | 65 - .../udesk_chat_msg_item_smallvideo_l.xml | 122 - .../udesk_chat_msg_item_smallvideo_r.xml | 116 - .../res/layout/udesk_chat_msg_item_txt_l.xml | 93 - .../res/layout/udesk_chat_msg_item_txt_r.xml | 90 - .../layout/udesk_chat_msg_item_video_l.xml | 97 - .../layout/udesk_chat_msg_item_video_r.xml | 93 - .../layout/udesk_chat_msg_itemstruct_l.xml | 153 - .../res/layout/udesk_chat_rich_item_txt.xml | 91 - .../res/layout/udesk_expandlayout_xml.xml | 4 +- .../res/layout/udesk_include_func_layout.xml | 2 +- .../layout/udesk_options_agentgroup_view.xml | 1 + .../src/main/res/layout/udesk_text_view.xml | 11 +- .../main/res/layout/udesk_zoom_imageview.xml | 21 +- .../res/layout/udesknavigatiion_fragment.xml | 4 +- .../src/main/res/values-en/udesk_strings.xml | 29 +- .../src/main/res/values-zh/udesk_strings.xml | 26 +- .../src/main/res/values/udesk_colors.xml | 31 +- .../src/main/res/values/udesk_dimens.xml | 19 +- .../src/main/res/values/udesk_strings.xml | 24 +- .../src/main/res/values/udesk_styles.xml | 13 +- udesksdk/settings.gradle | 2 +- udesksdk/udeskNewDemo/build.gradle | 1 + .../udeskNewDemo/src/main/AndroidManifest.xml | 4 +- .../sdk/demo/activity/NotificationUtils.java | 25 +- .../UdeskFuncationExampleActivity.java | 103 +- .../demo/activity/UdeskInitKeyActivity.java | 25 +- .../demo/activity/UdeskUseGuideActivity.java | 11 +- .../sdk/demo/jpush/ExampleApplication.java | 28 +- .../java/udesk/sdk/demo/jpush/MyReceiver.java | 2 +- .../src/main/res/drawable-hdpi/back.png | Bin 2828 -> 779 bytes .../res/drawable-hdpi/back_origin_normal.png | Bin 3341 -> 2232 bytes .../res/drawable-hdpi/back_origin_select.png | Bin 7182 -> 2286 bytes .../jpush_ic_richpush_actionbar_back.png | Bin 695 -> 402 bytes .../jpush_ic_richpush_actionbar_divider.png | Bin 181 -> 96 bytes .../src/main/res/drawable-hdpi/map_pin.png | Bin 3491 -> 1320 bytes .../res/drawable-hdpi/position_is_select.png | Bin 6542 -> 2100 bytes .../src/main/res/drawable-hdpi/search.png | Bin 3775 -> 1251 bytes .../layout/udesk_funcation_example_view.xml | 49 + .../main/res/layout/udesk_init_key_view.xml | 243 +- .../res/mipmap-xxxhdpi/udesk_agent_id.png | Bin 3185 -> 1164 bytes .../res/mipmap-xxxhdpi/udesk_agentgroupid.png | Bin 3747 -> 1573 bytes .../res/mipmap-xxxhdpi/udesk_checkbox.png | Bin 2896 -> 856 bytes .../udesk_conversion_bysetting_menu.png | Bin 2133 -> 850 bytes .../mipmap-xxxhdpi/udesk_conversion_tips.png | Bin 15000 -> 4752 bytes .../res/mipmap-xxxhdpi/udesk_form_table.png | Bin 10446 -> 3252 bytes .../res/mipmap-xxxhdpi/udesk_guide_bg.png | Bin 942565 -> 138330 bytes .../res/mipmap-xxxhdpi/udesk_help_tip.png | Bin 15351 -> 4956 bytes .../res/mipmap-xxxhdpi/udesk_init_key_bg.png | Bin 2692675 -> 281227 bytes .../main/res/mipmap-xxxhdpi/udesk_push.png | Bin 4277 -> 1740 bytes .../res/mipmap-xxxhdpi/udesk_redict_img.png | Bin 1135 -> 406 bytes .../udesk_send_commodity_link.png | Bin 1691 -> 510 bytes .../res/mipmap-xxxhdpi/udesk_uncheckbox.png | Bin 2161 -> 654 bytes .../res/mipmap-xxxhdpi/udesk_unread_msg.png | Bin 1026 -> 398 bytes .../mipmap-xxxhdpi/udesk_unread_msgcount.png | Bin 1904 -> 613 bytes .../res/mipmap-xxxhdpi/udesk_update_ui.png | Bin 3876 -> 1036 bytes .../mipmap-xxxhdpi/udesk_update_userinfo.png | Bin 4300 -> 1682 bytes .../main/res/mipmap-xxxhdpi/udesk_utils.png | Bin 24264 -> 7419 bytes .../src/main/res/values/strings.xml | 1 + .../src/main/res/values/style.xml | 7 +- udesksdk/udeskNewDemo/udeskNewDemo.iml | 330 +- udesksdk/udesksdk.iml | 2 +- .../src/main/java/udesk/udesksocket/Util.java | 17 +- .../floatview/FloatActionController.java | 8 +- .../floatview/FloatWindowManager.java | 9 +- udesksdk/udeskvideo/udeskvideo.iml | 286 +- 160 files changed, 4859 insertions(+), 10754 deletions(-) delete mode 100644 udesksdk/UdeskSDKUI/libs/udesk_sdk_4.1.6.jar delete mode 100644 udesksdk/UdeskSDKUI/src/main/java/cn/udesk/activity/MessageAdatper.java delete mode 100644 udesksdk/UdeskSDKUI/src/main/java/cn/udesk/activity/UdeskRobotActivity.java delete mode 100644 udesksdk/UdeskSDKUI/src/main/java/cn/udesk/messagemanager/Concurrents.java delete mode 100644 udesksdk/UdeskSDKUI/src/main/java/cn/udesk/messagemanager/UdeskMessageManager.java delete mode 100644 udesksdk/UdeskSDKUI/src/main/java/cn/udesk/model/SDKIMSetting.java delete mode 100644 udesksdk/UdeskSDKUI/src/main/java/cn/udesk/presenter/ChatActivityPresenter.java delete mode 100644 udesksdk/UdeskSDKUI/src/main/java/cn/udesk/presenter/IChatActivityView.java delete mode 100644 udesksdk/UdeskSDKUI/src/main/java/cn/udesk/presenter/MessageCache.java delete mode 100644 udesksdk/UdeskSDKUI/src/main/res/drawable-xhdpi/udesk_ic_cheat_add.png delete mode 100644 udesksdk/UdeskSDKUI/src/main/res/drawable-xhdpi/udesk_ic_cheat_emo.png delete mode 100644 udesksdk/UdeskSDKUI/src/main/res/drawable-xhdpi/udesk_ic_cheat_keyboard.png delete mode 100644 udesksdk/UdeskSDKUI/src/main/res/drawable-xhdpi/udesk_ic_cheat_voice.png delete mode 100644 udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_event_item.xml delete mode 100644 udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_in_line_item.xml delete mode 100644 udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_leavemsg_item_txt_l.xml delete mode 100644 udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_leavemsg_item_txt_r.xml delete mode 100644 udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_item_audiot_l.xml delete mode 100644 udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_item_audiot_r.xml delete mode 100644 udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_item_file_l.xml delete mode 100644 udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_item_file_r.xml delete mode 100644 udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_item_imgt_l.xml delete mode 100644 udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_item_imgt_r.xml delete mode 100644 udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_item_location_r.xml delete mode 100644 udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_item_product_r.xml delete mode 100644 udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_item_redirect.xml delete mode 100644 udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_item_smallvideo_l.xml delete mode 100644 udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_item_smallvideo_r.xml delete mode 100644 udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_item_txt_l.xml delete mode 100644 udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_item_txt_r.xml delete mode 100644 udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_item_video_l.xml delete mode 100644 udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_item_video_r.xml delete mode 100644 udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_itemstruct_l.xml delete mode 100644 udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_rich_item_txt.xml diff --git a/udesksdk/.idea/gradle.xml b/udesksdk/.idea/gradle.xml index bfc07ca5..794fd16e 100644 --- a/udesksdk/.idea/gradle.xml +++ b/udesksdk/.idea/gradle.xml @@ -1,20 +1,21 @@ - - - - - + + + + + \ No newline at end of file diff --git a/udesksdk/.idea/misc.xml b/udesksdk/.idea/misc.xml index 08aeae22..e0d5b93f 100644 --- a/udesksdk/.idea/misc.xml +++ b/udesksdk/.idea/misc.xml @@ -1,34 +1,38 @@ - - - - - - - - - - - + + + + + + + + + + + \ No newline at end of file diff --git a/udesksdk/.idea/modules.xml b/udesksdk/.idea/modules.xml index 45649731..e6854e4c 100644 --- a/udesksdk/.idea/modules.xml +++ b/udesksdk/.idea/modules.xml @@ -1,11 +1,12 @@ - - - - - - - - - - + + + + + + + + + + + \ No newline at end of file diff --git a/udesksdk/UdeskSDKUI/build.gradle b/udesksdk/UdeskSDKUI/build.gradle index 62a085d0..37be39c7 100644 --- a/udesksdk/UdeskSDKUI/build.gradle +++ b/udesksdk/UdeskSDKUI/build.gradle @@ -27,14 +27,17 @@ android { } dependencies { - api fileTree(include: ['*.jar'], dir: 'libs') - api files('libs/bugly_crash_release_2.1.jar') - api files('libs/udesk-asmack-8-4.0.6.jar') - api 'com.qiniu:qiniu-android-sdk:7.3.12' + implementation fileTree(include: ['*.jar'], dir: 'libs') api 'com.android.support:appcompat-v7:26.1.0' api 'com.android.support:recyclerview-v7:26.1.0' - implementation 'com.facebook.fresco:fresco:1.3.0' - implementation 'com.facebook.fresco:animated-gif:1.3.0' - implementation 'me.relex:photodraweeview:1.1.3' - implementation files('libs/udesk_sdk_4.1.6.jar') + api files('libs/bugly_crash_release_2.1.jar') + api files('libs/udesk-asmack-8-4.0.6.jar') + api 'com.facebook.fresco:fresco:1.3.0' + api 'com.facebook.fresco:animated-gif:1.3.0' + api 'me.relex:photodraweeview:1.1.3' + api 'android.arch.lifecycle:extensions:1.1.1' + api 'com.squareup.okhttp3:logging-interceptor:3.8.1' + api 'com.squareup.okhttp3:okhttp:3.12.1' + api 'org.ccil.cowan.tagsoup:tagsoup:1.2.1' + api files('libs/udesk_sdk_5.0.0.jar') } diff --git a/udesksdk/UdeskSDKUI/libs/udesk_sdk_4.1.6.jar b/udesksdk/UdeskSDKUI/libs/udesk_sdk_4.1.6.jar deleted file mode 100644 index 845fad2c1a6b40572f6a1e45289b26a49b1a6412..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 101408 zcma&NV|Zpw+cg;5wr$(C&5mumW83W5>X;qdb|+V?j?KxVnfJcGdES}h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&MXLC)+CRZG|Uu%D4L5T7TUgqftWnZ%u6VqtsE8}t~^YbSj=QU zD6E2w`NNL9vLz0DVu}L{G(nD-R8(s+hT5P - - parseListArticlesResult(String result) { List mList = new ArrayList(); try { JSONObject json = new JSONObject(result); - if (json.has("contents")) { + if (json.has("contents")&&!TextUtils.isEmpty(json.optString("contents"))){ JSONArray kownlegeArray = json.optJSONArray("contents"); if (kownlegeArray != null && kownlegeArray.length() > 0) { for (int i = 0; i < kownlegeArray.length(); i++) { @@ -54,7 +81,7 @@ public static UDHelperArticleContentItem parseArticleContentItem( UDHelperArticleContentItem item = null; try { JSONObject json = new JSONObject(result); - if (json.has("contents")) { + if (json.has("contents")&&!TextUtils.isEmpty(json.optString("contents"))) { JSONObject contents = json.optJSONObject("contents"); if (contents != null) { item = new UDHelperArticleContentItem(); @@ -77,7 +104,7 @@ public static AgentInfo parseAgentResult(String response) { } try { JSONObject json = new JSONObject(response); - if (json.has("result")) { + if (json.has("result")&&!TextUtils.isEmpty(json.optString("result"))) { JSONObject result = json.getJSONObject("result"); if (result.has("code")) { agentInfo.setAgentCode(result.getInt("code")); @@ -122,83 +149,84 @@ public static AgentInfo parseAgentResult(String response) { //解析设置的满意度调查选项 public static SurveyOptionsModel parseSurveyOptions(String response) { - SurveyOptionsModel optionsMode = new SurveyOptionsModel(); if (TextUtils.isEmpty(response)) { return optionsMode; } try { JSONObject json = new JSONObject(response); - JSONObject result = json.getJSONObject("result"); - if (result.has("enabled")) { - optionsMode.setEnabled(result.opt("enabled")); - } - if (result.has("remark_enabled")) { - optionsMode.setEnabled(result.opt("remark_enabled")); - } - if (result.has("remark")) { - optionsMode.setRemark(result.opt("remark")); - } - if (result.has("name")) { - optionsMode.setName(result.opt("name")); - } - if (result.has("title")) { - optionsMode.setTitle(result.opt("title")); - } - if (result.has("desc")) { - optionsMode.setDesc(result.opt("desc")); - } - if (result.has("show_type")) { - optionsMode.setType(result.opt("show_type")); - } + if (json.has("result") && !TextUtils.isEmpty(json.optString("result"))) { + JSONObject result = json.getJSONObject("result"); + if (result.has("enabled")) { + optionsMode.setEnabled(result.opt("enabled")); + } + if (result.has("remark_enabled")) { + optionsMode.setEnabled(result.opt("remark_enabled")); + } + if (result.has("remark")) { + optionsMode.setRemark(result.opt("remark")); + } + if (result.has("name")) { + optionsMode.setName(result.opt("name")); + } + if (result.has("title")) { + optionsMode.setTitle(result.opt("title")); + } + if (result.has("desc")) { + optionsMode.setDesc(result.opt("desc")); + } + if (result.has("show_type")) { + optionsMode.setType(result.opt("show_type")); + } - JSONObject contextObject = null; - if (result.has("text")) { - contextObject = result.getJSONObject("text"); - } else if (result.has("expression")) { - contextObject = result.getJSONObject("expression"); - } else if (result.has("star")) { - contextObject = result.getJSONObject("star"); - } + JSONObject contextObject = null; + if (result.has("text")) { + contextObject = result.getJSONObject("text"); + } else if (result.has("expression")) { + contextObject = result.getJSONObject("expression"); + } else if (result.has("star")) { + contextObject = result.getJSONObject("star"); + } - if (contextObject != null) { + if (contextObject != null) { - if (contextObject.has("default_option_id")) { - optionsMode.setDefault_option_id(contextObject.opt("default_option_id")); - } - if (contextObject.has("options")) { - List options = new ArrayList(); - JSONArray optionsArray = contextObject.optJSONArray("options"); - if (optionsArray != null && optionsArray.length() > 0) { - for (int i = 0; i < optionsArray.length(); i++) { - JSONObject data = optionsArray.optJSONObject(i); - OptionsModel optionItem = new OptionsModel(); - optionItem.setId(data.opt("id")); - optionItem.setEnabled(data.opt("enabled")); - if (!optionItem.getEnabled() && optionsMode.getType().equals("text")) { - continue; - } - optionItem.setText(data.opt("text")); - optionItem.setDesc(data.opt("desc")); - optionItem.setRemark_option(data.opt("remark_option")); - - if (data.has("tags")) { - List tags = new ArrayList(); - String tagStirng = UdeskUtils.objectToString(data.opt("tags")); - if (!TextUtils.isEmpty(tagStirng)) { - String[] tagsArray = tagStirng.split(","); - for (int k = 0; k < tagsArray.length; k++) { - Tag tag = new Tag(); - tag.setText(tagsArray[k]); - tags.add(tag); + if (contextObject.has("default_option_id")) { + optionsMode.setDefault_option_id(contextObject.opt("default_option_id")); + } + if (contextObject.has("options")) { + List options = new ArrayList(); + JSONArray optionsArray = contextObject.optJSONArray("options"); + if (optionsArray != null && optionsArray.length() > 0) { + for (int i = 0; i < optionsArray.length(); i++) { + JSONObject data = optionsArray.optJSONObject(i); + OptionsModel optionItem = new OptionsModel(); + optionItem.setId(data.opt("id")); + optionItem.setEnabled(data.opt("enabled")); + if (!optionItem.getEnabled() && optionsMode.getType().equals("text")) { + continue; + } + optionItem.setText(data.opt("text")); + optionItem.setDesc(data.opt("desc")); + optionItem.setRemark_option(data.opt("remark_option")); + + if (data.has("tags")) { + List tags = new ArrayList(); + String tagStirng = UdeskUtils.objectToString(data.opt("tags")); + if (!TextUtils.isEmpty(tagStirng)) { + String[] tagsArray = tagStirng.split(","); + for (int k = 0; k < tagsArray.length; k++) { + Tag tag = new Tag(); + tag.setText(tagsArray[k]); + tags.add(tag); + } } + optionItem.setTags(tags); } - optionItem.setTags(tags); + options.add(optionItem); } - options.add(optionItem); } + optionsMode.setOptions(options); } - optionsMode.setOptions(options); } } } catch (JSONException e) { @@ -209,151 +237,6 @@ public static SurveyOptionsModel parseSurveyOptions(String response) { } - //解析请求导航页选项返回的结果 - public static List parseIMGroup(String response) { - - List groupsModel = null; - if (TextUtils.isEmpty(response)) { - return null; - } - - try { - JSONObject json = new JSONObject(response); - if (json.has("result")) { - groupsModel = new ArrayList(); - JSONArray optionsArray = json.optJSONArray("result"); - if (optionsArray != null && optionsArray.length() > 0) { - for (int i = 0; i < optionsArray.length(); i++) { - JSONObject data = optionsArray.optJSONObject(i); - AgentGroupNode model = new AgentGroupNode(); - model.setId(data.optString("id")); - model.setGroup_id(data.optString("group_id")); - model.setHas_next(data.optString("has_next")); - model.setItem_name(data.optString("item_name")); - model.setLink(data.optString("link")); - model.setParentId(data.optString("parentId")); - groupsModel.add(model); - } - } - - } - } catch (JSONException e) { - return null; - } - return groupsModel; - - } - - - public static String parserCustomers(JSONObject resultJson ) { - try { - if (resultJson.has("customer")) { - JSONObject customerJson = resultJson.getJSONObject("customer"); - if (customerJson.has("id")) { - return customerJson.getString("id"); - } - } - } catch (Exception e) { - e.printStackTrace(); - } - return ""; - } - - - //解析获取配置选项 - - public static SDKIMSetting parserIMSettingJson(String jsonString) { - SDKIMSetting sdkimSetting = new SDKIMSetting(); - try { - JSONObject rootJson = new JSONObject(jsonString); - if (rootJson.has("code")) { - sdkimSetting.setCode(rootJson.getInt("code")); - } - if (rootJson.has("message")) { - sdkimSetting.setMessage(rootJson.get("message")); - } - if (rootJson.has("result")) { - JSONObject resultJson = new JSONObject(rootJson.getString("result")); - if (resultJson != null) { - if (resultJson.has("enable_im_group")) { - sdkimSetting.setEnable_im_group(resultJson.get("enable_im_group")); - } - if (resultJson.has("in_session")) { - sdkimSetting.setIn_session(resultJson.get("in_session")); - } - if (resultJson.has("is_worktime")) { - sdkimSetting.setIs_worktime(resultJson.get("is_worktime")); - } - if (resultJson.has("has_robot")) { - sdkimSetting.setHas_robot(resultJson.get("has_robot")); - } - if (resultJson.has("enable_robot")) { - sdkimSetting.setEnable_robot(resultJson.get("enable_robot")); - } - if (resultJson.has("enable_sdk_robot")) { - sdkimSetting.setEnable_sdk_robot(resultJson.get("enable_sdk_robot")); - } - if (resultJson.has("enable_agent")) { - sdkimSetting.setEnable_agent(resultJson.get("enable_agent")); - } - if (resultJson.has("enable_web_im_feedback")) { - sdkimSetting.setEnable_web_im_feedback(resultJson.get("enable_web_im_feedback")); - } - if (resultJson.has("no_reply_hint")) { - sdkimSetting.setNo_reply_hint(resultJson.get("no_reply_hint")); - } - if (resultJson.has("investigation_when_leave")) { - sdkimSetting.setInvestigation_when_leave(resultJson.get("investigation_when_leave")); - } - if (resultJson.has("leave_message_type")) { - sdkimSetting.setLeave_message_type(resultJson.get("leave_message_type")); - } - if (resultJson.has("enable_im_survey")) { - sdkimSetting.setEnable_im_survey(resultJson.get("enable_im_survey")); - } - if (resultJson.has("robot")) { - sdkimSetting.setRobot(resultJson.get("robot")); - } - if (resultJson.has("vcall")) { - sdkimSetting.setVcall(resultJson.get("vcall")); - } - if (resultJson.has("vc_app_id")) { - sdkimSetting.setVc_app_id(resultJson.get("vc_app_id")); - } - if (resultJson.has("sdk_vcall")) { - sdkimSetting.setSdk_vcall(resultJson.get("sdk_vcall")); - } - if (resultJson.has("agora_app_id")) { - sdkimSetting.setAgora_app_id(resultJson.get("agora_app_id")); - } - if (resultJson.has("server_url")) { - sdkimSetting.setServer_url(resultJson.get("server_url")); - } - if (resultJson.has("vcall_token_url")) { - sdkimSetting.setVcall_token_url(resultJson.get("vcall_token_url")); - } - if (resultJson.has("im_survey_show_type")) { - sdkimSetting.setIm_survey_show_type(resultJson.opt("im_survey_show_type")); - } - if (resultJson.has("leave_message_guide")){ - sdkimSetting.setLeave_message_guide(resultJson.opt("leave_message_guide")); - } - if (resultJson.has("show_robot_times")){ - sdkimSetting.setShow_robot_times(resultJson.opt("show_robot_times")); - } - if (resultJson.has("robot_name")){ - sdkimSetting.setRobot_name(resultJson.opt("robot_name")); - } - } - } - - - } catch (Exception e) { - } - - return sdkimSetting; - } - public static StructModel parserStructMsg(String jsonString) { StructModel structModel = new StructModel(); try { @@ -400,8 +283,6 @@ public static TicketReplieMode parserTicketReplie(String jsonString) { TicketReplieMode replieMode = new TicketReplieMode(); try { JSONObject rootJson = new JSONObject(jsonString); - - if (rootJson.has("size")) { replieMode.setSize(rootJson.getInt("size")); } @@ -412,7 +293,7 @@ public static TicketReplieMode parserTicketReplie(String jsonString) { replieMode.setTotal_pages(rootJson.getInt("total_pages")); } - if (rootJson.has("contents")) { + if (rootJson.has("contents")&&!TextUtils.isEmpty(rootJson.optString("contents"))) { JSONArray contentsArray = rootJson.optJSONArray("contents"); List contents = new ArrayList(); if (contentsArray != null && contentsArray.length() > 0) { @@ -457,84 +338,838 @@ public static TicketReplieMode parserTicketReplie(String jsonString) { } - public static List parseMessages(String messages) { + public static JSONObject getProduceJson(Product mProduct) { + JSONObject jsonObject = new JSONObject(); + try { + if (!TextUtils.isEmpty(mProduct.getName())) { + jsonObject.put("name", mProduct.getName()); + } + if (!TextUtils.isEmpty(mProduct.getUrl())) { + jsonObject.put("url", mProduct.getUrl()); + } + if (!TextUtils.isEmpty(mProduct.getImgUrl())) { + jsonObject.put("imgUrl", mProduct.getImgUrl()); + } + List params = mProduct.getParams(); + if (params != null && params.size() > 0) { + JSONArray jsonsArray = new JSONArray(); + for (Product.ParamsBean paramsBean : params) { + JSONObject param = new JSONObject(); + param.put("text", paramsBean.getText()); + param.put("color", paramsBean.getColor()); + param.put("fold", paramsBean.isFold()); + param.put("break", paramsBean.isBreakX()); + param.put("size", paramsBean.getSize()); + jsonsArray.put(param); + } + + jsonObject.put("params", jsonsArray); + } + } catch (Exception e) { + e.printStackTrace(); + } + return jsonObject; + } + + public static JSONObject getReplyProductJson(ProductListBean bean) { + JSONObject jsonObject = new JSONObject(); + try { + if (!TextUtils.isEmpty(bean.getName())) { + jsonObject.put("name", bean.getName()); + } + if (!TextUtils.isEmpty(bean.getUrl())) { + jsonObject.put("url", bean.getUrl()); + } + if (!TextUtils.isEmpty(bean.getImage())) { + jsonObject.put("image", bean.getImage()); + } + if (0 != bean.getId()) { + jsonObject.put("id", bean.getId()); + } + if (bean.getInfoList() != null && bean.getInfoList().size() > 0) { + List infoList = bean.getInfoList(); + JSONArray jsonsArray = new JSONArray(); + for (InfoListBean infoListBean : infoList) { + JSONObject param = new JSONObject(); + param.put("boldFlag", infoListBean.getBoldFlag()); + param.put("color", infoListBean.getColor()); + param.put("info", infoListBean.getInfo()); + jsonsArray.put(param); + } + jsonObject.put("infoList", jsonsArray); + } + } catch (Exception e) { + e.printStackTrace(); + } + return jsonObject; + } + + //解析设置的满意度调查选项 + public static RobotInit parseRobotInit(String response) { - List logMessages = new ArrayList<>(); + RobotInit robotInit = new RobotInit(); + if (TextUtils.isEmpty(response)) { + return robotInit; + } try { - JSONObject root = new JSONObject(messages); + JSONObject root = new JSONObject(response); + robotInit.setCode(root.opt("code")); + robotInit.setMessage(root.opt("message")); + if (root.has("session_info")&&!TextUtils.isEmpty(root.optString("session_info"))) { + JSONObject sessionInfo = root.getJSONObject("session_info"); + robotInit.setCode(sessionInfo.opt("code")); + robotInit.setMessage(sessionInfo.opt("message")); + robotInit.setStatus(sessionInfo.opt("status")); + robotInit.setSessionId(sessionInfo.opt("sessionId")); + robotInit.setLogId(sessionInfo.opt("logId")); + robotInit.setSwitchStaffTips(sessionInfo.opt("switchStaffTips")); + robotInit.setSwitchStaffType(sessionInfo.opt("switchStaffType")); + if (sessionInfo.has("webConfig")) { + WebConfigBean webConfigBean = new WebConfigBean(); + JSONObject webConfig = sessionInfo.getJSONObject("webConfig"); + webConfigBean.setRobotName(webConfig.opt("robotName")); + webConfigBean.setLogoUrl(webConfig.opt("logoUrl")); + webConfigBean.setLeadingWord(webConfig.opt("leadingWord")); + webConfigBean.setHelloWord(webConfig.opt("helloWord")); + robotInit.setWebConfig(webConfigBean); + } + if (sessionInfo.has("topAsk")) { + List topAskList = new ArrayList<>(); + JSONArray topAskArray = sessionInfo.getJSONArray("topAsk"); + if (topAskArray != null && topAskArray.length() > 0) { + for (int i = 0; i < topAskArray.length(); i++) { + JSONObject topAsk = topAskArray.optJSONObject(i); + TopAskBean topAskBean = new TopAskBean(); + topAskBean.setQuestionType(topAsk.opt("questionType")); + topAskBean.setQuestionTypeId(topAsk.opt("questionTypeId")); + if (topAsk.has("optionsList")) { + List optionsLists = new ArrayList<>(); + JSONArray optionsListArray = topAsk.getJSONArray("optionsList"); + if (optionsListArray != null && optionsListArray.length() > 0) { + for (int k = 0; k < optionsListArray.length(); k++) { + JSONObject optionsList = optionsListArray.optJSONObject(k); + OptionsListBean optionsListBean = new OptionsListBean(); + optionsListBean.setQuestion(optionsList.opt("question")); + optionsListBean.setQuestionId(optionsList.opt("questionId")); + + optionsLists.add(optionsListBean); + } + } + topAskBean.setOptionsList(optionsLists); + } + topAskList.add(topAskBean); + + } + } + robotInit.setTopAsk(topAskList); + } + } - if (root.has("messages")) { + } catch (JSONException e) { + e.printStackTrace(); + } + return robotInit; + } + + public static RobotTipBean parseRobotTip(String response) { + RobotTipBean bean = new RobotTipBean(); + if (TextUtils.isEmpty(response)) { + return bean; + } + try { + JSONObject root = new JSONObject(response); + bean.setCode(root.opt("code")); + bean.setMessage(root.opt("message")); + if (root.has("list") && !TextUtils.isEmpty(root.optString("list"))) { + List tipList = new ArrayList<>(); + JSONArray tipArray = root.getJSONArray("list"); + if (tipArray != null && tipArray.length() > 0) { + for (int i = 0; i < tipArray.length(); i++) { + JSONObject tip = tipArray.optJSONObject(i); + RobotTipBean.ListBean tipListBean = new RobotTipBean.ListBean(); + tipListBean.setQuestionId(tip.opt("questionId")); + tipListBean.setQuestion(tip.opt("question")); + tipListBean.setType(tip.opt("type")); + tipList.add(tipListBean); + } + } + bean.setList(tipList); + } + } catch (Exception e) { + e.printStackTrace(); + } + return bean; + } + + //AllMessageMode + public static AllMessageMode parseMessage(String response) { + AllMessageMode allMessageMode = new AllMessageMode(); + if (TextUtils.isEmpty(response)) { + return allMessageMode; + } + try { + JSONObject root = new JSONObject(response); + allMessageMode.setCode(root.opt("code")); + allMessageMode.setMore_marking(root.opt("more_marking")); + allMessageMode.setMessage(root.opt("message")); + if (root.has("messages") && !TextUtils.isEmpty(root.optString("messages"))) { + List logMessages = new ArrayList<>(); JSONArray messagesArray = root.getJSONArray("messages"); if (messagesArray != null && messagesArray.length() > 0) { for (int i = 0; i < messagesArray.length(); i++) { - LogMessage logMessage = new LogMessage(); - JSONObject messageObject = messagesArray.optJSONObject(i); - logMessage.setId(messageObject.opt("id")); - logMessage.setAgentJId(messageObject.opt("agent_jid")); - logMessage.setUser_id(messageObject.opt("user_id")); - logMessage.setReply_user_type(messageObject.opt("reply_user_type")); - logMessage.setStatus(messageObject.opt("status")); - logMessage.setSend_status(messageObject.opt("send_status")); - logMessage.setMessage_id(messageObject.opt("message_id")); - logMessage.setCreated_at(messageObject.opt("created_at")); - logMessage.setAgent_id(messageObject.opt("agent_id")); - logMessage.setAgent_nick_name(messageObject.opt("agent_nick_name")); - logMessage.setAgent_avatar(messageObject.opt("agent_avatar")); - if (messageObject.has("im_sub_session_id")) { - logMessage.setIm_sub_session_id(messageObject.opt("im_sub_session_id")); - } + JSONObject log = messagesArray.getJSONObject(i); + LogBean logBean = new LogBean(); + logBean.setAgent_avatar(log.opt("agent_avatar")); + logBean.setAgent_id(log.opt("agent_id")); + logBean.setAgent_jid(log.opt("agent_jid")); + logBean.setAgent_nick_name(log.opt("agent_nick_name")); + logBean.setContent_raw(log.opt("content_raw")); + logBean.setCreated_at(log.opt("created_at")); + logBean.setCreated_time(log.opt("created_time")); + logBean.setCustomer_id(log.opt("customer_id")); + logBean.setId(log.opt("id")); + logBean.setLog_type(log.opt("log_type")); + logBean.setLogId(log.opt("logId")); + logBean.setMessage_id(log.opt("message_id")); + logBean.setNow(log.opt("now")); + logBean.setSender(log.opt("sender")); + logBean.setSession_type(log.opt("session_type")); + logBean.setUpdated_at(log.opt("updated_at")); + logBean.setSend_status(log.opt("send_status")); + logBean.setIm_sub_session_id(log.opt("im_sub_session_id")); + logBean.setOrder(log.opt("order")); - if (messageObject.has("content")) { - JSONObject contentJson = messageObject.getJSONObject("content"); + if (log.has("content")) { + JSONObject content = log.getJSONObject("content"); + Content contentBean = new Content(); + contentBean.setType(content.opt("type")); + contentBean.setPush_type(content.opt("push_type")); + contentBean.setFont(content.opt("font")); + contentBean.setPlatform(content.opt("platform")); + contentBean.setVersion(content.opt("version")); + contentBean.setAuto(content.opt("auto")); + contentBean.setSeq_num(content.opt("seq_num")); + contentBean.setIm_sub_session_id(content.opt("im_sub_session_id")); - logMessage.setType(contentJson.optString("type")); - logMessage.setPlatform(contentJson.opt("platform")); - logMessage.setVersion(contentJson.opt("version")); + if (content.has("data")) { + DataBean dataBean = new DataBean(); + JSONObject data = content.getJSONObject("data"); + dataBean.setContent(data.opt("content")); + dataBean.setSwitchStaffType(data.opt("switchStaffType")); + dataBean.setSwitchStaffTips(data.opt("switchStaffTips")); + dataBean.setQuesition_id(data.opt("question_id")); + dataBean.setTimeout_freq(data.opt("timeout_freq")); + dataBean.setDuration(data.opt("duration")); + dataBean.setFilename(data.opt("filename")); + dataBean.setFilesize(data.opt("filesize")); + dataBean.setFlowId(data.opt("flowId")); + dataBean.setFlowTitle(data.opt("flowTitle")); + dataBean.setFlowContent(data.opt("flowContent")); + if (data.has("topAsk")) { + List topAskList = new ArrayList<>(); + if (!TextUtils.isEmpty(data.optString("topAsk"))) { + Object topAskObject = new JSONTokener(data.optString("topAsk")).nextValue(); + if (topAskObject instanceof JSONArray) { + JSONArray topAskArray = data.getJSONArray("topAsk"); + if (topAskArray != null && topAskArray.length() > 0) { + for (int k = 0; k < topAskArray.length(); k++) { + JSONObject topAsk = topAskArray.optJSONObject(k); + TopAskBean topAskBean = new TopAskBean(); + topAskBean.setQuestionType(topAsk.opt("questionType")); + topAskBean.setQuestionTypeId(topAsk.opt("questionTypeId")); + if (topAsk.has("optionsList")) { + List optionsLists = new ArrayList<>(); + JSONArray optionsListArray = topAsk.getJSONArray("optionsList"); + if (optionsListArray != null && optionsListArray.length() > 0) { + for (int j = 0; j < optionsListArray.length(); j++) { + JSONObject optionsList = optionsListArray.optJSONObject(j); + OptionsListBean optionsListBean = new OptionsListBean(); + optionsListBean.setQuestion(optionsList.opt("question")); + optionsListBean.setQuestionId(optionsList.opt("questionId")); - if (contentJson.has("filename")){ - logMessage.setFileName(contentJson.opt("filename")); - } - if (contentJson.has("filesize")){ - logMessage.setFileSize(contentJson.opt("filesize")); - } + optionsLists.add(optionsListBean); + } + } + topAskBean.setOptionsList(optionsLists); + } + topAskList.add(topAskBean); + } + } - if (contentJson.has("seq_num")) { - logMessage.setSeq_num(contentJson.opt("seq_num")); - } - if (contentJson.has("im_sub_session_id")) { - logMessage.setIm_sub_session_id(contentJson.opt("im_sub_session_id")); + } else if (topAskObject instanceof JSONObject) { + JSONObject topAsk = data.getJSONObject("topAsk"); + TopAskBean topAskBean = new TopAskBean(); + topAskBean.setQuestionType(topAsk.opt("questionType")); + topAskBean.setQuestionTypeId(topAsk.opt("questionTypeId")); + if (topAsk.has("optionsList")) { + List optionsLists = new ArrayList<>(); + JSONArray optionsListArray = topAsk.getJSONArray("optionsList"); + if (optionsListArray != null && optionsListArray.length() > 0) { + for (int j = 0; j < optionsListArray.length(); j++) { + JSONObject optionsList = optionsListArray.optJSONObject(j); + OptionsListBean optionsListBean = new OptionsListBean(); + optionsListBean.setQuestion(optionsList.opt("question")); + optionsListBean.setQuestionId(optionsList.opt("questionId")); + optionsLists.add(optionsListBean); + } + } + topAskBean.setOptionsList(optionsLists); + } + topAskList.add(topAskBean); + } + dataBean.setTopAsk(topAskList); + } + } + contentBean.setData(dataBean); } + logBean.setContent(contentBean); + } + if (log.has("inviter")&&!TextUtils.isEmpty(log.optString("inviter"))){ + JSONObject inviter = log.getJSONObject("inviter"); + InviterAgentInfo inviterAgentInfo=new InviterAgentInfo(); + inviterAgentInfo.setAvatar(inviter.opt("avatar")); + inviterAgentInfo.setId(inviter.opt("id")); + inviterAgentInfo.setJid(inviter.opt("jid")); + inviterAgentInfo.setNick_name(inviter.opt("nick_name")); + logBean.setInviterAgentInfo(inviterAgentInfo); + } + logMessages.add(logBean); + } + } + allMessageMode.setMessages(logMessages); + } + } catch (Exception e) { + e.printStackTrace(); + } + return allMessageMode; - if (contentJson.has("data")) { - JSONObject dataObject = contentJson.getJSONObject("data"); - logMessage.setContent(dataObject.opt("content")); - if (dataObject.has("seq_num")) { - logMessage.setSeq_num(dataObject.opt("seq_num")); - } - if (dataObject.has("duration")) { - logMessage.setDuration(dataObject.opt("duration")); + } + + public static LogBean parseLogBean(String response) { + LogBean logBean = new LogBean(); + if (TextUtils.isEmpty(response)) { + return logBean; + } + try { + JSONObject root = new JSONObject(response); + logBean.setCode(root.opt("code")); + logBean.setMessage(root.opt("message")); + if (!TextUtils.isEmpty(root.optString("log"))&&root.has("log")) { + JSONObject log = root.getJSONObject("log"); + logBean.setAgent_avatar(log.opt("agent_avatar")); + logBean.setAgent_id(log.opt("agent_id")); + logBean.setAgent_jid(log.opt("agent_jid")); + logBean.setAgent_nick_name(log.opt("agent_nick_name")); + logBean.setContent_raw(log.opt("content_raw")); + logBean.setCreated_at(log.opt("created_at")); + logBean.setCreated_time(log.opt("created_time")); + logBean.setCustomer_id(log.opt("customer_id")); + logBean.setId(log.opt("id")); + logBean.setLog_type(log.opt("log_type")); + logBean.setLogId(log.opt("logId")); + logBean.setMessage_id(log.opt("message_id")); + logBean.setNow(log.opt("now")); + logBean.setSender(log.opt("sender")); + logBean.setSession_type(log.opt("session_type")); + logBean.setUpdated_at(log.opt("updated_at")); + logBean.setSend_status(log.opt("send_status")); + logBean.setIm_sub_session_id(log.opt("im_sub_session_id")); + logBean.setOrder(log.opt("order")); + if (log.has("content")) { + JSONObject content = log.getJSONObject("content"); + Content contentBean = new Content(); + contentBean.setType(content.opt("type")); + contentBean.setPush_type(content.opt("push_type")); + contentBean.setFont(content.opt("font")); + contentBean.setPlatform(content.opt("platform")); + contentBean.setVersion(content.opt("version")); + contentBean.setAuto(content.opt("auto")); + contentBean.setSeq_num(content.opt("seq_num")); + contentBean.setIm_sub_session_id(content.opt("im_sub_session_id")); + if (content.has("data")) { + DataBean dataBean = new DataBean(); + JSONObject data = content.getJSONObject("data"); + dataBean.setContent(data.opt("content")); + dataBean.setSwitchStaffType(data.opt("switchStaffType")); + dataBean.setSwitchStaffTips(data.opt("switchStaffTips")); + dataBean.setQuesition_id(data.opt("question_id")); + dataBean.setTimeout_freq(data.opt("timeout_freq")); + dataBean.setDuration(data.opt("duration")); + dataBean.setFilename(data.opt("filename")); + dataBean.setFilesize(data.opt("filesize")); + dataBean.setFlowId(data.opt("flowId")); + dataBean.setFlowTitle(data.opt("flowTitle")); + dataBean.setFlowContent(data.opt("flowContent")); + if (data.has("topAsk")) { + List topAskList = new ArrayList<>(); + if (!TextUtils.isEmpty(data.optString("topAsk"))) { + Object topAskObject = new JSONTokener(data.optString("topAsk")).nextValue(); + if (topAskObject instanceof JSONArray) { + JSONArray topAskArray = data.getJSONArray("topAsk"); + if (topAskArray != null && topAskArray.length() > 0) { + for (int k = 0; k < topAskArray.length(); k++) { + JSONObject topAsk = topAskArray.optJSONObject(k); + TopAskBean topAskBean = new TopAskBean(); + topAskBean.setQuestionType(topAsk.opt("questionType")); + topAskBean.setQuestionTypeId(topAsk.opt("questionTypeId")); + if (topAsk.has("optionsList")) { + List optionsLists = new ArrayList<>(); + JSONArray optionsListArray = topAsk.getJSONArray("optionsList"); + if (optionsListArray != null && optionsListArray.length() > 0) { + for (int j = 0; j < optionsListArray.length(); j++) { + JSONObject optionsList = optionsListArray.optJSONObject(j); + OptionsListBean optionsListBean = new OptionsListBean(); + optionsListBean.setQuestion(optionsList.opt("question")); + optionsListBean.setQuestionId(optionsList.opt("questionId")); + + optionsLists.add(optionsListBean); + } + } + topAskBean.setOptionsList(optionsLists); + } + topAskList.add(topAskBean); + } + } + + } else if (topAskObject instanceof JSONObject) { + JSONObject topAsk = data.getJSONObject("topAsk"); + TopAskBean topAskBean = new TopAskBean(); + topAskBean.setQuestionType(topAsk.opt("questionType")); + topAskBean.setQuestionTypeId(topAsk.opt("questionTypeId")); + if (topAsk.has("optionsList")) { + List optionsLists = new ArrayList<>(); + JSONArray optionsListArray = topAsk.getJSONArray("optionsList"); + if (optionsListArray != null && optionsListArray.length() > 0) { + for (int j = 0; j < optionsListArray.length(); j++) { + JSONObject optionsList = optionsListArray.optJSONObject(j); + OptionsListBean optionsListBean = new OptionsListBean(); + optionsListBean.setQuestion(optionsList.opt("question")); + optionsListBean.setQuestionId(optionsList.opt("questionId")); + + optionsLists.add(optionsListBean); + } + } + topAskBean.setOptionsList(optionsLists); + } + topAskList.add(topAskBean); } - if (dataObject.has("filename")){ - logMessage.setFileName(dataObject.opt("filename")); + } + + dataBean.setTopAsk(topAskList); + } + contentBean.setData(dataBean); + } + logBean.setContent(contentBean); + } + if (log.has("inviter")&&!TextUtils.isEmpty(log.optString("inviter"))){ + JSONObject inviter = log.getJSONObject("inviter"); + InviterAgentInfo inviterAgentInfo=new InviterAgentInfo(); + inviterAgentInfo.setAvatar(inviter.opt("avatar")); + inviterAgentInfo.setId(inviter.opt("id")); + inviterAgentInfo.setJid(inviter.opt("jid")); + inviterAgentInfo.setNick_name(inviter.opt("nick_name")); + logBean.setInviterAgentInfo(inviterAgentInfo); + } + } + } catch (Exception e) { + e.printStackTrace(); + } + return logBean; + } + + //解析设置的满意度调查选项 + public static BaseMode parseAnswerSurvey(String response) { + + BaseMode baseMode = new BaseMode(); + if (TextUtils.isEmpty(response)) { + return baseMode; + } + try { + JSONObject root = new JSONObject(response); + baseMode.setCode(root.opt("code")); + baseMode.setMessage(root.opt("message")); + } catch (JSONException e) { + e.printStackTrace(); + } + return baseMode; + + } + + public static StrucTableBean parseStrucTable(String response) { + StrucTableBean strucTableBean = new StrucTableBean(); + if (TextUtils.isEmpty(response)) { + return strucTableBean; + } + try { + JSONObject root = new JSONObject(response); + strucTableBean.setTitle(root.opt("title")); + strucTableBean.setColumnNumber(root.opt("columnNumber")); + strucTableBean.setRowNumber(root.opt("rowNumber")); + if (root.has("optionList")) { + List listBeanList = new ArrayList<>(); + JSONArray optionList = root.getJSONArray("optionList"); + if (optionList != null && optionList.length() > 0) { + for (int i = 0; i < optionList.length(); i++) { + StrucTableBean.OptionListBean optionListBean = new StrucTableBean.OptionListBean(); + JSONObject object = optionList.getJSONObject(i); + optionListBean.setId(object.opt("id")); + optionListBean.setValue(object.opt("value")); + listBeanList.add(optionListBean); + } + } + strucTableBean.setOptionList(listBeanList); + } + } catch (Exception e) { + e.printStackTrace(); + } + return strucTableBean; + } + + public static UploadBean parseUploadBean(String response) { + UploadBean uploadBean = new UploadBean(); + if (TextUtils.isEmpty(response)) { + return uploadBean; + } + try { + JSONObject root = new JSONObject(response); + uploadBean.setCode(root.opt("code")); + uploadBean.setMessage(root.opt("message")); + if (root.has("upload_service")) { + JSONObject upload_service = root.getJSONObject("upload_service"); + uploadBean.setKey(upload_service.opt("key")); + uploadBean.setMarking(upload_service.opt("marking")); + uploadBean.setReferer(upload_service.opt("referer")); + if (upload_service.has("upload_token")) { + JSONObject upload_token = upload_service.getJSONObject("upload_token"); + UploadBean.UploadTokenBean uploadTokenBean = new UploadBean.UploadTokenBean(); + uploadTokenBean.setAccessid(upload_token.opt("accessid")); + uploadTokenBean.setBucket(upload_token.opt("bucket")); + uploadTokenBean.setCallback(upload_token.opt("callback")); + uploadTokenBean.setDir(upload_token.opt("dir")); + uploadTokenBean.setExpire(upload_token.opt("expire")); + uploadTokenBean.setFields(upload_token.opt("fields")); + uploadTokenBean.setHost(upload_token.opt("host")); + uploadTokenBean.setPolicy(upload_token.opt("policy")); + uploadTokenBean.setSignature(upload_token.opt("signature")); + uploadTokenBean.setStorage_policy(upload_token.opt("storage_policy")); + uploadTokenBean.setToken(upload_token.opt("token")); + uploadBean.setUpload_token(uploadTokenBean); + } + } + } catch (Exception e) { + e.printStackTrace(); + } + return uploadBean; + } + + public static ShowProductBean parseShowProduct(String response) { + ShowProductBean showProductBean = new ShowProductBean(); + if (TextUtils.isEmpty(response)) { + return showProductBean; + } + try { + JSONObject root = new JSONObject(response); + showProductBean.setShowSize(root.opt("showSize")); + showProductBean.setTitle(root.opt("title")); + showProductBean.setTurnFlag(root.opt("turnFlag")); + if (root.has("productList")) { + List productListBeanList = new ArrayList<>(); + JSONArray productList = root.getJSONArray("productList"); + if (productList != null && productList.length() > 0) { + for (int i = 0; i < productList.length(); i++) { + ProductListBean productListBean = parseReplyProduct(productList.getJSONObject(i).toString()); + productListBeanList.add(productListBean); + } + } + showProductBean.setProductList(productListBeanList); + } + } catch (Exception e) { + e.printStackTrace(); + } + + return showProductBean; + } + + public static LinkBean parseLinkBean(String response) { + LinkBean linkBean = new LinkBean(); + if (TextUtils.isEmpty(response)) { + return linkBean; + } + try { + JSONObject root = new JSONObject(response); + linkBean.setAnswerUrl(root.opt("answerUrl")); + linkBean.setTitle(root.opt("title")); + linkBean.setFaviconUrl(root.opt("faviconUrl")); + } catch (Exception e) { + e.printStackTrace(); + } + return linkBean; + } + + public static WechatImageBean parseWechatImage(String response) { + WechatImageBean wechatImageBean = new WechatImageBean(); + if (TextUtils.isEmpty(response)) { + return wechatImageBean; + } + try { + JSONObject root = new JSONObject(response); + wechatImageBean.setAnswerUrl(root.opt("answerUrl")); + wechatImageBean.setContent(root.opt("content")); + wechatImageBean.setCoverUrl(root.opt("coverUrl")); + wechatImageBean.setDescription(root.opt("description")); + } catch (Exception e) { + e.printStackTrace(); + } + return wechatImageBean; + } + + public static ProductListBean parseReplyProduct(String response) { + ProductListBean productListBean = new ProductListBean(); + if (TextUtils.isEmpty(response)) { + return productListBean; + } + try { + JSONObject productListJSONObject = new JSONObject(response); + productListBean.setId(productListJSONObject.opt("id")); + productListBean.setImage(productListJSONObject.opt("image")); + productListBean.setName(productListJSONObject.opt("name")); + productListBean.setUrl(productListJSONObject.opt("url")); + if (productListJSONObject.has("infoList")) { + JSONArray infoList = productListJSONObject.getJSONArray("infoList"); + List infoListBeanList = new ArrayList<>(); + if (infoList != null && infoList.length() > 0) { + for (int j = 0; j < infoList.length(); j++) { + JSONObject infoListJSONObject = infoList.getJSONObject(j); + InfoListBean infoListBean = new InfoListBean(); + infoListBean.setBoldFlag(infoListJSONObject.opt("boldFlag")); + infoListBean.setColor(infoListJSONObject.opt("color")); + infoListBean.setInfo(infoListJSONObject.opt("info")); + infoListBeanList.add(infoListBean); + } + } + productListBean.setInfoList(infoListBeanList); + } + } catch (Exception e) { + e.printStackTrace(); + } + return productListBean; + } + + public static InitCustomerBean parseInitCustomer(String response) { + InitCustomerBean initCustomerBean = new InitCustomerBean(); + if (TextUtils.isEmpty(response)) { + return initCustomerBean; + } + try { + JSONObject root = new JSONObject(response); + initCustomerBean.setCode(root.opt("code")); + initCustomerBean.setMessage(root.opt("message")); + + if (root.has("im")) { + IMInfo imInfo = new IMInfo(); + JSONObject imObject = root.optJSONObject("im"); + imInfo.setUsername(imObject.opt("username")); + imInfo.setPassword(imObject.opt("password")); + imInfo.setServer(imObject.opt("server")); + imInfo.setPort(imObject.opt("port")); + initCustomerBean.setIm(imInfo); + } + + if (root.has("upload_service")) { + JSONObject uploadServiceObject = root.optJSONObject("upload_service"); + UploadService uploadService = new UploadService(); + uploadService.setKey(uploadServiceObject.opt("key")); + uploadService.setMarking(uploadServiceObject.opt("marking")); + uploadService.setReferer(uploadServiceObject.opt("referer")); + if (uploadServiceObject.has("upload_token")) { + JSONObject uploadTokenObject = uploadServiceObject.optJSONObject("upload_token"); + UploadToken uploadToken = new UploadToken(); + uploadToken.setAccessid(uploadTokenObject.opt("accessid")); + uploadToken.setBucket(uploadServiceObject.opt("bucket")); + uploadToken.setCallback(uploadServiceObject.opt("callback")); + uploadToken.setDir(uploadServiceObject.opt("dir")); + uploadToken.setExpire(uploadServiceObject.opt("expire")); + uploadToken.setHost(uploadServiceObject.opt("host")); + uploadToken.setPolicy(uploadServiceObject.opt("policy")); + uploadToken.setSignature(uploadServiceObject.opt("signature")); + uploadToken.setStorage_policy(uploadServiceObject.opt("storage_policy")); + uploadToken.setToken(uploadTokenObject.opt("token")); + uploadService.setUpload_token(uploadToken); + } + initCustomerBean.setUploadService(uploadService); + } + + if (root.has("im_survey")) { + SurveyOptionsModel optionsMode = new SurveyOptionsModel(); + JSONObject result = root.getJSONObject("im_survey"); + if (result.has("enabled")) { + optionsMode.setEnabled(result.opt("enabled")); + } + if (result.has("remark_enabled")) { + optionsMode.setEnabled(result.opt("remark_enabled")); + } + if (result.has("remark")) { + optionsMode.setRemark(result.opt("remark")); + } + if (result.has("name")) { + optionsMode.setName(result.opt("name")); + } + if (result.has("title")) { + optionsMode.setTitle(result.opt("title")); + } + if (result.has("desc")) { + optionsMode.setDesc(result.opt("desc")); + } + if (result.has("show_type")) { + optionsMode.setType(result.opt("show_type")); + } + + JSONObject contextObject = null; + if (result.has("text")) { + contextObject = result.getJSONObject("text"); + } else if (result.has("expression")) { + contextObject = result.getJSONObject("expression"); + } else if (result.has("star")) { + contextObject = result.getJSONObject("star"); + } + + if (contextObject != null) { + + if (contextObject.has("default_option_id")) { + optionsMode.setDefault_option_id(contextObject.opt("default_option_id")); + } + if (contextObject.has("options")) { + List options = new ArrayList(); + JSONArray optionsArray = contextObject.optJSONArray("options"); + if (optionsArray != null && optionsArray.length() > 0) { + for (int i = 0; i < optionsArray.length(); i++) { + JSONObject data = optionsArray.optJSONObject(i); + OptionsModel optionItem = new OptionsModel(); + optionItem.setId(data.opt("id")); + optionItem.setEnabled(data.opt("enabled")); + if (!optionItem.getEnabled() && optionsMode.getType().equals("text")) { + continue; } - if (dataObject.has("filesize")){ - logMessage.setFileSize(dataObject.opt("filesize")); + optionItem.setText(data.opt("text")); + optionItem.setDesc(data.opt("desc")); + optionItem.setRemark_option(data.opt("remark_option")); + + if (data.has("tags")) { + List tags = new ArrayList(); + String tagStirng = UdeskUtils.objectToString(data.opt("tags")); + if (!TextUtils.isEmpty(tagStirng)) { + String[] tagsArray = tagStirng.split(","); + for (int k = 0; k < tagsArray.length; k++) { + Tag tag = new Tag(); + tag.setText(tagsArray[k]); + tags.add(tag); + } + } + optionItem.setTags(tags); } + options.add(optionItem); } } + optionsMode.setOptions(options); + } + } + initCustomerBean.setIm_survey(optionsMode); + } - if (!logMessage.getType().equals("vcall")) { - logMessages.add(logMessage); - } + if (root.has("im_settings")) { + JSONObject settingsJsonObject = root.getJSONObject("im_settings"); + ImSetting imSetting = new ImSetting(); + imSetting.setEnable_im_group(settingsJsonObject.opt("enable_im_group")); + imSetting.setLeave_message_type(settingsJsonObject.opt("leave_message_type")); + imSetting.setIs_worktime(settingsJsonObject.opt("is_worktime")); + imSetting.setEnable_web_im_feedback(settingsJsonObject.opt("enable_web_im_feedback")); + imSetting.setEnable_im_survey(settingsJsonObject.opt("enable_im_survey")); + imSetting.setIm_survey_show_type(settingsJsonObject.opt("im_survey_show_type")); + imSetting.setInvestigation_when_leave(settingsJsonObject.opt("investigation_when_leave")); + imSetting.setNo_reply_hint(settingsJsonObject.opt("no_reply_hint")); + imSetting.setVcall(settingsJsonObject.opt("vcall")); + imSetting.setVc_app_id(settingsJsonObject.opt("vc_app_id")); + imSetting.setVcall_token_url(settingsJsonObject.opt("vcall_token_url")); + imSetting.setAgora_app_id(settingsJsonObject.opt("agora_app_id")); + imSetting.setServer_url(settingsJsonObject.opt("server_url")); + imSetting.setLeave_message_guide(settingsJsonObject.opt("leave_message_guide")); + if (settingsJsonObject.has("robot")) { + JSONObject robotJsonObject = settingsJsonObject.getJSONObject("robot"); + Robot robot = new Robot(); + robot.setEnable(robotJsonObject.opt("enable")); + robot.setUrl(robotJsonObject.opt("url")); + robot.setRobot_name(robotJsonObject.opt("robot_name")); + robot.setShow_robot_times(robotJsonObject.opt("show_robot_times")); + robot.setEnable_agent(robotJsonObject.opt("enable_agent")); + imSetting.setRobot(robot); + } + initCustomerBean.setImSetting(imSetting); + } + if (root.has("im_group")) { + List groupsModel = new ArrayList(); + JSONArray optionsArray = root.optJSONArray("im_group"); + if (optionsArray != null && optionsArray.length() > 0) { + for (int i = 0; i < optionsArray.length(); i++) { + JSONObject data = optionsArray.optJSONObject(i); + AgentGroupNode model = new AgentGroupNode(); + model.setId(data.optString("id")); + model.setHas_next(data.optString("has_next")); + model.setItem_name(data.optString("item_name")); + model.setLink(data.optString("link")); + model.setParentId(data.optString("parentId")); + groupsModel.add(model); } } + initCustomerBean.setIm_group(groupsModel); + } + + if (root.has("company")) { + JSONObject companyObject = root.optJSONObject("company"); + initCustomerBean.setBlack_list_notice(companyObject.opt("black_list_notice")); + } + + if (root.has("customer")) { + JSONObject customerObject = root.optJSONObject("customer"); + Customer customer = new Customer(); + customer.setId(customerObject.opt("id")); + customer.setIs_blocked(customerObject.opt("nick_name")); + customer.setIs_blocked(customerObject.opt("is_blocked")); + initCustomerBean.setCustomer(customer); } + + if (root.has("pre_session")) { + JSONObject presessionObject = root.optJSONObject("pre_session"); + PreSession preSession = new PreSession(); + preSession.setPre_session_id(presessionObject.opt("pre_session_id")); + preSession.setPre_session_title(presessionObject.opt("pre_session_title")); + preSession.setShow_pre_session(presessionObject.opt("show_pre_session")); + preSession.setPre_session(presessionObject.opt("pre_session")); + initCustomerBean.setPre_session(preSession); + } + + if (root.has("status")) { + initCustomerBean.setStatus(root.opt("status")); + } + + if (root.has("agent")) { + JSONObject agentObject = root.optJSONObject("agent"); + Agent agent = new Agent(); + agent.setAgent_id(agentObject.opt("jid")); + agent.setAvatar(agentObject.opt("avatar")); + agent.setAgent_id(agentObject.opt("agent_id")); + agent.setNick(agentObject.opt("nick")); + initCustomerBean.setAgent(agent); + } + + initCustomerBean.setIm_sub_session_id(root.opt("im_sub_session_id")); + + } catch (JSONException e) { e.printStackTrace(); } - return logMessages; + return initCustomerBean; } diff --git a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/UdeskSDKManager.java b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/UdeskSDKManager.java index 83ab65c5..db73a87e 100644 --- a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/UdeskSDKManager.java +++ b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/UdeskSDKManager.java @@ -5,21 +5,25 @@ import android.text.TextUtils; import android.widget.Toast; -import java.util.Date; import java.util.List; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; import cn.udesk.activity.UdeskChatActivity; import cn.udesk.activity.UdeskFormActivity; import cn.udesk.activity.UdeskHelperActivity; import cn.udesk.activity.UdeskOptionsAgentGroupActivity; -import cn.udesk.activity.UdeskRobotActivity; +import cn.udesk.callback.IUdeskNewMessage; import cn.udesk.config.UdeskBaseInfo; import cn.udesk.config.UdeskConfig; import cn.udesk.db.UdeskDBManager; import cn.udesk.emotion.LQREmotionKit; -import cn.udesk.messagemanager.UdeskMessageManager; -import cn.udesk.model.SDKIMSetting; -import cn.udesk.presenter.MessageCache; +import cn.udesk.messagemanager.UdeskXmppManager; +import cn.udesk.model.AgentGroupNode; +import cn.udesk.model.IMInfo; +import cn.udesk.model.ImSetting; +import cn.udesk.model.InitCustomerBean; +import cn.udesk.model.Robot; import udesk.core.UdeskCallBack; import udesk.core.UdeskConst; import udesk.core.UdeskHttpFacade; @@ -50,20 +54,41 @@ public class UdeskSDKManager { */ private String sdkToken = null; + /** + * 设置优先用哪个参数为主键 + * 默认为sdk_token,如果传customer_token,建议使用 customer_token + */ + private String token = ""; + private static UdeskSDKManager instance = new UdeskSDKManager(); private UdeskConfig udeskConfig; - //多应用 配置选项mode - private SDKIMSetting imSetting; + //返回会话界面 设置的消息jiek回调 + private IUdeskNewMessage newMessage; + + private ExecutorService singleExecutor; + private ExecutorService fixedThread; + + InitCustomerBean initCustomerBean; private UdeskSDKManager() { + singleExecutor = Executors.newSingleThreadExecutor(); + fixedThread = Executors.newFixedThreadPool(3); } public static UdeskSDKManager getInstance() { return instance; } + public ExecutorService getSingleExecutor() { + return singleExecutor; + } + + public ExecutorService getFixedThread() { + return fixedThread; + } + /** * 创建应用生成的key值和appid * @@ -145,219 +170,104 @@ public void entryChat(Context context, UdeskConfig udeskConfig, String sdktoken) Toast.makeText(context, "UdeskConfig is null", Toast.LENGTH_LONG).show(); return; } - if (TextUtils.isEmpty(getAppId(context))) { - showConversationByImGroup(context); - return; - } if (TextUtils.isEmpty(sdktoken)) { Toast.makeText(context.getApplicationContext(), context.getString(R.string.udesk_no_sdktoken), Toast.LENGTH_SHORT).show(); return; } this.udeskConfig = udeskConfig; + if (getUdeskConfig().defaultUserInfo!=null&&getUdeskConfig().defaultUserInfo.containsKey(UdeskConst.UdeskUserInfo.CUSTOMER_TOKEN)){ + String customer_token = getUdeskConfig().defaultUserInfo.get(UdeskConst.UdeskUserInfo.CUSTOMER_TOKEN); + if (!TextUtils.isEmpty(customer_token)){ + token=customer_token; + } + } String cacheToken = getSdkToken(context); sdkToken = UdeskUtil.stringFilter(sdktoken); if ((cacheToken == null)) { disConnectXmpp(); } else if (!cacheToken.equals(sdkToken)) { - // 一个应用内切换用户,的关闭上个用户的推送 - if (!TextUtils.isEmpty(UdeskBaseInfo.registerId) && getUdeskConfig().isUserSDkPush) { - setSdkPushStatus(getDomain(context), getAppkey(context), getSdkToken(context), - UdeskConfig.UdeskPushFlag.OFF, UdeskBaseInfo.registerId, getAppId(context)); - } disConnectXmpp(); } - if (udeskConfig.defualtUserInfo != null) { - udeskConfig.defualtUserInfo.put(UdeskConst.UdeskUserInfo.USER_SDK_TOKEN, sdktoken); + if (udeskConfig.defaultUserInfo != null) { + udeskConfig.defaultUserInfo.put(UdeskConst.UdeskUserInfo.USER_SDK_TOKEN, sdktoken); } initDB(context, sdkToken); PreferenceHelper.write(context, UdeskConst.SharePreParams.Udesk_Sharepre_Name, UdeskConst.SharePreParams.Udesk_SdkToken, sdkToken); UdeskUtil.initCrashReport(context); - getSDKImSetting(context); + initCustomer(context); } catch (Exception e) { e.printStackTrace(); } } - /** - * 获取应用的设置项配置值 - * - * @param context - */ - private void getSDKImSetting(final Context context) { - try { - UdeskHttpFacade.getInstance().getIMSettings(getDomain(context), getAppkey(context), getSdkToken(context), - getAppId(context), new UdeskCallBack() { - @Override - public void onSuccess(String message) { - try { - imSetting = JsonUtils.parserIMSettingJson(message); - switchBySetting(context, imSetting); - countSettingReq = 0; - } catch (Exception e) { - e.printStackTrace(); - } - } + IMInfo imInfo; - @Override - public void onFail(String message) { - try { - if (countSettingReq >= 2) { - countSettingReq = 0; - if (imSetting != null) { - switchBySetting(context, imSetting); - } else { - if (!getUdeskConfig().isOnlyUseRobot) { - showConversationByImGroup(context); - } else { - Toast.makeText(context.getApplicationContext(), context.getApplicationContext().getString(R.string.udesk_has_bad_net), Toast.LENGTH_SHORT).show(); - } - } - } else { - countSettingReq++; - getSDKImSetting(context); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - }); - } catch (Exception e) { - e.printStackTrace(); - } + public IMInfo getImInfo() { + return imInfo; } - /** - * 分配会话的逻辑 - * - * @param context - * @param imSetting - */ - private void switchBySetting(Context context, SDKIMSetting imSetting) { - try { - if (imSetting != null) { - if (getUdeskConfig().isOnlyUseRobot) { - if (imSetting.getEnable_robot()) { - showRobotByConfigSetting(context, imSetting); - return; - } - } else { - if (imSetting.getIn_session() || getUdeskConfig().isOnlyByAgentId || getUdeskConfig().isOnlyByGroupId) { - toLanuchChatAcitvity(context); - return; - } - if (imSetting.getEnable_robot()) { - showRobotByConfigSetting(context, imSetting); - return; - } - showConversationByImGroup(context); - } - } else { - Toast.makeText(context, context.getString(R.string.udesk_has_bad_net), Toast.LENGTH_SHORT).show(); - } - } catch (Exception e) { - e.printStackTrace(); - } - + public void setImInfo(IMInfo imInfo) { + this.imInfo = imInfo; } - /** - * 进入机器人聊天会话页面 - * - * @param context - */ - private void showRobotByConfigSetting(final Context context, final SDKIMSetting imSetting) { - - try { - UdeskHttpFacade.getInstance().setUserInfo(context, getDomain(context), - getAppkey(context), getSdkToken(context), - getUdeskConfig().defualtUserInfo, getUdeskConfig().definedUserTextField, - getUdeskConfig().definedUserRoplist, getAppId(context), getUdeskConfig().channel, new UdeskCallBack() { - - @Override - public void onSuccess(String string) { - try { - if (getUdeskConfig().isOnlyUseRobot) { - - if (!TextUtils.isEmpty(imSetting.getRobot())) { - toLanuchRobotAcitivty(context, imSetting.getRobot(), "false", false); - } - } else { - if (!TextUtils.isEmpty(imSetting.getRobot())) { - toLanuchRobotAcitivty(context, imSetting.getRobot(), imSetting.getEnable_agent(), imSetting.getEnable_im_group()); - } else { - showConversationByImGroup(context); + public void initCustomer(final Context context) { + UdeskHttpFacade.getInstance().customerInit(context, domain, getAppkey(context), getSdkToken(context), + getPrimaryKey(), getUdeskConfig().defaultUserInfo, getUdeskConfig().definedUserTextField, + getUdeskConfig().definedUserRoplist, getAppId(context), getUdeskConfig().channel, + new UdeskCallBack() { + @Override + public void onSuccess(String message) { + initCustomerBean = JsonUtils.parseInitCustomer(message); + if (initCustomerBean.getCode() == 1000) { + imInfo = initCustomerBean.getIm(); + if (!initCustomerBean.getStatus().equals(UdeskConst.Status.chatting)) { + ImSetting imSetting = initCustomerBean.getImSetting(); + Robot robot = imSetting != null ? imSetting.getRobot() : null; + List agentGroups = initCustomerBean.getIm_group(); + if ((robot == null || !robot.getEnable())){ + if (udeskConfig.isOnlyUseRobot){ + UdeskUtils.showToast(context,"机器人未开启,请联系管理员"); + }else if (imSetting.getEnable_im_group() && agentGroups != null && agentGroups.size() > 0){ + //不在当前会话,没有开启机器人,则先进入导航页面 + Intent intent = new Intent(context, UdeskOptionsAgentGroupActivity.class); + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + context.startActivity(intent); } + return; } - } catch (Exception e) { - e.printStackTrace(); } + }else if (udeskConfig.isOnlyUseRobot){ + UdeskUtils.showToast(context,"机器人未开启,请联系管理员"); + return; } + toLanuchChatAcitvity(context); + } - @Override - public void onFail(String string) { - try { - if (!getUdeskConfig().isOnlyUseRobot) { - showConversationByImGroup(context); - } - } catch (Exception e) { - e.printStackTrace(); - } + @Override + public void onFail(String message) { + if (udeskConfig.isOnlyUseRobot){ + UdeskUtils.showToast(context,"机器人未开启,请联系管理员"); + }else { + toLanuchChatAcitvity(context); } - }); - } catch (Exception e) { - showConversationByImGroup(context); - } + } + } + ); } - /** - * 进入机器人页面 - * - * @param context - * @param url 机器人的连接地址 - * @param tranfer 是否可以转人工 - * @param isTransferByImGroup 转人工是否通过导航页进入 true表示是 false 表示不是 - */ - private void toLanuchRobotAcitivty(Context context, String url, String tranfer, boolean isTransferByImGroup) { - try { - Intent intent = new Intent(context, UdeskRobotActivity.class); - intent.putExtra(UdeskConst.UDESKTRANSFER, tranfer); - intent.putExtra(UdeskConst.UDESKHTMLURL, url); - intent.putExtra(UdeskConst.UDESKISTRANFERSESSION, isTransferByImGroup); - intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - context.startActivity(intent); - } catch (Exception e) { - e.printStackTrace(); - } + + public InitCustomerBean getInitCustomerBean() { + return initCustomerBean; } - /** - * 通过配置的导航页的客服组进入,分配进入相应的客服 - * - * @param context - */ - private void showConversationByImGroup(Context context) { - try { - if (getUdeskConfig().isOnlyByAgentId || getUdeskConfig().isOnlyByGroupId) { - toLanuchChatAcitvity(context); - } else if (imSetting != null && imSetting.getEnable_im_group()) { - Intent intent = new Intent(context, UdeskOptionsAgentGroupActivity.class); - intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - context.startActivity(intent); - } else { - //没有开启导航组进入,得清除缓存的groupid,agentid - if (imSetting != null && !imSetting.getEnable_im_group()){ - PreferenceHelper.write(context, UdeskConst.SharePreParams.Udesk_Sharepre_Name, - UdeskConst.SharePreParams.Udesk_Group_Id, ""); - PreferenceHelper.write(context, UdeskConst.SharePreParams.Udesk_Sharepre_Name, - UdeskConst.SharePreParams.Udesk_Agent_Id, ""); - } - toLanuchChatAcitvity(context); - } - } catch (Exception e) { - e.printStackTrace(); - } + public void setInitCustomerBean(InitCustomerBean initCustomerBean) { + this.initCustomerBean = initCustomerBean; + } + + public String getPrimaryKey() { + return token; } /** @@ -368,12 +278,6 @@ private void showConversationByImGroup(Context context) { private void toLanuchChatAcitvity(Context context) { try { Intent intent = new Intent(context, UdeskChatActivity.class); - if (!TextUtils.isEmpty(getUdeskConfig().groupId)) { - intent.putExtra(UdeskConst.UDESKGROUPID, getUdeskConfig().groupId); - } - if (!TextUtils.isEmpty(getUdeskConfig().agentId)) { - intent.putExtra(UdeskConst.UDESKAGENTID, getUdeskConfig().agentId); - } intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); context.startActivity(intent); } catch (Exception e) { @@ -436,9 +340,14 @@ public void initDB(Context context, String sdkToken) { */ public void logoutUdesk() { try { - if (MessageCache.getInstance() != null){ + if (MessageCache.getInstance() != null) { MessageCache.getInstance().clear(); } + // 一个应用内切换用户,的关闭上个用户的推送 + if (!TextUtils.isEmpty(UdeskBaseInfo.registerId) && getUdeskConfig().isUserSDkPush) { + setSdkPushStatus(domain,app_Key, sdkToken, + UdeskConfig.UdeskPushFlag.OFF, UdeskBaseInfo.registerId, app_Id); + } releaseDB(); disConnectXmpp(); } catch (Exception e) { @@ -462,7 +371,7 @@ public void releaseDB() { */ public void disConnectXmpp() { try { - UdeskMessageManager.getInstance().cancleXmpp(); + UdeskXmppManager.getInstance().cancleXmpp(); } catch (Exception e) { e.printStackTrace(); } @@ -613,16 +522,16 @@ public void cleanCacheGroupId(Context context) { } } - - public SDKIMSetting getImSetting() { - return imSetting; - } - - //先预留开关,当后期管理员可配置时,方便修改 public boolean getEnableSendMessageWhenQueue() { return true; } + public IUdeskNewMessage getNewMessage() { + return newMessage; + } + public void setNewMessage(IUdeskNewMessage newMessage) { + this.newMessage = newMessage; + } } diff --git a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/UdeskUtil.java b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/UdeskUtil.java index 46532302..37416823 100644 --- a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/UdeskUtil.java +++ b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/UdeskUtil.java @@ -3,14 +3,15 @@ import android.app.Activity; import android.content.ContentUris; import android.content.Context; +import android.content.Intent; import android.content.pm.ActivityInfo; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; -import android.content.res.Configuration; -import android.content.res.Resources; import android.database.Cursor; import android.graphics.Bitmap; import android.graphics.BitmapFactory; +import android.graphics.Color; +import android.graphics.Typeface; import android.graphics.drawable.Animatable; import android.graphics.drawable.Drawable; import android.media.MediaMetadataRetriever; @@ -18,15 +19,16 @@ import android.net.NetworkInfo; import android.net.Uri; import android.os.Build; +import android.os.Bundle; import android.os.Environment; -import android.os.LocaleList; import android.provider.DocumentsContract; import android.provider.MediaStore; +import android.text.SpannableString; +import android.text.Spanned; import android.text.TextUtils; -import android.util.DisplayMetrics; -import android.view.View; +import android.text.style.ForegroundColorSpan; +import android.text.style.StyleSpan; import android.view.ViewGroup; -import android.view.WindowManager; import android.widget.TextView; import com.facebook.binaryresource.BinaryResource; @@ -57,28 +59,46 @@ import com.facebook.imagepipeline.request.ImageRequestBuilder; import com.tencent.bugly.crashreport.CrashReport; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; -import java.io.IOException; +import java.io.FileOutputStream; import java.io.InputStream; -import java.net.URLEncoder; import java.text.DecimalFormat; import java.text.ParseException; import java.text.SimpleDateFormat; +import java.util.ArrayList; import java.util.Calendar; +import java.util.Collections; import java.util.Date; import java.util.HashMap; +import java.util.List; import java.util.Locale; import java.util.Map; +import java.util.Random; import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; -import cn.udesk.config.UdeskBaseInfo; +import cn.udesk.activity.UdeskZoomImageActivty; import cn.udesk.config.UdeskConfig; +import cn.udesk.db.UdeskDBManager; +import cn.udesk.model.TicketReplieMode; +import cn.udesk.model.ImSetting; +import cn.udesk.model.OptionsModel; +import cn.udesk.model.SurveyOptionsModel; +import udesk.core.model.Content; import cn.udesk.provider.UdeskFileProvider; import me.relex.photodraweeview.PhotoDraweeView; import udesk.core.UdeskConst; +import udesk.core.event.InvokeEventContainer; +import udesk.core.model.AgentInfo; +import udesk.core.model.LogBean; +import udesk.core.model.MessageInfo; +import udesk.core.model.ProductListBean; +import udesk.core.model.RobotInit; +import udesk.core.utils.UdeskIdBuild; import udesk.core.utils.UdeskUtils; public class UdeskUtil { @@ -134,7 +154,9 @@ public static String getFileProviderName(Context context) { * @return */ public static String parseOwnUri(Uri uri, Context context, File cameraFile) { - if (uri == null) return ""; + if (uri == null) { + return ""; + } String path = ""; try { if (TextUtils.equals(uri.getAuthority(), getFileProviderName(context))) { @@ -160,7 +182,7 @@ public static String getFormUrlPara(Context context) { if (!isZh(context)) { builder.append("&language=en-us"); } - Map userinfo = UdeskSDKManager.getInstance().getUdeskConfig().defualtUserInfo; + Map userinfo = UdeskSDKManager.getInstance().getUdeskConfig().defaultUserInfo; Map textField = UdeskSDKManager.getInstance().getUdeskConfig().definedUserTextField; if (userinfo != null && !userinfo.isEmpty()) { Set keySet = userinfo.keySet(); @@ -400,8 +422,9 @@ public static boolean isCached(Context context, Uri uri) { */ public static File getFileFromDiskCache(Context context, Uri uri) { try { - if (!isCached(context, uri)) + if (!isCached(context, uri)) { return null; + } ImageRequest imageRequest = ImageRequest.fromUri(uri); CacheKey cacheKey = DefaultCacheKeyFactory.getInstance() .getEncodedCacheKey(imageRequest, context); @@ -469,7 +492,7 @@ public static void loadHeadView(Context context, SimpleDraweeView simpleDraweeVi } } - public static void loadFileFromSdcard(final Context context, final SimpleDraweeView draweeView, Uri loackUri, final int reqWidth, final int reqHeight) { + public static void loadFileFromSdcard(final Context context, final SimpleDraweeView draweeView, Uri loackUri, final int reqWidth, final int reqHeight,final boolean isfixScale) { try { ImageRequest request = ImageRequestBuilder.newBuilderWithSource(loackUri) @@ -490,17 +513,24 @@ public void onFinalImageSet(String id, ImageInfo imageInfo, Animatable anim) { ViewGroup.LayoutParams layoutParams = draweeView.getLayoutParams(); int imgWidth = dip2px(context, 140); - int imgHight = dip2px(context, 220); - double bitScalew = getRatioSize(reqWidth, reqHeight, imgHight, imgWidth); - if (bitScalew >= 1) { + if (isfixScale) { + //固定宽度缩放 + double bitScalew = (double) reqWidth / imgWidth; layoutParams.height = (int) (reqHeight / bitScalew); layoutParams.width = (int) (reqWidth / bitScalew); - } else if (bitScalew >= 0.5) { - layoutParams.height = reqHeight; - layoutParams.width = reqWidth; } else { - layoutParams.height = imgWidth / 2; - layoutParams.width = imgWidth / 2; + int imgHight = dip2px(context, 220); + double bitScalew = getRatioSize(reqWidth, reqHeight, imgHight, imgWidth); + if (bitScalew >= 1) { + layoutParams.height = (int) (reqHeight / bitScalew); + layoutParams.width = (int) (reqWidth / bitScalew); + } else if (bitScalew >= 0.5) { + layoutParams.height = reqHeight; + layoutParams.width = reqWidth; + } else { + layoutParams.height = imgWidth / 2; + layoutParams.width = imgWidth / 2; + } } draweeView.requestLayout(); @@ -514,7 +544,7 @@ public void onFinalImageSet(String id, ImageInfo imageInfo, Animatable anim) { } } - public static void loadImageView(final Context context, final SimpleDraweeView simpleDraweeView, Uri httpUri) { + public static void loadImageView(final Context context, final SimpleDraweeView simpleDraweeView, Uri httpUri, final boolean isfixScale) { try { File file = getFileFromDiskCache(context, httpUri); @@ -531,18 +561,26 @@ public void onFinalImageSet(String id, ImageInfo imageInfo, Animatable anim) { int height = imageInfo.getHeight(); int width = imageInfo.getWidth(); int imgWidth = dip2px(context, 140); - int imgHight = dip2px(context, 220); - double bitScalew = getRatioSize(width, height, imgHight, imgWidth); - if (bitScalew >= 1) { + if (isfixScale) { + //固定宽度缩放 + double bitScalew = (double) width / imgWidth; layoutParams.height = (int) (height / bitScalew); layoutParams.width = (int) (width / bitScalew); - } else if (bitScalew >= 0.5) { - layoutParams.height = height; - layoutParams.width = width; } else { - layoutParams.height = imgWidth / 2; - layoutParams.width = imgWidth / 2; + int imgHight = dip2px(context, 220); + double bitScalew = getRatioSize(width, height, imgHight, imgWidth); + if (bitScalew >= 1) { + layoutParams.height = (int) (height / bitScalew); + layoutParams.width = (int) (width / bitScalew); + } else if (bitScalew >= 0.5) { + layoutParams.height = height; + layoutParams.width = width; + } else { + layoutParams.height = imgWidth / 2; + layoutParams.width = imgWidth / 2; + } } + simpleDraweeView.setLayoutParams(layoutParams); simpleDraweeView.invalidate(); } @@ -574,7 +612,7 @@ public void onFailure(String id, Throwable throwable) { } } - public static void loadNoChangeView(Context context, SimpleDraweeView simpleDraweeView, Uri httpUri) { + public static void loadNoChangeView(Context context, SimpleDraweeView simpleDraweeView, Uri httpUri,boolean autoAnimals) { try { File file = getFileFromDiskCache(context, httpUri); if (file != null) { @@ -583,6 +621,7 @@ public static void loadNoChangeView(Context context, SimpleDraweeView simpleDraw DraweeController controller = Fresco.newDraweeControllerBuilder() .setUri(httpUri) .setTapToRetryEnabled(true) + .setAutoPlayAnimations(autoAnimals) .setOldController(simpleDraweeView.getController()) .build(); simpleDraweeView.setController(controller); @@ -591,8 +630,15 @@ public static void loadNoChangeView(Context context, SimpleDraweeView simpleDraw } } + public static void loadNoChangeView(Context context, SimpleDraweeView simpleDraweeView, Uri httpUri) { + loadNoChangeView(context,simpleDraweeView,httpUri,true); + } public static void loadViewBySize(Context context, SimpleDraweeView simpleDraweeView, Uri httpUri, int width, int height) { + loadViewBySize(context,simpleDraweeView,httpUri,width,height,true); + } + + public static void loadViewBySize(Context context, SimpleDraweeView simpleDraweeView, Uri httpUri, int width, int height,boolean autoAnimation) { try { File file = getFileFromDiskCache(context, httpUri); if (file != null) { @@ -607,6 +653,7 @@ public static void loadViewBySize(Context context, SimpleDraweeView simpleDrawee DraweeController controller = Fresco.newDraweeControllerBuilder() .setOldController(simpleDraweeView.getController()) .setImageRequest(request) + .setAutoPlayAnimations(autoAnimation) .setTapToRetryEnabled(true) .build(); simpleDraweeView.setController(controller); @@ -762,8 +809,9 @@ public static String getDataColumn(Context context, Uri uri, String selection, return cursor.getString(column_index); } } finally { - if (cursor != null) + if (cursor != null) { cursor.close(); + } } return null; } @@ -794,8 +842,9 @@ public static boolean isMediaDocument(Uri uri) { public static File getExternalCacheDir(final Context context) { - if (hasExternalCacheDir()) + if (hasExternalCacheDir()) { return context.getExternalCacheDir(); + } // Before Froyo we need to construct the external cache dir ourselves final String cacheDir = "/Android/data/" + context.getPackageName() + "/cache/"; @@ -825,11 +874,14 @@ public static String getMIMEType(File file) { } /* 获取文件的后缀名*/ String end = fName.substring(dotIndex, fName.length()).toLowerCase(); - if (end.equals("")) return type; + if (end.equals("")) { + return type; + } //在MIME和文件类型的匹配表中找到对应的MIME类型。 for (int i = 0; i < MIME_MapTable.length; i++) { - if (end.equals(MIME_MapTable[i][0])) + if (end.equals(MIME_MapTable[i][0])) { type = MIME_MapTable[i][1]; + } } return type; } @@ -904,7 +956,7 @@ public static String getMIMEType(File file) { }; public final static int TYPE_IMAGE = 1; - public final static int TYPE_VIDEO = 2; + public final static int TYPE_SHORT_VIDEO = 2; public final static int TYPE_AUDIO = 3; public static int isPictureType(String pictureType) { @@ -934,7 +986,7 @@ public static int isPictureType(String pictureType) { case "video/mpeg": case "video/webm": case "video/mp2ts": - return TYPE_VIDEO; + return TYPE_SHORT_VIDEO; case "audio/mpeg": case "audio/x-ms-wma": case "audio/x-wav": @@ -1172,11 +1224,13 @@ public File get() { ImagePipelineConfig config = ImagePipelineConfig.newBuilder(context) .setBitmapMemoryCacheParamsSupplier( new Supplier() { + @Override public MemoryCacheParams get() { return bitmapCacheParams; } }) .setMainDiskCacheConfig(diskCacheConfig) + .setNetworkFetcher(new ElnImageDownloaderFetcher(UdeskConst.REFERER_VALUE)) .setDownsampleEnabled(true) .setBitmapsConfig(Bitmap.Config.RGB_565) .build(); @@ -1189,4 +1243,545 @@ public MemoryCacheParams get() { } } + //预览大图 + public static void previewPhoto(Context context, Uri uri) { + try { + if (uri == null) { + return; + } + Intent intent = new Intent(context, + UdeskZoomImageActivty.class); + Bundle data = new Bundle(); + data.putParcelable("image_path", uri); + intent.putExtras(data); + context.startActivity(intent); + } catch (Exception e) { + e.printStackTrace(); + } + + } + + /** + * @param inStream + * @return byte[] + * @throws Exception + */ + public static byte[] readStream(InputStream inStream) throws Exception { + byte[] data = new byte[0]; + try { + byte[] buffer = new byte[1024]; + int len; + ByteArrayOutputStream outStream = new ByteArrayOutputStream(); + while ((len = inStream.read(buffer)) != -1) { + outStream.write(buffer, 0, len); + } + data = outStream.toByteArray(); + outStream.close(); + inStream.close(); + } catch (Exception e) { + e.printStackTrace(); + } + return data; + + } + + + public static MessageInfo addLeavMsgWeclome(String content,String leavMsgId ) { + MessageInfo msg = new MessageInfo(); + try { + msg.setMsgtype(UdeskConst.ChatMsgTypeString.TYPE_RICH); + msg.setTime(System.currentTimeMillis()); + msg.setMsgId(leavMsgId); + msg.setDirection(UdeskConst.ChatMsgDirection.Recv); + msg.setSendFlag(UdeskConst.SendFlag.RESULT_SUCCESS); + msg.setReadFlag(UdeskConst.ChatMsgReadFlag.read); + msg.setMsgContent(content); + msg.setPlayflag(UdeskConst.PlayFlag.NOPLAY); + } catch (Exception e) { + e.printStackTrace(); + } + + return msg; + } + + public static MessageInfo buildSendMessage(String msgType, long time, String text) { + return buildSendMessage(msgType, time, text, "", "", ""); + } + + //构建消息模型 + public static MessageInfo buildSendMessage(String msgType, long time, String text, + String location, String fileName, String fileSize) { + MessageInfo msg = new MessageInfo(); + try { + msg.setMsgtype(msgType); + msg.setTime(time); + msg.setMsgId(UdeskIdBuild.buildMsgId()); + msg.setDirection(UdeskConst.ChatMsgDirection.Send); + msg.setSendFlag(UdeskConst.SendFlag.RESULT_SEND); + msg.setReadFlag(UdeskConst.ChatMsgReadFlag.read); + msg.setMsgContent(text); + msg.setPlayflag(UdeskConst.PlayFlag.NOPLAY); + msg.setLocalPath(location); + msg.setFilename(fileName); + msg.setFilesize(fileSize); + } catch (Exception e) { + e.printStackTrace(); + } + return msg; + } + public static SurveyOptionsModel buildSurveyOptionsModel(Context context){ + SurveyOptionsModel model=new SurveyOptionsModel(); + model.setEnabled(true); + model.setName(context.getResources().getString(R.string.udesk_satisfy_evaluation)); + model.setTitle(context.getResources().getString(R.string.udesk_satisfy_evaluation_title)); + model.setRemark_enabled(true); + model.setRemark(context.getResources().getString(R.string.udesk_satisfy_evaluation_remark)); + model.setType("text"); + model.setDefault_option_id(0); + model.setRobot(true); + List options=new ArrayList<>(); + int id=0; + options.add(new OptionsModel(++id,true,context.getResources().getString(R.string.udesk_statify),context.getResources().getString(R.string.udesk_statify),UdeskConst.REMARK_OPTION_HIDE)); + options.add(new OptionsModel(++id,true,context.getResources().getString(R.string.udesk_common),context.getResources().getString(R.string.udesk_common),UdeskConst.REMARK_OPTION_OPTIONAL)); + options.add(new OptionsModel(++id,true,context.getResources().getString(R.string.udesk_unstatify),context.getResources().getString(R.string.udesk_unstatify),UdeskConst.REMARK_OPTION_REQUIRED)); + model.setOptions(options); + return model; + } + public static MessageInfo buildSendChildMsg(String content){ + return buildMsg("","",System.currentTimeMillis(),UdeskIdBuild.buildMsgId(),UdeskConst.ChatMsgTypeString.TYPE_TEXT,content,UdeskConst.ChatMsgReadFlag.read, + UdeskConst.SendFlag.RESULT_SUCCESS,UdeskConst.PlayFlag.NOPLAY,UdeskConst.ChatMsgDirection.Send,"",0,"","","", + 0,""); + } + public static MessageInfo buildRobotTransferMsg(String content){ + return buildMsg("","",System.currentTimeMillis(),UdeskIdBuild.buildMsgId(),UdeskConst.ChatMsgTypeString.TYPE_ROBOT_TRANSFER,content,UdeskConst.ChatMsgReadFlag.read, + UdeskConst.SendFlag.RESULT_SUCCESS,UdeskConst.PlayFlag.NOPLAY,UdeskConst.ChatMsgDirection.Recv,"",0,"","","", + 0,""); + } + public static MessageInfo buildReplyProductMsg(ProductListBean bean){ + return buildMsg("","",System.currentTimeMillis(),UdeskIdBuild.buildMsgId(),UdeskConst.ChatMsgTypeString.TYPE_REPLY_PRODUCT,JsonUtils.getReplyProductJson(bean).toString().replace("\\",""),UdeskConst.ChatMsgReadFlag.read, + UdeskConst.SendFlag.RESULT_SUCCESS,UdeskConst.PlayFlag.NOPLAY,UdeskConst.ChatMsgDirection.Send,"",0,"","","", + 0,""); + } + public static MessageInfo buildRobotInitRelpy(RobotInit robotInit){ + MessageInfo messageInfo = buildMsg(robotInit.getWebConfig().getRobotName(), robotInit.getWebConfig().getLogoUrl(), System.currentTimeMillis(), UdeskIdBuild.buildMsgId(), UdeskConst.ChatMsgTypeString.TYPE_ROBOT_CLASSIFY, + "", UdeskConst.ChatMsgReadFlag.read, UdeskConst.SendFlag.RESULT_SUCCESS, UdeskConst.PlayFlag.NOPLAY, UdeskConst.ChatMsgDirection.Recv, "", + 0, "", "", "", UdeskUtils.objectToInt(robotInit.getSwitchStaffType()), UdeskUtils.objectToString(robotInit.getSwitchStaffTips())); + messageInfo.setWebConfig(robotInit.getWebConfig()); + messageInfo.setTopAsk(robotInit.getTopAsk()); + messageInfo.setLogId(robotInit.getLogId()); + return messageInfo; + + } + public static MessageInfo buildWelcomeRelpy(RobotInit robotInit){ + MessageInfo messageInfo = buildMsg(robotInit.getWebConfig().getRobotName(), robotInit.getWebConfig().getLogoUrl(), System.currentTimeMillis(), UdeskIdBuild.buildMsgId(), UdeskConst.ChatMsgTypeString.TYPE_RICH, + robotInit.getWebConfig().getHelloWord(), UdeskConst.ChatMsgReadFlag.read, UdeskConst.SendFlag.RESULT_SUCCESS, UdeskConst.PlayFlag.NOPLAY, UdeskConst.ChatMsgDirection.Recv, + "", 0, "", "", "", UdeskUtils.objectToInt(robotInit.getSwitchStaffType()), UdeskUtils.objectToString(robotInit.getSwitchStaffTips())); + messageInfo.setLogId(robotInit.getLogId()); + return messageInfo; + + } + + public static MessageInfo buildAllMessage(LogBean message){ + if (message.getContent()!=null){ + Content content=message.getContent(); + if (content.getData()!=null){ + MessageInfo info=buildMsg(message.getAgent_nick_name(),message.getAgent_avatar(),stringToLong(message.getCreated_at()), + UdeskUtils.objectToString(message.getMessage_id()), message.getContent().getType(),content.getData().getContent(), + UdeskConst.ChatMsgReadFlag.read,UdeskConst.SendFlag.RESULT_SUCCESS,UdeskConst.PlayFlag.NOPLAY, UdeskConst.ChatMsgDirection.Recv,"", + UdeskUtils.objectToLong(message.getContent().getData().getDuration()),message.getAgent_jid(),message.getContent().getData().getFilename(), + message.getContent().getData().getFilesize(),content.getData().getSwitchStaffType(),content.getData().getSwitchStaffTips()); + if (message.getInviterAgentInfo()!=null){ + info.setReplyUser(message.getInviterAgentInfo().getNick_name()); + info.setUser_avatar(message.getInviterAgentInfo().getAvatar()); + info.setmAgentJid(message.getInviterAgentInfo().getJid()); + } + info.setTopAsk(content.getData().getTopAsk()); + info.setLogId(message.getLogId()); + info.setSeqNum(message.getContent().getSeq_num()); + info.setSender(message.getSender()); + info.setFlowContent(content.getData().getFlowContent()); + info.setFlowId(content.getData().getFlowId()); + info.setFlowTitle(content.getData().getFlowTitle()); + info.setQuestion_id(UdeskUtils.objectToString(content.getData().getQuesition_id())); + if (message.getSender().equals(UdeskConst.Sender.customer)){ + info.setDirection(UdeskConst.ChatMsgDirection.Send); + } + return info; + } + } + return null; + } + + public static MessageInfo buildMsg(String name,String logoUrl,long time, String msgId, String msgtype, String msgContent, + int readFlag, int sendFlag, int playflag, int direction, + String localPath, long duration, String agentJid,String fileName,String fileSize,int switchStaffType,String switchStaffTips ){ + MessageInfo msg = new MessageInfo(); + try { + msg.setReplyUser(name); + msg.setUser_avatar(logoUrl); + msg.setMsgtype(msgtype); + msg.setTime(time); + msg.setMsgId(msgId); + msg.setDirection(direction); + msg.setSendFlag(sendFlag); + msg.setReadFlag(readFlag); + msg.setMsgContent(msgContent); + msg.setPlayflag(playflag); + msg.setLocalPath(localPath); + msg.setFilename(fileName); + msg.setFilesize(fileSize); + msg.setDuration(duration); + msg.setmAgentJid(agentJid); + msg.setSwitchStaffTips(switchStaffTips); + msg.setSwitchStaffType(switchStaffType); + } catch (Exception e) { + e.printStackTrace(); + } + return msg; + } + public static MessageInfo buildVideoEventMsg(String id, Boolean isInvite, String text, + String customerId,String agentJid,String agentNickName, + String subSessionId) { + MessageInfo msg = new MessageInfo(); + try { + msg.setCustomerId(customerId); + msg.setMsgtype(UdeskConst.ChatMsgTypeString.TYPE_LIVE_VIDEO); + msg.setTime(System.currentTimeMillis()); + msg.setMsgId(id); + if (isInvite) { + msg.setDirection(UdeskConst.ChatMsgDirection.Send); + msg.setSender(UdeskConst.Sender.customer); + } else { + msg.setDirection(UdeskConst.ChatMsgDirection.Recv); + msg.setmAgentJid(agentJid); + msg.setSender(UdeskConst.Sender.agent); + } + msg.setSendFlag(UdeskConst.SendFlag.RESULT_SUCCESS); + msg.setReadFlag(UdeskConst.ChatMsgReadFlag.read); + if (isInvite) { + msg.setMsgContent(text); + } else { + msg.setMsgContent(agentNickName + text); + } + msg.setPlayflag(UdeskConst.PlayFlag.NOPLAY); + msg.setLocalPath(""); + msg.setDuration(0); + msg.setSubsessionid(subSessionId); + msg.setSeqNum(UdeskDBManager.getInstance().getSubSessionId(subSessionId)); + } catch (Exception e) { + e.printStackTrace(); + } + return msg; + } + + + public static void sendVideoMessage(ImSetting sdkimSetting,AgentInfo mAgentInfo, Context context ) { + try { + + if (sdkimSetting != null) { + //分配到客服后。建立websocket连接 + String domain = UdeskSDKManager.getInstance().getDomain(context); + String[] domains = domain.split("\\."); + if (domains.length > 0) { + domain = domains[0]; + } + if (!TextUtils.isEmpty(mAgentInfo.getIm_sub_session_id())) { + UdeskConst.IMBusseniessId = mAgentInfo.getIm_sub_session_id(); + } + if (!TextUtils.isEmpty(mAgentInfo.getAgentJid())) { + UdeskConst.IMAgentJid = mAgentInfo.getAgentJid(); + } + if (!TextUtils.isEmpty(mAgentInfo.getAgentNick())) { + UdeskConst.IMAgentName = mAgentInfo.getAgentNick(); + } + if (!TextUtils.isEmpty(UdeskSDKManager.getInstance().getImInfo().getUsername())) { + UdeskConst.IMCustomerJid = UdeskSDKManager.getInstance().getImInfo().getUsername(); + } + if (!TextUtils.isEmpty(sdkimSetting.getVc_app_id())) { + UdeskConst.vc_app_id = sdkimSetting.getVc_app_id(); + } + if (!TextUtils.isEmpty(sdkimSetting.getAgora_app_id())) { + UdeskConst.agora_app_id = sdkimSetting.getAgora_app_id(); + } + if (!TextUtils.isEmpty(sdkimSetting.getServer_url())) { + UdeskConst.server_url = sdkimSetting.getServer_url(); + } + + if (!TextUtils.isEmpty(sdkimSetting.getVcall_token_url())) { + UdeskConst.signToenUrl = sdkimSetting.getVcall_token_url(); + } + if (!TextUtils.isEmpty(domain)) { + UdeskConst.Subdomain = domain; + } + + InvokeEventContainer.getInstance().event_OnConnectWebsocket.invoke(context); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + + + public static File getScaleFile(Bitmap bitmap, Context context){ + try { + int width = bitmap.getWidth(); + int height = bitmap.getHeight(); + int max = Math.max(width, height); + + BitmapFactory.Options factoryOptions = new BitmapFactory.Options(); + factoryOptions.inJustDecodeBounds = false; + factoryOptions.inPurgeable = true; + // 获取原图数据 + ByteArrayOutputStream stream = new ByteArrayOutputStream(); + bitmap.compress(Bitmap.CompressFormat.JPEG, 100, stream); + byte[] data = stream.toByteArray(); + File scaleImageFile = new File(UdeskUtils.getDirectoryPath(context, UdeskConst.FileImg) + File.separator + UdeskConst.ORIGINAL_SUFFIX); + if (scaleImageFile != null) { + if (max > UdeskSDKManager.getInstance().getUdeskConfig().ScaleMax) { + factoryOptions.inSampleSize = max / UdeskSDKManager.getInstance().getUdeskConfig().ScaleMax; + } else { + factoryOptions.inSampleSize = 1; + } + FileOutputStream fos; + try { + fos = new FileOutputStream(scaleImageFile); + bitmap = BitmapFactory.decodeByteArray(data, 0, data.length, + factoryOptions); + bitmap.compress(Bitmap.CompressFormat.JPEG, 80, fos); + fos.close(); + } catch (Exception e) { + e.printStackTrace(); + return null; + } + bitmap.recycle(); + bitmap = null; + if (TextUtils.isEmpty(scaleImageFile.getPath())) { + UdeskUtils.showToast(context, context.getString(R.string.udesk_upload_img_error)); + return null; + } + return scaleImageFile; + } + + } catch (Exception e) { + e.printStackTrace(); + } catch (OutOfMemoryError error) { + error.printStackTrace(); + } + + return null; + } + + public static File getScaleFile(String path, final Context context){ + try { + Bitmap scaleImage = null; + byte[] data; + int max; + BitmapFactory.Options options = new BitmapFactory.Options(); + /** + * 在不分配空间状态下计算出图片的大小 + */ + options.inJustDecodeBounds = true; + BitmapFactory.decodeFile(path, options); + int width = options.outWidth; + int height = options.outHeight; + max = Math.max(width, height); + options.inTempStorage = new byte[100 * 1024]; + options.inJustDecodeBounds = false; + options.inPurgeable = true; + options.inPreferredConfig = Bitmap.Config.ARGB_8888; + InputStream inStream = new FileInputStream(path); + data = UdeskUtil.readStream(inStream); + if (data == null || data.length <= 0) { +// sendFileMessage(path, UdeskConst.ChatMsgTypeString.TYPE_IMAGE); + return null; + } + String imageName = UdeskUtils.MD5(data); + File scaleImageFile = new File(UdeskUtils.getDirectoryPath(context, UdeskConst.FileImg) + File.separator + imageName + UdeskConst.ORIGINAL_SUFFIX); + if (!scaleImageFile.exists()) { + // 缩略图不存在,生成上传图 + if (max > UdeskSDKManager.getInstance().getUdeskConfig().ScaleMax) { + options.inSampleSize = max / UdeskSDKManager.getInstance().getUdeskConfig().ScaleMax; + } else { + options.inSampleSize = 1; + } + FileOutputStream fos = new FileOutputStream(scaleImageFile); + scaleImage = BitmapFactory.decodeByteArray(data, 0, + data.length, options); + scaleImage.compress(Bitmap.CompressFormat.JPEG, 80, fos); + fos.close(); + } + + if (scaleImage != null) { + scaleImage.recycle(); + } + if (TextUtils.isEmpty(scaleImageFile.getPath())) { +// sendFileMessage(path, UdeskConst.ChatMsgTypeString.TYPE_IMAGE); + return null; + } else { +// sendFileMessage(scaleImageFile.getPath(), UdeskConst.ChatMsgTypeString.TYPE_IMAGE); + return scaleImageFile; + } + + } catch (Exception e) { + e.printStackTrace(); + } catch (OutOfMemoryError error) { + error.printStackTrace(); + } + return null; + } + + //构建工单回复的消息转换消息模型 + public static List buildLeaveMsgByTicketReplies(List contents, Context context) { + List msgInfos = new ArrayList(); + try { + if (contents != null && contents.size() > 0) { + MessageInfo eventMsg = new MessageInfo(); + eventMsg.setMsgtype(UdeskConst.ChatMsgTypeString.TYPE_EVENT); + eventMsg.setTime(System.currentTimeMillis()); + eventMsg.setMsgId(UdeskIdBuild.buildMsgId()); + eventMsg.setDirection(UdeskConst.ChatMsgDirection.Recv); + eventMsg.setSendFlag(UdeskConst.SendFlag.RESULT_SUCCESS); + eventMsg.setReadFlag(UdeskConst.ChatMsgReadFlag.read); + eventMsg.setMsgContent(context.getString(R.string.udesk_offline_reply_msg)); + eventMsg.setCreatedTime(contents.get(0).getReply_created_at()); + Collections.reverse(contents); + boolean isAddEvent = false; + for (TicketReplieMode.ContentsBean contentsBean : contents) { + if (contentsBean != null && !UdeskDBManager.getInstance().hasReceviedMsg(String.valueOf(contentsBean.getReply_id()))) { + MessageInfo msg = new MessageInfo(); + msg.setMsgtype(UdeskConst.ChatMsgTypeString.TYPE_LEAVEMSG); + msg.setTime(System.currentTimeMillis()); + msg.setMsgId(String.valueOf(contentsBean.getReply_id())); + msg.setDirection(UdeskConst.ChatMsgDirection.Recv); + msg.setSendFlag(UdeskConst.SendFlag.RESULT_SUCCESS); + msg.setReadFlag(UdeskConst.ChatMsgReadFlag.read); + msg.setMsgContent(contentsBean.getReply_content()); + msg.setPlayflag(UdeskConst.PlayFlag.NOPLAY); + msg.setLocalPath(""); + msg.setDuration(0); + msg.setUser_avatar(contentsBean.getUser_avatar()); + msg.setCreatedTime(contentsBean.getReply_created_at()); + msg.setUpdateTime(contentsBean.getReply_updated_at()); + msg.setReplyUser(contentsBean.getReply_user()); + msgInfos.add(msg); + UdeskDBManager.getInstance().addMessageInfo(msg); + isAddEvent = true; + } + } + if (isAddEvent) { + msgInfos.add(0, eventMsg); + UdeskDBManager.getInstance().addMessageInfo(eventMsg); + } + } + } catch (Exception e) { + e.printStackTrace(); + } + return msgInfos; + } + + /** + * 图片按比例大小压缩方法(根据bitmap图片压缩) + * + * @param image + * @return + */ + public static Bitmap compressRatio(Bitmap image) { + + if (image == null) { + return null; + } + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + image.compress(Bitmap.CompressFormat.JPEG, 100, baos); + ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(baos.toByteArray()); + BitmapFactory.Options options = new BitmapFactory.Options(); + options.inJustDecodeBounds = true; + Bitmap bitmap = BitmapFactory.decodeStream(byteArrayInputStream, null, options); + options.inJustDecodeBounds = false; + int originWidth = options.outWidth; + int originHeight = options.outHeight; + float defaultHeoght = 240f; + float defaultWidth = 160f; + int sampleSize = 1; + if (originWidth > originHeight && originWidth > defaultWidth) { + sampleSize = (int) (options.outWidth / defaultWidth); + } else if (originWidth < originHeight && originHeight > defaultHeoght) { + sampleSize = (int) (options.outHeight / defaultHeoght); + } + if (sampleSize <= 0) { + sampleSize = 1; + } + options.inSampleSize = sampleSize; + options.inPreferredConfig = Bitmap.Config.RGB_565; + byteArrayInputStream = new ByteArrayInputStream(baos.toByteArray()); + bitmap = BitmapFactory.decodeStream(byteArrayInputStream, null, options); + return bitmap; + } + + /** + * 按质量压缩,并将图像生成指定的路径 + */ + public static Bitmap compressImage(Context context,String url, Bitmap image) { + if (image == null || TextUtils.isEmpty(url)) { + return null; + } + FileOutputStream fos = null; + try { + String outpath = UdeskUtils.getPathByUrl(context, UdeskConst.FileImg, url); + ByteArrayOutputStream os = new ByteArrayOutputStream(); + int options = 100; + image.compress(Bitmap.CompressFormat.JPEG, options, os); + while (os.toByteArray().length / 1024 > 50) { + os.reset(); + options -= 10; + image.compress(Bitmap.CompressFormat.JPEG, options, os); + } + fos = new FileOutputStream(outpath); + fos.write(os.toByteArray()); + fos.flush(); + + ByteArrayInputStream inputStream = new ByteArrayInputStream(os.toByteArray()); + return BitmapFactory.decodeStream(inputStream, null, null); + } catch (Exception e) { + e.printStackTrace(); + } finally { + if (fos != null) { + try { + fos.close(); + } catch (Exception e) { + e.printStackTrace(); + } + } + + } + return null; + } + public static int getBitmapSize(Bitmap bitmap) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { //API 19 + return bitmap.getAllocationByteCount(); + } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR1) {//API 12 + return bitmap.getByteCount(); + } + return bitmap.getRowBytes() * bitmap.getHeight(); //earlier version + } + public static List getRandomNum(int count,int size){ + Random random=new Random(); + List list=new ArrayList<>(); + while (list.size() list = new ArrayList<>(); - - - MessageAdatper(Activity context) { - mContext = context; - - } - - @Override - public int getCount() { - return list.size(); - } - - public List getList() { - return list; - } - - /** - * @return 返回当前位置消息的类型和方向标识 - */ - @Override - public int getItemViewType(int position) { - try { - MessageInfo message = getItem(position); - if (message == null) { - return ILLEGAL; - } - if (message instanceof UdeskCommodityItem) { - return COMMODITY; - } - if (message instanceof UdeskQueueItem) { - return MSG_IN_THE_LINE; - } - switch (UdeskConst.parseTypeForMessage(message.getMsgtype())) { - case UdeskConst.ChatMsgTypeInt.TYPE_IMAGE: - if (message.getDirection() == UdeskConst.ChatMsgDirection.Recv) { - return MSG_IMG_L; - } else { - return MSG_IMG_R; - } - case UdeskConst.ChatMsgTypeInt.TYPE_TEXT: - if (message.getDirection() == UdeskConst.ChatMsgDirection.Recv) { - return MSG_TXT_L; - } else { - return MSG_TXT_R; - } - case UdeskConst.ChatMsgTypeInt.TYPE_RICH: - return RICH_TEXT; - case UdeskConst.ChatMsgTypeInt.TYPE_AUDIO: - if (message.getDirection() == UdeskConst.ChatMsgDirection.Recv) { - return MSG_AUDIO_L; - } else { - return MSG_AUDIO_R; - } - case UdeskConst.ChatMsgTypeInt.TYPE_REDIRECT: - return MSG_REDIRECT; - case UdeskConst.ChatMsgTypeInt.TYPE_STRUCT: - return MSG_STRUCT; - case UdeskConst.ChatMsgTypeInt.TYPE_LEAVEMSG: - if (message.getDirection() == UdeskConst.ChatMsgDirection.Recv) { - return LEAVEMSG_TXT_L; - } else { - return LEAVEMSG_TXT_R; - } - case UdeskConst.ChatMsgTypeInt.TYPE_FILE: - if (message.getDirection() == UdeskConst.ChatMsgDirection.Recv) { - return MSG_FILE_L; - } else { - return MSG_FILE_R; - } - case UdeskConst.ChatMsgTypeInt.TYPE_VIDEO: - if (message.getDirection() == UdeskConst.ChatMsgDirection.Recv) { - return MSG_SMALL_VIDEO_L; - } else { - return MSG_SMALL_VIDEO_R; - } - case UdeskConst.ChatMsgTypeInt.TYPE_EVENT: - return Udesk_Event; - - case UdeskConst.ChatMsgTypeInt.TYPE_LOCATION: - return MSG_LOCATION_R; - case UdeskConst.ChatMsgTypeInt.TYPE_Video_Txt: - if (message.getDirection() == UdeskConst.ChatMsgDirection.Recv) { - return MSG_Video_Txt_l; - } else { - return MSG_Video_Txt_R; - } - case UdeskConst.ChatMsgTypeInt.TYPE_PRODUCT: - if (message.getDirection() == UdeskConst.ChatMsgDirection.Send) { - return MSG_PRODUCT_R; - } - default: - return ILLEGAL; - } - } catch (Exception e) { - e.printStackTrace(); - return ILLEGAL; - } - - } - - /** - * @return 返回有多少种UI布局样式 - */ - @Override - public int getViewTypeCount() { - if (layoutRes.length > 0) { - return layoutRes.length; - } - return super.getViewTypeCount(); - } - - void removeQueueMessage(MessageInfo message) { - if (message == null) { - return; - } - try { - list.contains(message); - list.remove(message); - notifyDataSetChanged(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - /** - * 添加一条消息 - */ - void addItem(MessageInfo message) { - if (message == null) { - return; - } - //不是撤回消息则过滤含有相同msgID的消息,如果是撤回消息则替换掉 - try { - for (MessageInfo info : list) { - if (!TextUtils.isEmpty(message.getMsgId()) && - !TextUtils.isEmpty(info.getMsgId()) && - message.getMsgId().equals(info.getMsgId())) { - - if (message.getSend_status().equals("rollback")) { - String content = String.format(mContext.getString(R.string.udesk_rollback_tips), message.getMsgContent()); - message.setMsgContent(content); - UdeskDBManager.getInstance().addMessageInfo(message); - list.remove(info); - break; - } - return; - - } - } - if (!TextUtils.isEmpty(message.getSubsessionid()) && message.getDirection() == UdeskConst.ChatMsgDirection.Recv && !message.getSend_status().equals("rollback")) { - isNeedLoadMessage(message); - } - list.add(message); - notifyDataSetChanged(); - } catch (Exception e) { - e.printStackTrace(); - } - - } - - //判断是否有跳序 - private void isNeedLoadMessage(MessageInfo message) { - try { - if (list.isEmpty()) { - return; - } - for (int i = list.size() - 1; i > 0; i--) { - MessageInfo messageUI = list.get(i); - if (!TextUtils.isEmpty(messageUI.getSubsessionid()) - && messageUI.getSubsessionid().equals(message.getSubsessionid()) - && messageUI.getDirection() == UdeskConst.ChatMsgDirection.Recv - && message.getSeqNum() - messageUI.getSeqNum() != 1) { - ((UdeskChatActivity) mContext).pullByJumpOrder(messageUI.getSeqNum(), messageUI.getSubsessionid()); - return; - } - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - void listAddItems(List messages, boolean isMore) { - try { - if (messages == null) { - return; - } - if (isMore) { - messages.addAll(list); - list.clear(); - list = messages; - } else { - list.clear(); - list.addAll(messages); - } - notifyDataSetChanged(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - - void listAddEventItems(List messages) { - try { - if (messages == null) { - return; - } - list.addAll(messages); - notifyDataSetChanged(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - - @Override - public MessageInfo getItem(int position) { - if (position < 0 || position >= list.size()) { - return null; - } - return list.get(position); - } - - @Override - public long getItemId(int position) { - return position; - } - - - @Override - public View getView(int position, View convertView, ViewGroup parent) { - try { - MessageInfo msgInfo = getItem(position); - if (msgInfo != null) { - int itemType = getItemViewType(position); - convertView = initView(convertView, itemType); - BaseViewHolder holder = (BaseViewHolder) convertView.getTag(); - tryShowTime(position, holder, msgInfo); - holder.setMessage(msgInfo); - holder.initHead(itemType); - holder.showStatusOrProgressBar(); - holder.bind(mContext); - } - } catch (Exception e) { - e.printStackTrace(); - } - return convertView; - } - - /** - * 根据传入的 itemType代表消息的类型和方向标识 初始相对应的UI控件 - */ - private View initView(View convertView, int itemType) { - if (convertView == null) { - try { - convertView = LayoutInflater.from(mContext).inflate( - layoutRes[itemType], null); - switch (itemType) { - case LEAVEMSG_TXT_L: - LeaveMsgViewHolder lleaveMsgViewHolder = new LeaveMsgViewHolder(); - initItemNormalView(convertView, lleaveMsgViewHolder); - lleaveMsgViewHolder.tvMsg = (TextView) convertView.findViewById(R.id.udesk_tv_msg); - UdekConfigUtil.setUITextColor(UdeskSDKManager.getInstance().getUdeskConfig().udeskIMLeftTextColorResId, lleaveMsgViewHolder.tvMsg); - convertView.setTag(lleaveMsgViewHolder); - break; - case LEAVEMSG_TXT_R: - LeaveMsgViewHolder rleaveMsgViewHolder = new LeaveMsgViewHolder(); - initItemNormalView(convertView, rleaveMsgViewHolder); - rleaveMsgViewHolder.tvMsg = (TextView) convertView.findViewById(R.id.udesk_tv_msg); - UdekConfigUtil.setUITextColor(UdeskSDKManager.getInstance().getUdeskConfig().udeskIMRightTextColorResId, rleaveMsgViewHolder.tvMsg); - convertView.setTag(rleaveMsgViewHolder); - break; - case MSG_TXT_L: - TxtViewHolder ltxtViewholder = new TxtViewHolder(); - initItemNormalView(convertView, ltxtViewholder); - ltxtViewholder.tvMsg = (TextView) convertView.findViewById(R.id.udesk_tv_msg); - UdekConfigUtil.setUITextColor(UdeskSDKManager.getInstance().getUdeskConfig().udeskIMLeftTextColorResId, ltxtViewholder.tvMsg); - convertView.setTag(ltxtViewholder); - break; - case MSG_TXT_R: - TxtViewHolder rtxtViewholder = new TxtViewHolder(); - initItemNormalView(convertView, rtxtViewholder); - rtxtViewholder.tvMsg = (TextView) convertView.findViewById(R.id.udesk_tv_msg); - UdekConfigUtil.setUITextColor(UdeskSDKManager.getInstance().getUdeskConfig().udeskIMRightTextColorResId, rtxtViewholder.tvMsg); - convertView.setTag(rtxtViewholder); - break; - case MSG_PRODUCT_R: - ProductViewHolder productViewHolder = new ProductViewHolder(); - initItemNormalView(convertView, productViewHolder); - productViewHolder.tvMsg = (TextView) convertView.findViewById(R.id.udesk_tv_msg); - productViewHolder.product_name = (TextView) convertView.findViewById(R.id.product_name); - productViewHolder.productView = convertView.findViewById(R.id.product_view); - productViewHolder.imgView = (SimpleDraweeView) convertView.findViewById(R.id.udesk_product_icon); - convertView.setTag(productViewHolder); - break; - case RICH_TEXT: - RichTextViewHolder richTextViewHolder = new RichTextViewHolder(); - initItemNormalView(convertView, richTextViewHolder); - richTextViewHolder.rich_tvmsg = (TextView) convertView.findViewById(R.id.udesk_tv_rich_msg); - UdekConfigUtil.setUITextColor(UdeskSDKManager.getInstance().getUdeskConfig().udeskIMLeftTextColorResId, richTextViewHolder.rich_tvmsg); - convertView.setTag(richTextViewHolder); - break; - case MSG_AUDIO_L: - case MSG_AUDIO_R: - AudioViewHolder audioViewHolder = new AudioViewHolder(); - initItemNormalView(convertView, audioViewHolder); - audioViewHolder.tvDuration = (TextView) convertView - .findViewById(R.id.udesk_im_item_record_duration); - audioViewHolder.record_item_content = convertView.findViewById(R.id.udesk_im_record_item_content); - audioViewHolder.record_play = (ImageView) convertView.findViewById(R.id.udesk_im_item_record_play); - convertView.setTag(audioViewHolder); - break; - case MSG_IMG_L: - case MSG_IMG_R: - ImgViewHolder imgViewHolder = new ImgViewHolder(); - initItemNormalView(convertView, imgViewHolder); - imgViewHolder.imgView = (SimpleDraweeView) convertView.findViewById(R.id.udesk_im_image); - imgViewHolder.percent = (TextView) convertView.findViewById(R.id.udesk_precent); - convertView.setTag(imgViewHolder); - break; - case MSG_SMALL_VIDEO_L: - case MSG_SMALL_VIDEO_R: - SmallVideoViewHolder smallVideoViewHolder = new SmallVideoViewHolder(); - initItemNormalView(convertView, smallVideoViewHolder); - smallVideoViewHolder.imgView = (SimpleDraweeView) convertView.findViewById(R.id.udesk_im_image); - smallVideoViewHolder.cancleImg = (ImageView) convertView.findViewById(R.id.udesk_iv_cancle); - smallVideoViewHolder.video_tip = (ImageView) convertView.findViewById(R.id.video_tip); - smallVideoViewHolder.circleProgressBar = (CircleProgressBar) convertView.findViewById(R.id.video_upload_bar); - convertView.setTag(smallVideoViewHolder); - break; - case MSG_FILE_L: - case MSG_FILE_R: - FileViewHolder fileViewHolder = new FileViewHolder(); - initItemNormalView(convertView, fileViewHolder); - fileViewHolder.fielTitle = (TextView) convertView.findViewById(R.id.udesk_file_name); - fileViewHolder.udeskFileView = convertView.findViewById(R.id.udesk_file_view); - fileViewHolder.fielSize = (TextView) convertView.findViewById(R.id.udesk_file_size); - fileViewHolder.operater = (TextView) convertView.findViewById(R.id.udesk_file_operater); - fileViewHolder.mProgress = (ProgressBar) convertView.findViewById(R.id.udesk_progress); - convertView.setTag(fileViewHolder); - break; - case MSG_REDIRECT: - RedirectViewHolder redirectViewHolder = new RedirectViewHolder(); - initItemNormalView(convertView, redirectViewHolder); - redirectViewHolder.redirectMsg = (TextView) convertView.findViewById(R.id.udesk_redirect_msg); - UdekConfigUtil.setUITextColor(UdeskSDKManager.getInstance().getUdeskConfig().udeskIMTipTextColorResId, redirectViewHolder.redirectMsg); - convertView.setTag(redirectViewHolder); - break; - case COMMODITY: - CommodityViewHolder commodityViewHolder = new CommodityViewHolder(); - commodityViewHolder.rootView = convertView.findViewById(R.id.udesk_commit_root); - commodityViewHolder.tvTime = (TextView) convertView.findViewById(R.id.udesk_tv_time); - commodityViewHolder.thumbnail = (SimpleDraweeView) convertView - .findViewById(R.id.udesk_im_commondity_thumbnail); - commodityViewHolder.title = (TextView) convertView - .findViewById(R.id.udesk_im_commondity_title); - commodityViewHolder.subTitle = (TextView) convertView - .findViewById(R.id.udesk_im_commondity_subtitle); - commodityViewHolder.link = (TextView) convertView - .findViewById(R.id.udesk_im_commondity_link); - UdekConfigUtil.setUIbgDrawable(UdeskSDKManager.getInstance().getUdeskConfig().udeskCommityBgResId, commodityViewHolder.rootView); - UdekConfigUtil.setUITextColor(UdeskSDKManager.getInstance().getUdeskConfig().udeskCommityTitleColorResId, commodityViewHolder.title); - UdekConfigUtil.setUITextColor(UdeskSDKManager.getInstance().getUdeskConfig().udeskCommitysubtitleColorResId, commodityViewHolder.subTitle); - UdekConfigUtil.setUITextColor(UdeskSDKManager.getInstance().getUdeskConfig().udeskCommityLinkColorResId, commodityViewHolder.link); - convertView.setTag(commodityViewHolder); - break; - case MSG_STRUCT: - StructViewHolder structViewHolder = new StructViewHolder(); - initItemNormalView(convertView, structViewHolder); - structViewHolder.structImgView = convertView.findViewById(R.id.udesk_struct_img_container); - structViewHolder.structTextView = convertView.findViewById(R.id.udesk_struct_text_container); - structViewHolder.structBtnLineayLayout = (LinearLayout) convertView.findViewById(R.id.udesk_struct_btn_container); - structViewHolder.structImg = (SimpleDraweeView) convertView.findViewById(R.id.udesk_struct_img); - structViewHolder.structTitle = (TextView) convertView.findViewById(R.id.udesk_struct_title); - structViewHolder.structDes = (TextView) convertView.findViewById(R.id.udesk_struct_des); - convertView.setTag(structViewHolder); - break; - case Udesk_Event: - UdeskEventViewHolder eventViewHolder = new UdeskEventViewHolder(); - initItemNormalView(convertView, eventViewHolder); - eventViewHolder.events = (TextView) convertView.findViewById(R.id.udesk_event); - convertView.setTag(eventViewHolder); - break; - case MSG_LOCATION_R: - MapViewHolder mapViewHolder = new MapViewHolder(); - initItemNormalView(convertView, mapViewHolder); - mapViewHolder.locationValue = (TextView) convertView.findViewById(R.id.postion_value); - mapViewHolder.cropBitMap = (SimpleDraweeView) convertView.findViewById(R.id.udesk_location_image); - convertView.setTag(mapViewHolder); - break; - case MSG_Video_Txt_l: - VideoTxtViewHolder lvideoTxtViewHolder = new VideoTxtViewHolder(); - initItemNormalView(convertView, lvideoTxtViewHolder); - lvideoTxtViewHolder.tvMsg = (TextView) convertView.findViewById(R.id.udesk_tv_msg); - UdekConfigUtil.setUITextColor(UdeskSDKManager.getInstance().getUdeskConfig().udeskIMLeftTextColorResId, lvideoTxtViewHolder.tvMsg); - convertView.setTag(lvideoTxtViewHolder); - break; - case MSG_Video_Txt_R: - VideoTxtViewHolder videoTxtViewHolder = new VideoTxtViewHolder(); - initItemNormalView(convertView, videoTxtViewHolder); - videoTxtViewHolder.tvMsg = (TextView) convertView.findViewById(R.id.udesk_tv_msg); - UdekConfigUtil.setUITextColor(UdeskSDKManager.getInstance().getUdeskConfig().udeskIMRightTextColorResId, videoTxtViewHolder.tvMsg); - convertView.setTag(videoTxtViewHolder); - break; - case MSG_IN_THE_LINE: - UdeskInLineViewHolder lineViewHolder = new UdeskInLineViewHolder(); - initItemNormalView(convertView, lineViewHolder); - lineViewHolder.leaveingMsg = (TextView) convertView.findViewById(R.id.udesk_leaveing_msg); - lineViewHolder.queueContext = convertView.findViewById(R.id.udesk_queue_context); - convertView.setTag(lineViewHolder); - break; - } - } catch (Exception e) { - e.printStackTrace(); - } - } - return convertView; - } - - - abstract class BaseViewHolder { - SimpleDraweeView ivHeader; - ImageView ivStatus; - TextView tvTime; - ProgressBar pbWait; - TextView agentnickName; - MessageInfo message; - int itemType; - boolean isLeft = false; - - public void setMessage(MessageInfo message) { - this.message = message; - } - - public MessageInfo getMessage() { - return message; - } - - /** - * 根据收发消息的标识,设置客服客户的头像 - */ - void initHead(int itemType) { - try { - this.itemType = itemType; - switch (itemType) { - case MSG_TXT_R: - case MSG_AUDIO_R: - case MSG_IMG_R: - case LEAVEMSG_TXT_R: - case MSG_FILE_R: - case MSG_LOCATION_R: - case MSG_Video_Txt_R: - case MSG_SMALL_VIDEO_R: - case MSG_PRODUCT_R: - this.isLeft = false; - if (!TextUtils.isEmpty(UdeskSDKManager.getInstance().getUdeskConfig().customerUrl)) { - UdeskUtil.loadHeadView(mContext, ivHeader, Uri.parse(UdeskSDKManager.getInstance().getUdeskConfig().customerUrl)); - } - break; - - case MSG_TXT_L: - case MSG_AUDIO_L: - case RICH_TEXT: - case MSG_IMG_L: - case MSG_STRUCT: - case MSG_FILE_L: - case LEAVEMSG_TXT_L: - case MSG_Video_Txt_l: - this.isLeft = true; - ivHeader.setImageResource(R.drawable.udesk_im_default_agent_avatar); - if (message.getUser_avatar() != null && !TextUtils.isEmpty(message.getUser_avatar().trim())) { - UdeskUtil.loadHeadView(mContext, ivHeader, Uri.parse(message.getUser_avatar())); - } - if (!TextUtils.isEmpty(message.getReplyUser())) { - agentnickName.setVisibility(View.VISIBLE); - agentnickName.setText(message.getReplyUser()); - } else { - agentnickName.setVisibility(View.GONE); - } - - break; - default: - break; - } - } catch (Exception e) { - e.printStackTrace(); - } - - } - - /** - * 设置消息发送状态 发送中,发送成功, 发送失败 - */ - void showStatusOrProgressBar() { - try { - if (itemType == COMMODITY - || itemType == Udesk_Event - || itemType == MSG_SMALL_VIDEO_R - || itemType == MSG_IN_THE_LINE) { - return; - } - if (itemType == MSG_TXT_L - || itemType == MSG_AUDIO_L - || itemType == MSG_IMG_L - || itemType == MSG_REDIRECT - || itemType == MSG_STRUCT - || itemType == MSG_SMALL_VIDEO_L - ) { - ivStatus.setVisibility(View.GONE); - } else { - changeUiState(message.getSendFlag()); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - void changeUiState(int state) { - try { - if (state == UdeskConst.SendFlag.RESULT_SUCCESS) { - ivStatus.setVisibility(View.GONE); - pbWait.setVisibility(View.GONE); - } else { - if (state == UdeskConst.SendFlag.RESULT_RETRY || state == UdeskConst.SendFlag.RESULT_SEND) { - ivStatus.setVisibility(View.GONE); - pbWait.setVisibility(View.VISIBLE); - } else if (state == UdeskConst.SendFlag.RESULT_FAIL) { - ivStatus.setVisibility(View.VISIBLE); - pbWait.setVisibility(View.GONE); - } - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - abstract void bind(Context context); - - } - - /** - * 展示富文本消息 - */ - class RichTextViewHolder extends BaseViewHolder { - - TextView rich_tvmsg; - - @Override - void bind(Context context) { - try { - CharSequence charSequence = Html.fromHtml(message.getMsgContent()); - String msg = charSequence.toString(); - if (msg.endsWith("\n\n")) { - charSequence = charSequence.subSequence(0, charSequence.length() - 2); - rich_tvmsg.setText(charSequence); - } else { - rich_tvmsg.setText(charSequence); - } - Linkify.addLinks(rich_tvmsg, WEB_URL, null); - Linkify.addLinks(rich_tvmsg, PHONE, null); - CharSequence text = rich_tvmsg.getText(); - if (text instanceof Spannable) { - int end = text.length(); - Spannable sp = (Spannable) rich_tvmsg.getText(); - URLSpan[] urls = sp.getSpans(0, end, URLSpan.class); - SpannableStringBuilder style = new SpannableStringBuilder(text); - style.clearSpans(); - for (URLSpan url : urls) { - MyURLSpan myURLSpan = new MyURLSpan(url.getURL()); - style.setSpan(myURLSpan, sp.getSpanStart(url), - sp.getSpanEnd(url), - Spannable.SPAN_EXCLUSIVE_INCLUSIVE); - } - rich_tvmsg.setText(style); - } else if (text instanceof SpannedString) { - SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder(charSequence); - URLSpan[] urls = spannableStringBuilder.getSpans(0, charSequence.length(), URLSpan.class); - spannableStringBuilder.clearSpans(); - SpannedString sp = (SpannedString) rich_tvmsg.getText(); - for (URLSpan url : urls) { - MyURLSpan myURLSpan = new MyURLSpan(url.getURL()); - int statr = sp.getSpanStart(url); - int end = sp.getSpanEnd(url); - spannableStringBuilder.setSpan(myURLSpan, statr, - end, - Spannable.SPAN_EXCLUSIVE_INCLUSIVE); - } - rich_tvmsg.setText(spannableStringBuilder); - rich_tvmsg.setMovementMethod(LinkMovementMethod.getInstance()); - } - - } catch (Exception e) { - e.printStackTrace(); - } catch (OutOfMemoryError error) { - error.printStackTrace(); - } - - } - - } - - /** - * 重写ClickableSpan 实现富文本点击事件跳转到UdeskWebViewUrlAcivity界面 - */ - private class MyURLSpan extends ClickableSpan { - - private final String mUrl; - - MyURLSpan(String url) { - mUrl = url; - } - - @Override - public void onClick(View widget) { - try { - if (WEB_URL.matcher(mUrl).find()) { - Intent intent = new Intent(mContext, UdeskWebViewUrlAcivity.class); - intent.putExtra(UdeskConst.WELCOME_URL, mUrl); - mContext.startActivity(intent); - } else if (PHONE.matcher(mUrl).find()) { - String phone = mUrl.toLowerCase(); - if (!phone.startsWith("tel:")) { - phone = "tel:" + mUrl; - } - ((UdeskChatActivity) mContext).callphone(phone); - } - } catch (Exception e) { - e.printStackTrace(); - } catch (OutOfMemoryError error) { - error.printStackTrace(); - } - } - } - - //文本消息的url事件拦截处理。 客户设置了事件则走客户的事件,没走默认弹出界面 - private class TxtURLSpan extends ClickableSpan { - - private final String mUrl; - - TxtURLSpan(String url) { - mUrl = url; - } - - - @Override - public void onClick(View widget) { - try { - if (UdeskSDKManager.getInstance().getUdeskConfig().txtMessageClick != null) { - UdeskSDKManager.getInstance().getUdeskConfig().txtMessageClick.txtMsgOnclick(mUrl); - } else if (WEB_URL.matcher(mUrl).find()) { - Intent intent = new Intent(mContext, UdeskWebViewUrlAcivity.class); - intent.putExtra(UdeskConst.WELCOME_URL, mUrl); - mContext.startActivity(intent); - } else if (PHONE.matcher(mUrl).find()) { - String phone = mUrl.toLowerCase(); - if (!phone.startsWith("tel:")) { - phone = "tel:" + mUrl; - } - ((UdeskChatActivity) mContext).callphone(phone); - } - } catch (Exception e) { - e.printStackTrace(); - } - - } - } - - /** - * 展示文本消息 - */ - class TxtViewHolder extends BaseViewHolder { - TextView tvMsg; - - @Override - void bind(Context context) { - try { - //设置文本消息内容,表情符转换对应的表情,没表情的另外处理 - if (MoonUtils.isHasEmotions(message.getMsgContent())) { - tvMsg.setText(MoonUtils.replaceEmoticons(context, message.getMsgContent(), - (int) tvMsg.getTextSize())); - } else { - tvMsg.setText(message.getMsgContent()); - tvMsg.setMovementMethod(LinkMovementMethod.getInstance()); - CharSequence text = tvMsg.getText(); - if (text instanceof Spannable) { - int end = text.length(); - Spannable sp = (Spannable) tvMsg.getText(); - URLSpan[] urls = sp.getSpans(0, end, URLSpan.class); - SpannableStringBuilder style = new SpannableStringBuilder(text); - style.clearSpans();// should clear old spans - for (URLSpan url : urls) { - TxtURLSpan txtURLSpan = new TxtURLSpan(url.getURL()); - style.setSpan(txtURLSpan, sp.getSpanStart(url), - sp.getSpanEnd(url), - Spannable.SPAN_EXCLUSIVE_INCLUSIVE); - } - tvMsg.setText(style); - } - } - //设置消息长按事件 复制文本 - tvMsg.setOnLongClickListener(new OnLongClickListener() { - - @Override - public boolean onLongClick(View v) { - ((UdeskChatActivity) mContext).handleText(message, v); - return false; - } - }); - - //重发按钮点击事件 - ivStatus.setOnClickListener(new OnClickListener() { - - @Override - public void onClick(View v) { - ((UdeskChatActivity) mContext).retrySendMsg(message); - } - }); - } catch (Exception e) { - e.printStackTrace(); - } - } - } - - /** - * 展示商品消息 - */ - class ProductViewHolder extends BaseViewHolder { - TextView tvMsg; - TextView product_name; - View productView; - SimpleDraweeView imgView; - String productUrl; - - @Override - void bind(Context context) { - try { - JSONObject jsonObject = new JSONObject(message.getMsgContent()); - if (!TextUtils.isEmpty(jsonObject.optString("imgUrl"))) { - imgView.setVisibility(View.VISIBLE); - UdeskUtil.loadNoChangeView(context.getApplicationContext(), imgView, Uri.parse(jsonObject.optString("imgUrl"))); - } else { - imgView.setVisibility(View.GONE); - } - productUrl = jsonObject.optString("url"); - product_name.setText(jsonObject.optString("name")); - if (!TextUtils.isEmpty(productUrl)) { - product_name.setTextColor(mContext.getResources().getColor(UdeskSDKManager.getInstance().getUdeskConfig().udeskProductNameLinkColorResId)); - product_name.setOnClickListener(new OnClickListener() { - @Override - public void onClick(View view) { - if (UdeskSDKManager.getInstance().getUdeskConfig().productMessageClick != null) { - UdeskSDKManager.getInstance().getUdeskConfig().productMessageClick.txtMsgOnclick(productUrl); - } else { - Intent intent = new Intent(mContext, UdeskWebViewUrlAcivity.class); - intent.putExtra(UdeskConst.WELCOME_URL, productUrl); - mContext.startActivity(intent); - } - } - }); - } - - StringBuilder builder = new StringBuilder(); - builder.append(""); - JSONArray jsonArray = jsonObject.getJSONArray("params"); - if (jsonArray != null && jsonArray.length() > 0) { - for (int i = 0; i < jsonArray.length(); i++) { - JSONObject data = jsonArray.optJSONObject(i); - if (TextUtils.isEmpty(data.optString("text"))) { - continue; - } - String textStr = "" + data.optString("text") + ""; - if (data.optBoolean("fold")) { - textStr = "" + textStr + ""; - } - if (data.optBoolean("break")) { - textStr = textStr + "
"; - } - builder.append(textStr); - } - } - String htmlString = builder.toString().replaceAll("font", HtmlTagHandler.TAG_FONT); - Spanned fromHtml = Html.fromHtml(htmlString, null, new HtmlTagHandler()); - tvMsg.setText(fromHtml); -// //设置消息长按事件 复制文本 -// tvMsg.setOnLongClickListener(new OnLongClickListener() { -// -// @Override -// public boolean onLongClick(View v) { -// ((UdeskChatActivity) mContext).handleText(message, v); -// return false; -// } -// }); - //重发按钮点击事件 - ivStatus.setOnClickListener(new OnClickListener() { - - @Override - public void onClick(View v) { - ((UdeskChatActivity) mContext).retrySendMsg(message); - } - }); - } catch (Exception e) { - e.printStackTrace(); - } - } - } - - - /** - * 展示文件消息 - */ - class FileViewHolder extends BaseViewHolder { - View udeskFileView; - TextView fielTitle; - TextView fielSize; - TextView operater; - ProgressBar mProgress; - - @Override - void bind(Context context) { - try { - if (message.getDirection() == UdeskConst.ChatMsgDirection.Send) { - if (TextUtils.isEmpty(message.getFilename())) { - fielTitle.setText(UdeskUtil.getFileName(message.getLocalPath())); - } else { - fielTitle.setText(message.getFilename()); - } - - if (TextUtils.isEmpty(message.getFilesize())) { - fielSize.setText(UdeskUtil.getFileSizeByLoaclPath(message.getLocalPath())); - } else { - fielSize.setText(message.getFilesize()); - } - if (message.getSendFlag() == UdeskConst.SendFlag.RESULT_SUCCESS) { - mProgress.setProgress(100); - operater.setText(mContext.getString(R.string.udesk_has_send)); - } else { - mProgress.setProgress(message.getPrecent()); - operater.setText(String.format("%s%%", String.valueOf(message.getPrecent()))); - } - } else { - fielTitle.setText(message.getFilename()); - fielSize.setText(message.getFilesize()); - if (UdeskUtils.fileIsExitByUrl(mContext, UdeskConst.File_File, message.getMsgContent()) - && UdeskUtils.getFileSize(UdeskUtils.getFileByUrl(context, UdeskConst.File_File, message.getMsgContent())) > 0) { - mProgress.setProgress(100); - operater.setText(mContext.getString(R.string.udesk_has_downed)); - } else { - mProgress.setProgress(0); - operater.setText(mContext.getString(R.string.udesk_has_download)); - } - operater.setOnClickListener(new OnClickListener() { - @Override - public void onClick(View view) { - ((UdeskChatActivity) mContext).downLoadMsg(message); - } - }); - } - - udeskFileView.setOnClickListener(new OnClickListener() { - @Override - public void onClick(View view) { - try { - Intent intent = new Intent(Intent.ACTION_VIEW); - File file; - if (message.getDirection() == UdeskConst.ChatMsgDirection.Send) { - file = new File(message.getLocalPath()); - } else { - file = UdeskUtils.getFileByUrl(mContext, UdeskConst.File_File, message.getMsgContent()); - if (file == null || UdeskUtils.getFileSize(file) <= 0) { - Toast.makeText(mContext.getApplicationContext(), mContext.getString(R.string.udesk_has_uncomplete_tip), Toast.LENGTH_SHORT).show(); - return; - } - } - Uri contentUri; - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { - intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); - contentUri = UdeskFileProvider.getUriForFile(mContext, UdeskUtil.getFileProviderName(mContext), file); - } else { - contentUri = Uri.fromFile(file); - } - if (contentUri == null) { - return; - } - if (message.getMsgtype().equals(UdeskConst.ChatMsgTypeString.TYPE_VIDEO)) { - intent.setDataAndType(contentUri, "video/mp4"); - } else { - String type = UdeskUtil.getMIMEType(file); - intent.setDataAndType(contentUri, type); - } - mContext.startActivity(intent); - } catch (Exception e) { - if (!TextUtils.isEmpty(e.getMessage()) && e.getMessage().contains("No Activity found to handle Intent")) { - Toast.makeText(mContext.getApplication(), mContext.getString(R.string.udesk_no_app_handle), Toast.LENGTH_SHORT).show(); - } - } - } - }); - - //设置重发按钮的点击事件 - ivStatus.setOnClickListener(new OnClickListener() { - - @Override - public void onClick(View v) { - ((UdeskChatActivity) mContext).retrySendMsg(message); - } - }); - } catch (Exception e) { - e.printStackTrace(); - } catch (OutOfMemoryError error) { - error.printStackTrace(); - } - } - - } - - - /** - * 展示留言消息 - */ - class LeaveMsgViewHolder extends BaseViewHolder { - TextView tvMsg; - - @Override - void bind(Context context) { - try { - //设置文本消息内容,表情符转换对应的表情,没表情的另外处理 - if (MoonUtils.isHasEmotions(message.getMsgContent())) { - tvMsg.setText(MoonUtils.replaceEmoticons(context, message.getMsgContent(), (int) tvMsg.getTextSize())); - } else { - tvMsg.setText(message.getMsgContent()); - tvMsg.setMovementMethod(LinkMovementMethod.getInstance()); - CharSequence text = tvMsg.getText(); - if (text instanceof Spannable) { - int end = text.length(); - Spannable sp = (Spannable) tvMsg.getText(); - URLSpan[] urls = sp.getSpans(0, end, URLSpan.class); - SpannableStringBuilder style = new SpannableStringBuilder(text); - style.clearSpans();// should clear old spans - for (URLSpan url : urls) { - TxtURLSpan txtURLSpan = new TxtURLSpan(url.getURL()); - style.setSpan(txtURLSpan, sp.getSpanStart(url), - sp.getSpanEnd(url), - Spannable.SPAN_EXCLUSIVE_INCLUSIVE); - } - tvMsg.setText(style); - } - } - - //设置消息长按事件 复制文本 - tvMsg.setOnLongClickListener(new OnLongClickListener() { - - @Override - public boolean onLongClick(View v) { - ((UdeskChatActivity) mContext).handleText(message, v); - return false; - } - }); - - //设置重发按钮的点击事件 - ivStatus.setOnClickListener(new OnClickListener() { - - @Override - public void onClick(View v) { - ((UdeskChatActivity) mContext).retrySendMsg(message); - } - }); - } catch (Exception e) { - e.printStackTrace(); - } catch (OutOfMemoryError error) { - error.printStackTrace(); - } - } - - - } - - /** - * 展示语音消息 - */ - class AudioViewHolder extends BaseViewHolder { - TextView tvDuration; - View record_item_content; - ImageView record_play; - - @Override - void bind(Context context) { - try { - checkPlayBgWhenBind(); - if (message.getDuration() > 0) { - char symbol = 34; - tvDuration.setText(String.format("%d%s", message.getDuration(), String.valueOf(symbol))); - } - record_item_content.setOnClickListener(new OnClickListener() { - - @Override - public void onClick(View v) { - ((UdeskChatActivity) mContext).clickRecordFile(message); - } - }); - ivStatus.setOnClickListener(new OnClickListener() { - - @Override - public void onClick(View v) { - ((UdeskChatActivity) mContext).retrySendMsg(message); - } - }); - long duration = message.getDuration(); - duration = duration == 0 ? 1 : duration; - int min = UdeskUtils.getScreenWidth(mContext) / 6; - int max = UdeskUtils.getScreenWidth(mContext) * 3 / 5; - int step = (int) ((duration < 10) ? duration : (duration / 10 + 9)); - record_item_content.getLayoutParams().width = (step == 0) ? min - : (min + (max - min) / 17 * step);//计算17份 2份是给背景图尖角预留位置 - } catch (Exception e) { - e.printStackTrace(); - } catch (OutOfMemoryError error) { - error.printStackTrace(); - } - } - - private void checkPlayBgWhenBind() { - try { - if (message.isPlaying) { - resetAnimationAndStart(); - } else { - record_play.setImageDrawable(mContext.getResources().getDrawable( - isLeft ? R.drawable.udesk_im_record_left_default : R.drawable.udesk_im_record_right_default)); - } - } catch (Exception e) { - e.printStackTrace(); - } catch (OutOfMemoryError error) { - error.printStackTrace(); - } - } - - private void resetAnimationAndStart() { - try { - record_play.setImageDrawable(mContext.getResources().getDrawable( - isLeft ? R.drawable.udesk_im_record_play_left : R.drawable.udesk_im_record_play_right)); - Drawable playDrawable = record_play.getDrawable(); - if (playDrawable != null - && playDrawable instanceof AnimationDrawable) { - ((AnimationDrawable) playDrawable).start(); - } - } catch (Exception e) { - e.printStackTrace(); - } catch (OutOfMemoryError error) { - error.printStackTrace(); - } - } - - // 判断开始播放 - - void startAnimationDrawable() { - try { - message.isPlaying = true; - Drawable playDrawable = record_play.getDrawable(); - if (playDrawable instanceof AnimationDrawable) { - ((AnimationDrawable) playDrawable).start(); - } else { - resetAnimationAndStart(); - } - } catch (Exception e) { - e.printStackTrace(); - } catch (OutOfMemoryError error) { - error.printStackTrace(); - } - } - - // 关闭播放 - void endAnimationDrawable() { - try { - message.isPlaying = false; - - Drawable playDrawable = record_play.getDrawable(); - if (playDrawable != null - && playDrawable instanceof AnimationDrawable) { - ((AnimationDrawable) playDrawable).stop(); - ((AnimationDrawable) playDrawable).selectDrawable(0); - } - } catch (Exception e) { - e.printStackTrace(); - } catch (OutOfMemoryError error) { - error.printStackTrace(); - } - } - } - - /** - * 展示图片消息 - */ - public class ImgViewHolder extends BaseViewHolder { - SimpleDraweeView imgView; - TextView percent; - - @Override - void bind(Context context) { - try { - if (message.getSendFlag() == UdeskConst.SendFlag.RESULT_SUCCESS - || message.getSendFlag() == UdeskConst.SendFlag.RESULT_FAIL) { - percent.setVisibility(View.GONE); - } - if (!TextUtils.isEmpty(message.getLocalPath()) && UdeskUtils.isExitFileByPath(message.getLocalPath())) { - int[] wh = UdeskUtil.getImageWH(message.getLocalPath()); - UdeskUtil.loadFileFromSdcard(context, imgView, Uri.fromFile(new File(message.getLocalPath())), wh[0], wh[1]); - } else { - UdeskUtil.loadImageView(context, imgView, Uri.parse(UdeskUtils.uRLEncoder(message.getMsgContent()))); - } - - imgView.setTag(message.getTime()); - imgView.setOnClickListener(new OnClickListener() { - - @Override - public void onClick(View v) { - if (message == null) { - return; - } - Uri imgUri = null; - if (!TextUtils.isEmpty(message.getLocalPath())) { - imgUri = Uri.fromFile(new File(message.getLocalPath())); - } else if (!TextUtils.isEmpty(message.getMsgContent())) { - try { - imgUri = Uri.parse(UdeskUtils.uRLEncoder(message.getMsgContent())); - } catch (Exception e) { - imgUri = Uri.parse(message.getMsgContent()); - } - } - previewPhoto(mContext, imgUri); - } - }); - ivStatus.setOnClickListener(new OnClickListener() { - - @Override - public void onClick(View v) { - ((UdeskChatActivity) mContext).retrySendMsg(message); - } - }); - } catch (Exception e) { - e.printStackTrace(); - } catch (OutOfMemoryError error) { - error.printStackTrace(); - } - } - } - - - /** - * 展示小视频消息 - */ - public class SmallVideoViewHolder extends BaseViewHolder { - SimpleDraweeView imgView; - ImageView cancleImg; - ImageView video_tip; - CircleProgressBar circleProgressBar; - - void showSuccessView() { - try { - cancleImg.setVisibility(View.GONE); - circleProgressBar.setVisibility(View.GONE); - ivStatus.setVisibility(View.GONE); - pbWait.setVisibility(View.GONE); - video_tip.setVisibility(View.VISIBLE); - } catch (Exception e) { - e.printStackTrace(); - } - } - - void showFailureView() { - try { - ivStatus.setVisibility(View.VISIBLE); - pbWait.setVisibility(View.GONE); - cancleImg.setVisibility(View.GONE); - circleProgressBar.setVisibility(View.GONE); - video_tip.setVisibility(View.VISIBLE); - } catch (Exception e) { - e.printStackTrace(); - } - } - - void showSendView() { - try { - if (circleProgressBar.getPercent() == 100) { - pbWait.setVisibility(View.VISIBLE); - video_tip.setVisibility(View.VISIBLE); - cancleImg.setVisibility(View.GONE); - circleProgressBar.setVisibility(View.GONE); - } else { - pbWait.setVisibility(View.GONE); - cancleImg.setVisibility(View.VISIBLE); - circleProgressBar.setVisibility(View.VISIBLE); - circleProgressBar.setPercent(circleProgressBar.getPercent()); - video_tip.setVisibility(View.GONE); - } - ivStatus.setVisibility(View.GONE); - } catch (Exception e) { - e.printStackTrace(); - } - } - - @Override - void bind(Context context) { - try { - if (itemType == MSG_SMALL_VIDEO_L) { - showSuccessView(); - } else { - if (message.getSendFlag() == UdeskConst.SendFlag.RESULT_SUCCESS) { - showSuccessView(); - } else { - if (message.getSendFlag() == UdeskConst.SendFlag.RESULT_RETRY || message.getSendFlag() == UdeskConst.SendFlag.RESULT_SEND) { - showSendView(); - } else if (message.getSendFlag() == UdeskConst.SendFlag.RESULT_FAIL) { - showFailureView(); - } - } - } - - if (!TextUtils.isEmpty(message.getLocalPath()) && UdeskUtils.isExitFileByPath(message.getLocalPath())) { - UdeskUtil.loadViewBySize(context, imgView, Uri.fromFile(new File(message.getLocalPath())), UdeskUtil.dip2px(context, 130), UdeskUtil.dip2px(context, 200)); - } else if (UdeskUtils.fileIsExitByUrl(mContext, UdeskConst.FileImg, message.getMsgContent())) { - String loaclpath = UdeskUtils.getPathByUrl(mContext, UdeskConst.FileImg, message.getMsgContent()); - UdeskUtil.loadViewBySize(context, imgView, Uri.fromFile(new File(loaclpath)), UdeskUtil.dip2px(context, 130), UdeskUtil.dip2px(context, 200)); - } else { - ((UdeskChatActivity) mContext).showVideoThumbnail(message); - } - imgView.setTag(message.getTime()); - imgView.setOnClickListener(new OnClickListener() { - - @Override - public void onClick(View v) { - if (message == null) { - return; - } - String path = ""; - if (!TextUtils.isEmpty(message.getLocalPath()) && UdeskUtils.isExitFileByPath(message.getLocalPath())) { - path = message.getLocalPath(); - } else if (!TextUtils.isEmpty(message.getMsgContent())) { - File file = UdeskUtils.getFileByUrl(mContext, UdeskConst.FileVideo, message.getMsgContent()); - if (file != null && UdeskUtils.getFileSize(file) > 0) { - path = file.getPath(); - } else { - ((UdeskChatActivity) mContext).downLoadVideo(message); - path = message.getMsgContent(); - } - } - - Intent intent = new Intent(); - intent.setClass(mContext, PictureVideoPlayActivity.class); - Bundle data = new Bundle(); - data.putString(UdeskConst.PREVIEW_Video_Path, path); - intent.putExtras(data); - mContext.startActivity(intent); - } - }); - ivStatus.setOnClickListener(new OnClickListener() { - - @Override - public void onClick(View v) { - ((UdeskChatActivity) mContext).retrySendMsg(message); - } - }); - - cancleImg.setOnClickListener(new OnClickListener() { - @Override - public void onClick(View view) { - message.setSendFlag(UdeskConst.SendFlag.RESULT_FAIL); - showFailureView(); - ((UdeskChatActivity) mContext).cancleSendVideoMsg(message); - } - }); - } catch (Exception e) { - e.printStackTrace(); - } catch (OutOfMemoryError error) { - error.printStackTrace(); - } - } - } - - /** - * 展示客服转移消息提示 - */ - public class RedirectViewHolder extends BaseViewHolder { - TextView redirectMsg; - - @Override - void bind(Context context) { - try { - redirectMsg.setText(message.getMsgContent()); - } catch (Exception e) { - e.printStackTrace(); - } - } - - } - - public class UdeskEventViewHolder extends BaseViewHolder { - - TextView events; - - @Override - void bind(Context context) { - try { - tvTime.setVisibility(View.VISIBLE); - if (!message.getCreatedTime().isEmpty()) { - tvTime.setText(String.format("----%s----", UdeskUtil.parseEventTime(message.getCreatedTime()))); - } else { - tvTime.setText(String.format("----%s----", UdeskUtil.parseEventTime(message.getTime()))); - } - - events.setText(message.getMsgContent()); - } catch (Exception e) { - e.printStackTrace(); - } - } - } - - /** - * 展示商品链接消息 - */ - public class CommodityViewHolder extends BaseViewHolder { - View rootView; - SimpleDraweeView thumbnail; - TextView title; - TextView subTitle; - TextView link; - - @Override - void bind(Context context) { - try { - final UdeskCommodityItem item = (UdeskCommodityItem) message; - title.setText(item.getTitle()); - subTitle.setText(item.getSubTitle()); - UdeskUtil.loadNoChangeView(context.getApplicationContext(), thumbnail, Uri.parse(item.getThumbHttpUrl())); - link.setOnClickListener(new OnClickListener() { - @Override - public void onClick(View v) { - ((UdeskChatActivity) mContext).sentLink(item.getCommodityUrl()); - } - }); - } catch (Exception e) { - e.printStackTrace(); - } catch (OutOfMemoryError error) { - error.printStackTrace(); - } - - } - } - - /** - * 处理结构化消息 - */ - public class StructViewHolder extends BaseViewHolder { - View structImgView; - View structTextView; - LinearLayout structBtnLineayLayout; - - SimpleDraweeView structImg; - TextView structTitle; - TextView structDes; - - @Override - void bind(Context context) { - try { - StructModel structModel = JsonUtils.parserStructMsg(message.getMsgContent()); - if (structModel != null) { - //显示图片部分 - showStructImg(context, structModel, structImgView, structImg); - //标题描述部分 - showStructText(structModel, structTextView, structTitle, structDes); - //按钮部分 - showStructBtn(context, structModel, structBtnLineayLayout); - } - } catch (Exception e) { - e.printStackTrace(); - } catch (OutOfMemoryError error) { - error.printStackTrace(); - } - } - } - - public class MapViewHolder extends BaseViewHolder { - TextView locationValue; - SimpleDraweeView cropBitMap; - - @Override - void bind(Context context) { - - try { - final String[] locationMessage = message.getMsgContent().split(";"); - locationValue.setText(locationMessage[locationMessage.length - 1]); - cropBitMap.setImageURI(Uri.fromFile(new File(message.getLocalPath()))); - cropBitMap.setOnClickListener(new OnClickListener() { - @Override - public void onClick(View view) { - - if (UdeskSDKManager.getInstance().getUdeskConfig().locationMessageClickCallBack != null) { - UdeskSDKManager.getInstance().getUdeskConfig().locationMessageClickCallBack.luanchMap(mContext, Double.valueOf(locationMessage[0]), - Double.valueOf(locationMessage[1]), locationMessage[locationMessage.length - 1]); - } - } - }); - - //设置重发按钮的点击事件 - ivStatus.setOnClickListener(new OnClickListener() { - - @Override - public void onClick(View v) { - ((UdeskChatActivity) mContext).retrySendMsg(message); - } - }); - } catch (Exception e) { - e.printStackTrace(); - } - - } - } - - /** - * 展示视频事件 - */ - class VideoTxtViewHolder extends BaseViewHolder { - TextView tvMsg; - - @Override - void bind(Context context) { - try { - tvMsg.setText(message.getMsgContent()); - tvMsg.setOnClickListener(new OnClickListener() { - - @Override - public void onClick(View v) { - ((UdeskChatActivity) mContext).startVideo(); - } - }); - } catch (Exception e) { - e.printStackTrace(); - } - } - } - - - /** - * 排队消息提醒 - */ - public class UdeskInLineViewHolder extends BaseViewHolder { - - TextView queueContext; - TextView leaveingMsg; - - @Override - void bind(Context context) { - try { - final UdeskQueueItem item = (UdeskQueueItem) message; - queueContext.setText(item.getQueueContent()); - if (item.isEnableLeaveMsg()) { - leaveingMsg.setVisibility(View.VISIBLE); - leaveingMsg.setOnClickListener(new OnClickListener() { - @Override - public void onClick(View v) { - ((UdeskChatActivity) mContext).leaveMessage(); - } - }); - } else { - leaveingMsg.setVisibility(View.GONE); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - } - - private void showStructImg(Context context, StructModel structModel, View structImgView, SimpleDraweeView structImg) { - try { - final String imgUrl = structModel.getImg_url(); - if (!TextUtils.isEmpty(imgUrl)) { - structImgView.setVisibility(View.VISIBLE); - UdeskUtil.loadImageView(context, structImg, Uri.parse(imgUrl)); - structImgView.setOnClickListener(new OnClickListener() { - - @Override - public void onClick(View v) { - previewPhoto(mContext, Uri.parse(imgUrl)); - } - }); - } else { - structImgView.setVisibility(View.GONE); - } - } catch (Exception e) { - e.printStackTrace(); - } catch (OutOfMemoryError error) { - error.printStackTrace(); - } - } - - private void showStructText(StructModel structModel, View structTextView, TextView structTitle, TextView structDes) { - try { - if (!TextUtils.isEmpty(structModel.getTitle()) || !TextUtils.isEmpty(structModel.getDescription())) { - structTextView.setVisibility(View.VISIBLE); - if (!TextUtils.isEmpty(structModel.getTitle())) { - structTitle.setVisibility(View.VISIBLE); - structTitle.setText(structModel.getTitle()); - } else { - structTitle.setVisibility(View.GONE); - } - if (!TextUtils.isEmpty(structModel.getDescription())) { - structDes.setVisibility(View.VISIBLE); - structDes.setText(structModel.getDescription()); - } else { - structDes.setVisibility(View.GONE); - } - } else { - structTextView.setVisibility(View.GONE); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void showStructBtn(Context context, StructModel structModel, LinearLayout structBtnLineayLayout) { - try { - if (structModel.getButtons() != null && structModel.getButtons().size() > 0) { - structBtnLineayLayout.removeAllViews(); - structBtnLineayLayout.setVisibility(View.VISIBLE); - List buttonsBeens = structModel.getButtons(); - for (int i = 0; i < buttonsBeens.size(); i++) { - StructModel.ButtonsBean buttonsBean = buttonsBeens.get(i); - TextView textView = new TextView(context); - textView.setText(buttonsBean.getText()); - textView.setOnClickListener(new MyStructBtnOnClick(buttonsBean)); - textView.setTextColor(context.getResources().getColor(R.color.udesk_custom_dialog_sure_btn_color)); - textView.setGravity(Gravity.CENTER); - textView.setPadding(5, 5, 5, 5); - textView.setTextSize(18); - LinearLayout.LayoutParams textviewParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, - ViewGroup.LayoutParams.WRAP_CONTENT); - - View line = new View(context); - line.setBackgroundColor(context.getResources().getColor(R.color.udesk_struct_bg_line_color)); - LinearLayout.LayoutParams lineParas = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, - 1); - structBtnLineayLayout.addView(textView, textviewParams); - structBtnLineayLayout.addView(line, lineParas); - } - - } else { - structBtnLineayLayout.setVisibility(View.GONE); - } - } catch (Resources.NotFoundException e) { - e.printStackTrace(); - } - } - - private class MyStructBtnOnClick implements OnClickListener { - final StructModel.ButtonsBean mStructBtn; - - MyStructBtnOnClick(StructModel.ButtonsBean structBtn) { - this.mStructBtn = structBtn; - } - - @Override - public void onClick(View view) { - try { - switch (mStructBtn.getType()) { - case UdeskConst.StructBtnTypeString.link: - Intent intent = new Intent(mContext, UdeskWebViewUrlAcivity.class); - intent.putExtra(UdeskConst.WELCOME_URL, mStructBtn.getValue()); - mContext.startActivity(intent); - break; - case UdeskConst.StructBtnTypeString.phone: - Intent dialIntent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:" + mStructBtn.getValue())); - mContext.startActivity(dialIntent); - break; - case UdeskConst.StructBtnTypeString.sdkCallBack: - if (UdeskSDKManager.getInstance().getUdeskConfig().structMessageCallBack != null) { - UdeskSDKManager.getInstance().getUdeskConfig().structMessageCallBack.structMsgCallBack(mContext, mStructBtn.getValue()); - } - break; - } - } catch (Exception e) { - e.printStackTrace(); - } - - } - } - - private void initItemNormalView(View convertView, BaseViewHolder holder) { - try { - holder.ivHeader = (SimpleDraweeView) convertView.findViewById(R.id.udesk_iv_head); - holder.tvTime = (TextView) convertView.findViewById(R.id.udesk_tv_time); - holder.ivStatus = (ImageView) convertView.findViewById(R.id.udesk_iv_status); - holder.pbWait = (ProgressBar) convertView.findViewById(R.id.udesk_im_wait); - holder.agentnickName = (TextView) convertView.findViewById(R.id.udesk_nick_name); - UdekConfigUtil.setUITextColor(UdeskSDKManager.getInstance().getUdeskConfig().udeskIMTimeTextColorResId, holder.tvTime); - UdekConfigUtil.setUITextColor(UdeskSDKManager.getInstance().getUdeskConfig().udeskIMAgentNickNameColorResId, holder.agentnickName); - } catch (Exception e) { - e.printStackTrace(); - } - } - - /** - * 计算是否要显示当前位置消息的发送或接受时间 - */ - private void tryShowTime(int position, BaseViewHolder holder, - MessageInfo info) { - try { - if (info instanceof UdeskCommodityItem) { - holder.tvTime.setVisibility(View.VISIBLE); - holder.tvTime.setText(UdeskUtil.formatLongTypeTimeToString(mContext, System.currentTimeMillis())); - } else if (info instanceof UdeskQueueItem) { - holder.tvTime.setVisibility(View.VISIBLE); - holder.tvTime.setText(UdeskUtil.formatLongTypeTimeToString(mContext, System.currentTimeMillis())); - } else if (info.getMsgtype().equals(UdeskConst.ChatMsgTypeString.TYPE_EVENT)) { - holder.tvTime.setVisibility(View.GONE); - } else if (needShowTime(position)) { - holder.tvTime.setVisibility(View.VISIBLE); - holder.tvTime.setText(UdeskUtil.formatLongTypeTimeToString(mContext, info.getTime())); - } else { - holder.tvTime.setVisibility(View.GONE); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - private boolean needShowTime(int position) { - try { - if (position == 0) { - return true; - } else if (position > 0) { - MessageInfo preItem = getItem(position - 1); - if (preItem != null) { - try { - MessageInfo item = getItem(position); - long currTime = item.getTime(); - long preTime = preItem.getTime(); - return currTime - preTime > SPACE_TIME - || preTime - currTime > SPACE_TIME; - } catch (Exception e) { - e.printStackTrace(); - return false; - } - } - } - } catch (Exception e) { - e.printStackTrace(); - } - return false; - } - - /** - * 根据消息ID 修改对应消息的状态 - */ - boolean changeImState(View convertView, String msgId, int state) { - try { - Object tag = convertView.getTag(); - if (tag != null && tag instanceof BaseViewHolder) { - BaseViewHolder cache = (BaseViewHolder) tag; - if (cache.message != null && msgId.equals(cache.message.getMsgId())) { - cache.changeUiState(state); - cache.message.setSendFlag(state); - return true; - } - } - } catch (Exception e) { - e.printStackTrace(); - } - - return false; - } - - boolean changeVideoThumbnail(View convertView, String msgId) { - try { - Object tag = convertView.getTag(); - if (tag != null && tag instanceof SmallVideoViewHolder) { - SmallVideoViewHolder cache = (SmallVideoViewHolder) tag; - if (cache.message != null && msgId.equals(cache.message.getMsgId())) { - if (UdeskUtils.fileIsExitByUrl(mContext, UdeskConst.FileImg, cache.message.getMsgContent())) { - String loaclpath = UdeskUtils.getPathByUrl(mContext, UdeskConst.FileImg, cache.message.getMsgContent()); - UdeskUtil.loadViewBySize(mContext, cache.imgView, Uri.fromFile(new File(loaclpath)), UdeskUtil.dip2px(mContext, 130), UdeskUtil.dip2px(mContext, 200)); - } - return true; - } - } - } catch (Exception e) { - e.printStackTrace(); - } - - return false; - } - - /** - * 根据消息ID 修改对应消息的进度 - */ - boolean changeFileState(View convertView, String msgId, int precent, long fileSize, boolean isSuccess) { - try { - Object tag = convertView.getTag(); - if (tag != null && tag instanceof FileViewHolder) { - FileViewHolder cache = (FileViewHolder) tag; - if (cache.message != null && msgId.contains(cache.message.getMsgId())) { - - cache.mProgress.setProgress(precent); - if (precent == 100) { - if (cache.message.getDirection() == UdeskConst.ChatMsgDirection.Send) { - cache.operater.setText(mContext.getString(R.string.udesk_has_send)); - } else { - cache.operater.setText(mContext.getString(R.string.udesk_has_downed)); - } - - } else { - if (0 < precent && precent < 100) - cache.operater.setText(String.format("%d%%", precent)); - } - if (fileSize > 0) { - cache.fielSize.setText(UdeskUtils.formetFileSize(fileSize)); - } - if (!isSuccess) { - Toast.makeText(mContext.getApplicationContext(), mContext.getString(R.string.udesk_download_failure), Toast.LENGTH_SHORT).show(); - cache.operater.setText(mContext.getString(R.string.udesk_has_download)); - } - - return true; - } - } else if (tag != null && tag instanceof SmallVideoViewHolder) { - SmallVideoViewHolder smallVideo = (SmallVideoViewHolder) tag; - if (smallVideo.message != null && msgId.contains(smallVideo.message.getMsgId())) { - smallVideo.circleProgressBar.setPercent(precent); - if (precent == 100) { - smallVideo.cancleImg.setVisibility(View.GONE); - smallVideo.circleProgressBar.setVisibility(View.GONE); - smallVideo.video_tip.setVisibility(View.VISIBLE); - smallVideo.pbWait.setVisibility(View.VISIBLE); - } - } - } else if (tag != null && tag instanceof ImgViewHolder) { - ImgViewHolder imgViewHolder = (ImgViewHolder) tag; - if (imgViewHolder.message != null && msgId.contains(imgViewHolder.message.getMsgId())) { - imgViewHolder.percent.setVisibility(View.VISIBLE); - imgViewHolder.percent.setText(precent + "%"); - if (precent == 100) { - imgViewHolder.percent.setVisibility(View.GONE); - } - } - } - } catch (Exception e) { - e.printStackTrace(); - } - - return false; - } - - /** - * 根据消息ID 修改对应消息的状态 - */ - void updateStatus(String msgId, int state) { - try { - for (MessageInfo msg : list) { - if (msg.getMsgId() != null && msg.getMsgId().equals(msgId)) { - msg.setSendFlag(state); - } - } - notifyDataSetChanged(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - /** - * 根据消息ID 修改对应文件上传的进度 - */ - void updateProgress(String msgId, int present) { - try { - boolean isNeedRefresh = false; - for (MessageInfo msg : list) { - if (msg != null && msg.getMsgtype() != null && msg.getMsgtype().equals(UdeskConst.ChatMsgTypeString.TYPE_VIDEO) && msg.getMsgId() != null && msg.getMsgId().equals(msgId)) { - msg.setPrecent(present); - isNeedRefresh = true; - } - } - if (isNeedRefresh) { - notifyDataSetChanged(); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - //预览大图 - private void previewPhoto(Context context, Uri uri) { - try { - if (uri == null) { - return; - } - Intent intent = new Intent(context, - UdeskZoomImageActivty.class); - Bundle data = new Bundle(); - data.putParcelable("image_path", uri); - intent.putExtras(data); - context.startActivity(intent); - } catch (Exception e) { - e.printStackTrace(); - } - - } - - -} diff --git a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/activity/NavigationFragment.java b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/activity/NavigationFragment.java index 057beb38..38533d77 100644 --- a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/activity/NavigationFragment.java +++ b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/activity/NavigationFragment.java @@ -14,6 +14,7 @@ import cn.udesk.UdeskSDKManager; import cn.udesk.adapter.NavigationAdapter; import cn.udesk.model.NavigationMode; +import udesk.core.UdeskConst; /** * Created by user on 2018/3/28. @@ -25,6 +26,7 @@ public class NavigationFragment extends Fragment { private NavigationAdapter navigationAdapter; UdeskChatActivity activity; + private String currentView= UdeskConst.CurrentFragment.agent; @Nullable @Override @@ -41,14 +43,13 @@ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, mRecyclerView.setLayoutManager(layoutManager); mRecyclerView.setItemAnimator(new DefaultItemAnimator()); - navigationAdapter = new NavigationAdapter(getContext()); + navigationAdapter = new NavigationAdapter(getContext(),currentView); mRecyclerView.setAdapter(navigationAdapter); navigationAdapter.setOnItemClickListener(new NavigationAdapter.OnRecyclerViewItemClickListener() { @Override public void onItemClick(View view, NavigationMode data) { - if (UdeskSDKManager.getInstance().getUdeskConfig().navigationItemClickCallBack != null && activity != null - && activity.getmPresenter() != null) { - UdeskSDKManager.getInstance().getUdeskConfig().navigationItemClickCallBack.callBack(activity.getApplicationContext(), activity.getmPresenter(), data); + if (UdeskSDKManager.getInstance().getUdeskConfig().navigationItemClickCallBack != null && activity != null) { + UdeskSDKManager.getInstance().getUdeskConfig().navigationItemClickCallBack.callBack(activity.getApplicationContext(), activity.udeskViewMode, data,currentView); } } }); @@ -57,4 +58,7 @@ public void onItemClick(View view, NavigationMode data) { } return rootView; } + public void setCurrentView(String currentView){ + this.currentView=currentView; + } } diff --git a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/activity/UdeskBaseWebViewActivity.java b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/activity/UdeskBaseWebViewActivity.java index 758c8a98..86f7f77c 100644 --- a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/activity/UdeskBaseWebViewActivity.java +++ b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/activity/UdeskBaseWebViewActivity.java @@ -121,7 +121,7 @@ public void onReceivedError(WebView view, int errorCode, String description, Str @Override public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) { -// handler.proceed(); + handler.proceed(); } @Override diff --git a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/activity/UdeskChatActivity.java b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/activity/UdeskChatActivity.java index 2f820783..a5b2d206 100644 --- a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/activity/UdeskChatActivity.java +++ b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/activity/UdeskChatActivity.java @@ -3,6 +3,8 @@ import android.Manifest; import android.annotation.SuppressLint; import android.app.Activity; +import android.arch.lifecycle.Observer; +import android.arch.lifecycle.ViewModelProviders; import android.content.BroadcastReceiver; import android.content.ClipData; import android.content.Context; @@ -17,14 +19,16 @@ import android.os.Bundle; import android.os.Handler; import android.os.IBinder; -import android.os.Message; import android.provider.MediaStore; import android.support.annotation.NonNull; +import android.support.annotation.Nullable; import android.support.v4.app.ActivityCompat; +import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentTransaction; -import android.text.Editable; +import android.support.v7.widget.LinearLayoutManager; +import android.support.v7.widget.RecyclerView; import android.text.TextUtils; -import android.text.TextWatcher; +import android.util.Log; import android.view.Gravity; import android.view.MotionEvent; import android.view.View; @@ -32,16 +36,11 @@ import android.view.WindowManager; import android.view.inputmethod.InputMethodManager; import android.widget.AbsListView; -import android.widget.AdapterView; import android.widget.EditText; -import android.widget.FrameLayout; -import android.widget.GridView; -import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.ListView; import android.widget.PopupWindow; import android.widget.TextView; -import android.widget.Toast; import com.facebook.drawee.backends.pipeline.Fresco; import com.facebook.drawee.view.SimpleDraweeView; @@ -49,42 +48,56 @@ import org.json.JSONObject; import java.io.File; -import java.lang.ref.WeakReference; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.UUID; +import java.util.concurrent.ConcurrentHashMap; -import cn.udesk.model.UdeskQueueItem; -import cn.udesk.presenter.MessageCache; -import udesk.core.JsonObjectUtils; -import udesk.core.LocalManageUtil; +import cn.udesk.JsonUtils; import cn.udesk.PreferenceHelper; import cn.udesk.R; import cn.udesk.UdeskSDKManager; import cn.udesk.UdeskUtil; -import cn.udesk.activity.MessageAdatper.AudioViewHolder; -import cn.udesk.adapter.UdeskFunctionAdapter; +import cn.udesk.aac.MergeMode; +import cn.udesk.aac.MergeModeManager; +import cn.udesk.aac.UdeskViewMode; +import cn.udesk.aac.livedata.QuestionMerMode; +import cn.udesk.adapter.MessageAdatper; +import cn.udesk.adapter.TipAdapter; +import cn.udesk.callback.IUdeskHasSurvyCallBack; import cn.udesk.camera.UdeskCameraActivity; import cn.udesk.config.UdekConfigUtil; import cn.udesk.config.UdeskBaseInfo; import cn.udesk.config.UdeskConfig; import cn.udesk.db.UdeskDBManager; -import cn.udesk.emotion.EmotionKeyboard; -import cn.udesk.emotion.EmotionLayout; import cn.udesk.emotion.IEmotionSelectedListener; import cn.udesk.emotion.LQREmotionKit; -import cn.udesk.messagemanager.UdeskMessageManager; -import cn.udesk.model.FunctionMode; -import cn.udesk.model.SDKIMSetting; +import cn.udesk.fragment.UdeskAgentFragment; +import cn.udesk.fragment.UdeskRobotFragment; +import cn.udesk.fragment.UdeskbaseFragment; +import cn.udesk.itemview.BaseViewHolder; +import cn.udesk.messagemanager.UdeskXmppManager; +import cn.udesk.model.AgentGroupNode; +import cn.udesk.model.ImSetting; +import cn.udesk.model.Robot; +import cn.udesk.widget.RecycleViewDivider; +import udesk.core.model.AllMessageMode; import cn.udesk.model.SurveyOptionsModel; import cn.udesk.model.UdeskCommodityItem; +import cn.udesk.model.UdeskQueueItem; +import cn.udesk.model.Customer; +import cn.udesk.model.InitCustomerBean; +import udesk.core.model.Content; +import udesk.core.model.DataBean; +import udesk.core.model.LogBean; +import udesk.core.model.ProductListBean; +import udesk.core.model.RobotInit; +import udesk.core.model.RobotTipBean; import cn.udesk.permission.RequestCode; import cn.udesk.permission.XPermissionUtils; import cn.udesk.photoselect.PhotoSelectorActivity; import cn.udesk.photoselect.entity.LocalMedia; -import cn.udesk.presenter.ChatActivityPresenter; -import cn.udesk.presenter.IChatActivityView; -import cn.udesk.voice.AudioRecordButton; import cn.udesk.voice.RecordFilePlay; import cn.udesk.voice.RecordPlay; import cn.udesk.voice.RecordPlayCallback; @@ -96,50 +109,38 @@ import cn.udesk.widget.UdeskMultiMenuHorizontalWindow.OnPopMultiMenuClick; import cn.udesk.widget.UdeskSurvyPopwindow; import cn.udesk.widget.UdeskTitleBar; +import udesk.core.JsonObjectUtils; import udesk.core.UdeskConst; -import udesk.core.UdeskHttpFacade; import udesk.core.event.InvokeEventContainer; import udesk.core.model.AgentInfo; import udesk.core.model.MessageInfo; import udesk.core.model.Product; +import udesk.core.utils.UdeskIdBuild; import udesk.core.utils.UdeskUtils; -import udesk.core.xmpp.XmppInfo; - - -public class UdeskChatActivity extends UdeskBaseActivity implements IChatActivityView, IEmotionSelectedListener, - OnClickListener { - LinearLayout mContentLinearLayout;//消息内容区域 - ImageView mAudioImg; //语言和内容 - private TextView sendBtn; - private AudioRecordButton mBtnAudio; - ImageView mEmojiImg; - ImageView mMoreImg; - FrameLayout mBotomFramlayout; - EmotionLayout mEmotionlayout; - LinearLayout mMoreLayout; - private EmotionKeyboard mEmotionKeyboard; - - private EditText mInputEditView; - private UDPullGetMoreListView mListView; + + +public class UdeskChatActivity extends UdeskBaseActivity implements IEmotionSelectedListener { + public LinearLayout mContentLinearLayout;//消息内容区域 + public UDPullGetMoreListView mListView; private MessageAdatper mChatAdapter; private UdeskConfirmPopWindow popWindow = null; private UdeskExpandableLayout expandableLayout = null; //动画显示上线离线提醒的控件 private UdeskTitleBar mTitlebar; - private RecordFilePlay mRecordFilePlay; + public RecordFilePlay mRecordFilePlay; private RecordPlayCallback mPlayCallback; - private AgentInfo mAgentInfo; // 保存客服信息的实例 + public AgentInfo mAgentInfo; // 保存客服信息的实例 private MessageInfo redirectMsg; private Uri photoUri; private File cameraFile; private String groupId = ""; private String agentId = ""; - private String isbolcked = ""; + private String menuId = ""; + public String isbolcked = ""; private String bolckedNotice = ""; - // 标记当前是否有客服在线,客服不在线状态是不能发送消息的, - private boolean currentStatusIsOnline = false; + public boolean currentStatusIsOnline = false; private boolean isNeedStartExpandabLyout = false; private boolean isNeedRelogin = false; private boolean hasSendCommodity = false; @@ -151,7 +152,8 @@ public class UdeskChatActivity extends UdeskBaseActivity implements IChatActivit public static final int InitViewMode = 1; //初始化 public static final int PullRefreshModel = 2; //下拉刷新 public static final int PullEventModel = 3; //拉去工单回复 - private long preMsgSendTime = 0; //记录发送预支消息间隔时间 + private int currentMode = InitViewMode; + private long QUEUE_RETEY_TIME = 20 * 1000; // 客服繁忙时 轮询的间隔时间 private final int CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE = 101; @@ -160,23 +162,21 @@ public class UdeskChatActivity extends UdeskBaseActivity implements IChatActivit private final int SELECT_LOCATION_OPTION_REQUEST_CODE = 105; private final int SELECT_UDESK_IMAGE_ACTIVITY_REQUEST_CODE = 106; private final int CAPTURE_IMAGE_SMALLVIDEO_ACTIVITY_REQUEST_CODE = 107; + private final int IM_GROUP_REQUEST_CODE = 108; - private MyHandler mHandler; - private ChatActivityPresenter mPresenter; + private Handler mHandler; private BroadcastReceiver mConnectivityChangedReceiver = null; private boolean isSurvyOperate = false;//如果是收到客服的满意度调查,则在onresume 处不在请求分配客服 - private boolean isInitComplete = false; //标识进入请求分配客服的流程是否结束 - private boolean isOverConversation = false;//标识会话是否客服已经关闭会话 +// public boolean isInitComplete = false; //标识进入请求分配客服的流程是否结束 + private boolean isFirstFinish = true;//第一返回,如果设置了弹出满意度评价则弹出,无论评价与否,第二次 - private boolean isLeavingmsg = false; + private boolean isPermmitSurvy = true; private boolean isNeedOpenLocalCamera = false; - // private boolean isfirstWaitTips = true; private boolean isDestroyed = false; //表示是否执行ondestory - private boolean isPresessionStatus = false;//标记是否是无消息对话状态 - String pre_session_id = ""; //无消息对话状态下id + public String pre_session_id = ""; //无消息对话状态下id //咨询对象的展示界面 private View commodityView; @@ -185,384 +185,65 @@ public class UdeskChatActivity extends UdeskBaseActivity implements IChatActivit public TextView commoditySubTitle; public TextView commodityLink; - - GridView funGridView; - List functionItems = new ArrayList(); - UdeskFunctionAdapter udeskFunctionAdapter; - - private LinearLayout navigationRootView, addNavigationFragmentView, navigation_survy; - //排队中的消息提醒 private UdeskQueueItem queueItem; - private boolean isInTheQueue = false; + // private boolean isInTheQueue = false; //最多允许发送20条消息 - boolean isMoreThan20 = false; - - public static class MessageWhat { - public static final int loadHistoryDBMsg = 1; - public static final int NoAgent = 2; - public static final int HasAgent = 3; - public static final int WaitAgent = 4; - public static final int refreshAdapter = 5; - public static final int changeImState = 6; - public static final int onNewMessage = 7; - public static final int pre_session_status = 8; - public static final int RECORD_ERROR = 10; - public static final int status_notify = 14; - public static final int redirectSuccess = 15; - public static final int surveyNotify = 16; - public static final int IM_STATUS = 17; - public static final int IM_BOLACKED = 18; - public static final int Has_Survey = 19; - public static final int Survey_error = 20; - public static final int Add_UdeskEvent = 21; - public static final int ChangeFielProgress = 22; - public static final int ChangeVideoThumbnail = 23; - public static final int Survey_Success = 24; - public static final int RECREATE_CUSTOMER_INFO = 25; - } + public boolean isMoreThan20 = false; + private UdeskbaseFragment fragment; + private String leavMsgId = ""; + + UdeskViewMode udeskViewMode; + String customerId = ""; + String moreThanStirng; + //输入联想功能 + private RecyclerView mRvAssociate; + private LinearLayout mLlAssociate; + private int robotSengMsgCount = 0; + + + InitCustomerBean initCustomer; + public ImSetting imSetting; + Robot robot; + public String curentStatus = UdeskConst.Status.init; + private TipAdapter tipAdapter; + //机器人初始化返回数据 + private RobotInit robotInit; + private String moreMarking = "";//拉取服务器消息的标识 + private boolean isShowNet = false; + private Map usefulMap = new ConcurrentHashMap<>();//有用 + private Map transferMap = new ConcurrentHashMap<>();//转人工 + // private boolean isFirstLoad=true; + private List randomList = new ArrayList<>(); + private UdeskSurvyPopwindow udeskSurvyPopwindow; class ConnectivtyChangedReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { try { if (!ConnectivityManager.CONNECTIVITY_ACTION.equals(intent - .getAction())) + .getAction())) { return; - boolean bNetWorkAvailabl = UdeskUtils.isNetworkConnected(context); - if (bNetWorkAvailabl) { + } + boolean netWorkAvailable = UdeskUtils.isNetworkConnected(context); + if (netWorkAvailable) { if (!currentStatusIsOnline && isNeedRelogin) { - if (isbolcked.equals("true")) { + if (isbolcked.equals("true") || !isWorkTime()) { return; } - if (UdeskSDKManager.getInstance().getImSetting() != null && !UdeskSDKManager.getInstance().getImSetting().getIs_worktime()) { - return; + if (isShowNet) { + expandableLayout.stopAnimation(); } - mPresenter.createIMCustomerInfo(); + udeskViewMode.getApiLiveData().initCustomer(getApplicationContext()); } } else { isNeedRelogin = true; - UdeskUtils.showToast( - context, - context.getResources().getString( - R.string.udesk_has_wrong_net)); + UdeskUtils.showToast(getApplicationContext(), context.getResources().getString(R.string.udesk_has_wrong_net)); setTitlebar(context.getResources().getString( R.string.udesk_agent_connecting_error_net_uavailabl), "off"); currentStatusIsOnline = false; - } - } catch (Exception e) { - e.printStackTrace(); - } - } - } - - private static class MyHandler extends Handler { - WeakReference mWeakActivity; - - public MyHandler(UdeskChatActivity activity) { - mWeakActivity = new WeakReference<>(activity); - } - - @Override - public void handleMessage(Message msg) { - try { - final UdeskChatActivity activity = mWeakActivity.get(); - if (activity == null) { - return; - } - switch (msg.what) { - case MessageWhat.loadHistoryDBMsg: - if (activity.mChatAdapter != null && activity.mListView != null) { - List msgs = (ArrayList) msg.obj; - if (UdeskSDKManager.getInstance().getUdeskConfig().commodity != null) { - activity.showCommodity(UdeskSDKManager.getInstance().getUdeskConfig().commodity); - } - int selectIndex = msgs.size(); - if (msg.arg1 == UdeskChatActivity.PullEventModel) { - activity.mChatAdapter.listAddEventItems(msgs); - } else if (msg.arg1 == UdeskChatActivity.PullRefreshModel) { - activity.mChatAdapter.listAddItems(msgs, true); - } else { - activity.mChatAdapter.listAddItems(msgs, false); - } - activity.mListView.onRefreshComplete(); - if (msg.arg1 == UdeskChatActivity.InitViewMode || msg.arg1 == UdeskChatActivity.PullEventModel) { - activity.mListView.setSelection(activity.mChatAdapter.getCount()); - } else { - activity.mListView.setSelection(selectIndex); - } - } - break; - case MessageWhat.NoAgent: - activity.isInTheQueue = false; - activity.dismissFormWindow(); - if (activity.mPresenter != null) { - activity.mPresenter.sendPrefilterMsg(false); - } - if (activity.isleaveMessageTypeMsg()) { - if (activity.mPresenter != null) { - activity.mPresenter.addLeavMsgWeclome(UdeskSDKManager.getInstance().getImSetting().getLeave_message_guide()); - } - activity.setUdeskImContainerVis(View.GONE); - activity.setTitlebar(activity.getString(R.string.udesk_ok), "off"); - } else { - activity.mAgentInfo = (AgentInfo) msg.obj; - activity.setTitlebar(activity.getString(R.string.udesk_label_customer_offline), "off"); - activity.delayShowtips(this); - } - if (activity.queueItem != null && activity.mChatAdapter != null) { - activity.mChatAdapter.removeQueueMessage(activity.queueItem); - activity.queueItem = null; - activity.mListView.smoothScrollToPosition(activity.mChatAdapter.getCount()); - } - break; - case MessageWhat.HasAgent: - activity.isInTheQueue = false; - activity.dismissFormWindow(); - activity.setUdeskImContainerVis(View.VISIBLE); - activity.mAgentInfo = (AgentInfo) msg.obj; - activity.currentStatusIsOnline = true; - activity.showOnlieStatus(activity.mAgentInfo); - activity.setNavigationViewVis(); - activity.initfunctionItems(); - if (activity.queueItem != null && activity.mChatAdapter != null) { - activity.mChatAdapter.removeQueueMessage(activity.queueItem); - activity.queueItem = null; - activity.mListView.smoothScrollToPosition(activity.mChatAdapter.getCount()); - } - if (activity.mPresenter != null) { - activity.mPresenter.pullMessages(0, activity.mAgentInfo.getIm_sub_session_id()); - activity.mPresenter.sendPrefilterMsg(true); - activity.mPresenter.selfretrySendMsg(); - } - if (!activity.hasSendCommodity) { - activity.hasSendCommodity = true; - activity.sendCommodityMsg(UdeskSDKManager.getInstance().getUdeskConfig().commodity); - activity.sendProduct(UdeskSDKManager.getInstance().getUdeskConfig().mProduct); - } - if (!activity.hasSendFirstMessage) { - activity.hasSendFirstMessage = true; - activity.sendDefualtMessage(); - } - activity.sendVideoMessage(); - break; - case MessageWhat.WaitAgent: - activity.isInTheQueue = true; - activity.isPresessionStatus = false; - activity.isOverConversation = false; - activity.mAgentInfo = (AgentInfo) msg.obj; - activity.setTitlebar(activity.getResources().getString(R.string.udesk_in_the_line), "queue"); - activity.setUdeskImContainerVis(View.VISIBLE); - this.postDelayed(activity.myRunnable, activity.QUEUE_RETEY_TIME); - if (activity.mPresenter != null) { - activity.mPresenter.sendPrefilterMsg(true); - } - if (!activity.hasSendCommodity) { - activity.hasSendCommodity = true; - activity.sendCommodityMsg(UdeskSDKManager.getInstance().getUdeskConfig().commodity); - activity.sendProduct(UdeskSDKManager.getInstance().getUdeskConfig().mProduct); - } - if (!activity.hasSendFirstMessage) { - activity.hasSendFirstMessage = true; - activity.sendDefualtMessage(); - } - if (activity.queueItem == null) { - activity.queueItem = new UdeskQueueItem(activity.isOpenLeaveMsg(), activity.mAgentInfo.getMessage()); - if (activity.mChatAdapter != null) { - activity.mChatAdapter.addItem(activity.queueItem); - activity.mListView.smoothScrollToPosition(activity.mChatAdapter.getCount()); - } - } else { - activity.queueItem.setQueueContent(activity.mAgentInfo.getMessage()); - activity.mChatAdapter.notifyDataSetChanged(); - } - break; - case MessageWhat.refreshAdapter: - if (activity.mChatAdapter != null) { - MessageInfo message = (MessageInfo) msg.obj; - activity.mChatAdapter.addItem(message); - activity.mListView.smoothScrollToPosition(activity.mChatAdapter.getCount()); - } - break; - case MessageWhat.changeImState: - String msgId = (String) msg.obj; - int flag = msg.arg1; - activity.changeImState(msgId, flag); - break; - case MessageWhat.ChangeVideoThumbnail: - String videoMsgId = (String) msg.obj; - activity.changeVideoThumbnail(videoMsgId); - break; - case MessageWhat.ChangeFielProgress: - String fileMsgId = (String) msg.obj; - int percent = msg.arg1; - long fileSize = 0; - boolean isSuccess = true; - if (msg.getData() != null) { - fileSize = msg.getData().getLong(UdeskConst.FileSize); - isSuccess = msg.getData().getBoolean(UdeskConst.FileDownIsSuccess, true); - } - activity.changeFileProgress(fileMsgId, percent, fileSize, isSuccess); - break; - case MessageWhat.onNewMessage: - MessageInfo msgInfo = (MessageInfo) msg.obj; - if (msgInfo == null){ - return; - } - if (msgInfo.getMsgtype().equals(UdeskConst.ChatMsgTypeString.TYPE_REDIRECT)) { - try { - if (activity.mPresenter != null) { - activity.isInitComplete = false; - activity.redirectMsg = msgInfo; - JSONObject json = new JSONObject(msgInfo.getMsgContent()); - String agent_id = json.optString("agent_id"); - String group_id = json.optString("group_id"); - activity.mPresenter.getRedirectAgentInfo(agent_id, group_id); - } - - } catch (Exception e) { - e.printStackTrace(); - } - } else { - if (activity.mChatAdapter != null) { - if (activity.mAgentInfo != null && activity.mAgentInfo.getAgentCode() == UdeskConst.AgentReponseCode.HasAgent) { - msgInfo.setUser_avatar(activity.mAgentInfo.getHeadUrl()); - msgInfo.setReplyUser(activity.mAgentInfo.getAgentNick()); - if (!activity.mAgentInfo.getAgentJid().contains(msgInfo.getmAgentJid())) { - activity.mAgentInfo.setAgentJid(msgInfo.getmAgentJid()); - activity.mPresenter.createIMCustomerInfo(); - } - } else if (!TextUtils.isEmpty(msgInfo.getmAgentJid()) && activity.mAgentInfo != null && activity.mAgentInfo.getAgentCode() == UdeskConst.AgentReponseCode.WaitAgent) { - if (activity.myRunnable != null) { - this.removeCallbacks(activity.myRunnable); - this.post(activity.myRunnable); - } - }else{ - if ( activity.mAgentInfo != null && !TextUtils.isEmpty(msgInfo.getmAgentJid()) && activity.mPresenter != null) { - activity.mPresenter.getAgentInfo(activity.pre_session_id, null); - } - } - activity.mChatAdapter.addItem(msgInfo); - activity.mListView.smoothScrollToPosition(activity.mChatAdapter.getCount()); - } - } - break; - case MessageWhat.pre_session_status: - String title = (String) msg.obj; - activity.isPresessionStatus = true; - activity.mAgentInfo = null; - activity.setTitlebar(title, "on"); - break; - case MessageWhat.RECORD_ERROR: { - activity.recordError(); - } - case MessageWhat.status_notify: - int onlineflag = msg.arg1; - String jid = (String) msg.obj; - if (activity.mAgentInfo == null || - activity.isbolcked.equals("true") || - TextUtils.isEmpty(activity.mAgentInfo.getAgentJid()) - || !jid.contains(activity.mAgentInfo.getAgentJid())) { - return; - } - if (onlineflag == UdeskConst.ONLINEFLAG) { - if (!activity.currentStatusIsOnline && activity.isNeedStartExpandabLyout) { - activity.expandableLayout.startAnimation(true); - activity.currentStatusIsOnline = true; - activity.isNeedStartExpandabLyout = false; - } - activity.showOnlieStatus(activity.mAgentInfo); - activity.setUdeskImContainerVis(View.VISIBLE); - if (activity.popWindow != null) { - activity.popWindow.cancle(); - } - } else if (onlineflag == UdeskConst.OFFLINEFLAG) { - if (activity.mPresenter != null) { - activity.mPresenter.getIMStatus(activity.mAgentInfo); - } - } - break; - case MessageWhat.IM_STATUS: - String imStatus = (String) msg.obj; - if (imStatus.equals("off")) { - activity.isInTheQueue = false; - activity.isInitComplete = true; - if (activity.isleaveMessageTypeMsg()) { - activity.setUdeskImContainerVis(View.GONE); - if (activity.mPresenter != null) { - activity.mPresenter.addLeavMsgWeclome(UdeskSDKManager.getInstance().getImSetting().getLeave_message_guide()); - } - activity.setTitlebar(activity.getString(R.string.udesk_ok), "off"); - } else { - if (activity.mAgentInfo != null) { - activity.setTitlebar(activity.mAgentInfo.getAgentNick(), "off"); - } else { - activity.setTitlebar(activity.getResources().getString( - R.string.udesk_label_customer_offline), "off"); - } - activity.delayShowtips(this); - } - if (activity.currentStatusIsOnline) { - activity.expandableLayout.startAnimation(false); - activity.currentStatusIsOnline = false; - activity.isNeedStartExpandabLyout = true; - } - } - break; - case MessageWhat.IM_BOLACKED: - activity.isbolcked = "true"; - activity.bolckedNotice = (String) msg.obj; - if (TextUtils.isEmpty(activity.bolckedNotice)) { - activity.bolckedNotice = activity - .getString(R.string.add_bolcked_tips); - - } - activity.setTitlebar(activity.bolckedNotice, "off"); - this.postDelayed(new Runnable() { - @Override - public void run() { - activity.toBolckedView(); - } - }, 1500); - - break; - case MessageWhat.Has_Survey: - UdeskUtils.showToast(activity, activity.getResources() - .getString(R.string.udesk_has_survey)); - break; - case MessageWhat.Survey_error: - UdeskUtils.showToast(activity, activity.getResources() - .getString(R.string.udesk_survey_error)); - break; - case MessageWhat.Survey_Success: - UdeskUtils.showToast(activity, activity.getResources() - .getString(R.string.udesk_thanks_survy)); - break; - case MessageWhat.redirectSuccess: - MessageInfo redirectSuccessmsg = (MessageInfo) msg.obj; - if (activity.mChatAdapter != null) { - activity.mChatAdapter.addItem(redirectSuccessmsg); - activity.mListView.smoothScrollToPosition(activity.mChatAdapter.getCount()); - } - activity.currentStatusIsOnline = true; - activity.showOnlieStatus(activity.mAgentInfo); - activity.sendVideoMessage(); - break; - case MessageWhat.surveyNotify: - SurveyOptionsModel surveyOptions = (SurveyOptionsModel) msg.obj; - if (surveyOptions != null) { - activity.toLuanchSurveyView(surveyOptions); - } - break; - case MessageWhat.Add_UdeskEvent: - if (activity.mChatAdapter != null) { - MessageInfo eventMsg = (MessageInfo) msg.obj; - activity.mChatAdapter.addItem(eventMsg); - } - break; - case MessageWhat.RECREATE_CUSTOMER_INFO: - activity.reCreateIMCustomerInfo(); - break; + expandableLayout.startNetAnimation(); + isShowNet = true; } } catch (Exception e) { e.printStackTrace(); @@ -574,29 +255,25 @@ public void run() { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); try { + mHandler = new Handler(); + initUdeskViewMode(); UdeskUtils.resetTime(); - LocalManageUtil.getSetLanguageLocale(); UdeskUtil.setOrientation(this); if (!Fresco.hasBeenInitialized()) { UdeskUtil.frescoInit(this); } setContentView(R.layout.udesk_activity_im); - mHandler = new MyHandler(UdeskChatActivity.this); - mPresenter = new ChatActivityPresenter(this); - - InvokeEventContainer.getInstance().event_IsOver.bind(this, "isOverConversation"); - isOverConversation = false; - initIntent(); - settingTitlebar(); initView(); - //进入会话界面 关闭推送 - if (!TextUtils.isEmpty(UdeskSDKManager.getInstance().getRegisterId(UdeskChatActivity.this))) { - UdeskSDKManager.getInstance().setSdkPushStatus(UdeskSDKManager.getInstance().getDomain(this), - UdeskSDKManager.getInstance().getAppkey(this), - UdeskSDKManager.getInstance().getSdkToken(getApplicationContext()), UdeskConfig.UdeskPushFlag.OFF, - UdeskSDKManager.getInstance().getRegisterId(UdeskChatActivity.this), - UdeskSDKManager.getInstance().getAppId(this)); + InvokeEventContainer.getInstance().event_OnVideoEventReceived.bind(this, "onVideoEvent"); + initGroupIdAndAgentID(); + settingTitlebar(); + initCustomer = UdeskSDKManager.getInstance().getInitCustomerBean(); + if (initCustomer == null || initCustomer.getCode() != 1000) { + udeskViewMode.getApiLiveData().initCustomer(getApplicationContext()); + } else { + doWithInitCustomer(); } + } catch (Exception e) { e.printStackTrace(); } catch (OutOfMemoryError error) { @@ -605,585 +282,994 @@ protected void onCreate(Bundle savedInstanceState) { } - //在指定客服组ID 或者指定客服ID 会传入值 其它的方式进入不会传值 - private void initIntent() { + private void initGroupIdAndAgentID() { try { - Intent intent = getIntent(); - if (intent != null) { - groupId = intent.getStringExtra(UdeskConst.UDESKGROUPID); - agentId = intent.getStringExtra(UdeskConst.UDESKAGENTID); - } - //重导航传入groupid的优先级 高于设置的groupid - if (TextUtils.isEmpty(groupId) && !TextUtils.isEmpty(UdeskSDKManager.getInstance().getUdeskConfig().groupId)) { - groupId = UdeskSDKManager.getInstance().getUdeskConfig().groupId; - } - if (TextUtils.isEmpty(agentId) && !TextUtils.isEmpty(UdeskSDKManager.getInstance().getUdeskConfig().agentId)) { - agentId = UdeskSDKManager.getInstance().getUdeskConfig().agentId; + if (getIntent() != null) { + menuId = getIntent().getStringExtra(UdeskConst.UDESKMENUID); + if (!TextUtils.isEmpty(menuId)) { + PreferenceHelper.write(this, UdeskConst.SharePreParams.Udesk_Sharepre_Name, + UdeskConst.SharePreParams.Udesk_Menu_Id, menuId); + } } + groupId = UdeskSDKManager.getInstance().getUdeskConfig().groupId; + agentId = UdeskSDKManager.getInstance().getUdeskConfig().agentId; if (!TextUtils.isEmpty(groupId)) { PreferenceHelper.write(this, UdeskConst.SharePreParams.Udesk_Sharepre_Name, UdeskConst.SharePreParams.Udesk_Group_Id, groupId); } - PreferenceHelper.write(this, UdeskConst.SharePreParams.Udesk_Sharepre_Name, - UdeskConst.SharePreParams.Udesk_Agent_Id, agentId); - } catch (Exception e) { - e.printStackTrace(); - } - } - - /** - * titlebar 的设置 - */ - private void settingTitlebar() { - try { - mTitlebar = (UdeskTitleBar) findViewById(R.id.udesktitlebar); - if (mTitlebar != null) { - UdekConfigUtil.setUITextColor(UdeskSDKManager.getInstance().getUdeskConfig().udeskTitlebarTextLeftRightResId, mTitlebar.getLeftTextView(), mTitlebar.getRightTextView()); - if (mTitlebar.getRootView() != null) { - UdekConfigUtil.setUIbgDrawable(UdeskSDKManager.getInstance().getUdeskConfig().udeskTitlebarBgResId, mTitlebar.getRootView()); - } - if (UdeskConfig.DEFAULT != UdeskSDKManager.getInstance().getUdeskConfig().udeskbackArrowIconResId) { - mTitlebar.getUdeskBackImg().setImageResource(UdeskSDKManager.getInstance().getUdeskConfig().udeskbackArrowIconResId); - } - mTitlebar - .setLeftTextSequence(getString(R.string.udesk_agent_connecting)); - mTitlebar.setLeftLinearVis(View.VISIBLE); - mTitlebar.setLeftViewClick(new OnClickListener() { - - @Override - public void onClick(View v) { - finishAcitivty(); - } - }); + if (!TextUtils.isEmpty(agentId)) { + PreferenceHelper.write(this, UdeskConst.SharePreParams.Udesk_Sharepre_Name, + UdeskConst.SharePreParams.Udesk_Agent_Id, agentId); } + udeskViewMode.getApiLiveData().setSpecifyAgentID(getAgentId()); + udeskViewMode.getApiLiveData().setSpecifyGroupId(getGroupId()); + udeskViewMode.getApiLiveData().setMenu_id(getMenuId()); } catch (Exception e) { e.printStackTrace(); } } - private void showCommodity(final UdeskCommodityItem item) { - try { - commodityView.setVisibility(View.VISIBLE); - commodityTitle.setText(item.getTitle()); - commoditySubTitle.setText(item.getSubTitle()); - UdeskUtil.loadNoChangeView(getApplicationContext(), commodityThumbnail, Uri.parse(item.getThumbHttpUrl())); - commodityLink.setOnClickListener(new OnClickListener() { - @Override - public void onClick(View v) { - sentLink(item.getCommodityUrl()); - } - }); - } catch (Exception e) { - e.printStackTrace(); - } - } + private String on = "on"; + private String off = "off"; + private String queue = "queue"; - private void initView() { + private void doWithInitCustomer() { try { - commodityView = findViewById(R.id.commodity_rl); - commodityView.setVisibility(View.GONE); - commodityThumbnail = (SimpleDraweeView) findViewById(R.id.udesk_im_commondity_thumbnail); - commodityTitle = (TextView) findViewById(R.id.udesk_im_commondity_title); - commoditySubTitle = (TextView) findViewById(R.id.udesk_im_commondity_subtitle); - commodityLink = (TextView) findViewById(R.id.udesk_im_commondity_link); - - popWindow = new UdeskConfirmPopWindow(this); - sendBtn = (TextView) findViewById(R.id.udesk_bottom_send); - sendBtn.setOnClickListener(this); - mInputEditView = (EditText) findViewById(R.id.udesk_bottom_input); - - funGridView = (GridView) findViewById(R.id.function_gridview); - udeskFunctionAdapter = new UdeskFunctionAdapter(this); - funGridView.setAdapter(udeskFunctionAdapter); - initfunctionItems(); - funGridView.setOnItemClickListener(new AdapterView.OnItemClickListener() { - @Override - public void onItemClick(AdapterView adapterView, View view, int i, long l) { - - try { - FunctionMode functionItem = (FunctionMode) adapterView.getItemAtPosition(i); - switch (functionItem.getId()) { - case UdeskConst.UdeskFunctionFlag.Udesk_Camera: - clickCamera(); - mBotomFramlayout.setVisibility(View.GONE); - break; - case UdeskConst.UdeskFunctionFlag.Udesk_Photo: - clickPhoto(); - mBotomFramlayout.setVisibility(View.GONE); - break; - case UdeskConst.UdeskFunctionFlag.Udesk_Udesk_File: - clickFile(); - mBotomFramlayout.setVisibility(View.GONE); - break; - case UdeskConst.UdeskFunctionFlag.Udesk_Survy: - if (isPresessionStatus) { - UdeskUtils.showToast(getApplicationContext(), - getString(R.string.udesk_can_not_be_evaluated)); - return; - } - clickSurvy(); - break; - case UdeskConst.UdeskFunctionFlag.Udesk_Location: - if (Build.VERSION.SDK_INT < 23) { - clickLocation(); - mBotomFramlayout.setVisibility(View.GONE); - } else { - XPermissionUtils.requestPermissions(UdeskChatActivity.this, RequestCode.LOCATION, - new String[]{Manifest.permission.ACCESS_COARSE_LOCATION, - Manifest.permission.ACCESS_FINE_LOCATION, - Manifest.permission.WRITE_EXTERNAL_STORAGE, - Manifest.permission.READ_EXTERNAL_STORAGE, - Manifest.permission.READ_PHONE_STATE}, - new XPermissionUtils.OnPermissionListener() { - @Override - public void onPermissionGranted() { - clickLocation(); - mBotomFramlayout.setVisibility(View.GONE); - } - - @Override - public void onPermissionDenied(String[] deniedPermissions, boolean alwaysDenied) { - Toast.makeText(UdeskChatActivity.this, - getResources().getString(R.string.location_denied), - Toast.LENGTH_SHORT).show(); - } - }); - } - - break; - case UdeskConst.UdeskFunctionFlag.Udesk_Video: - if (isPresessionStatus) { - UdeskUtils.showToast(getApplicationContext(), getString(R.string.udesk_can_not_be_video)); - return; - } - startVideo(); - mBotomFramlayout.setVisibility(View.GONE); - break; - default: - if (UdeskSDKManager.getInstance().getUdeskConfig().functionItemClickCallBack != null - && mPresenter != null) { - UdeskSDKManager.getInstance().getUdeskConfig().functionItemClickCallBack - .callBack(getApplicationContext(), mPresenter, functionItem.getId(), functionItem.getName()); - } - break; - } - } catch (Exception e) { - e.printStackTrace(); - } - } - }); - mListView = (UDPullGetMoreListView) findViewById(R.id.udesk_conversation); - expandableLayout = (UdeskExpandableLayout) findViewById(R.id.udesk_change_status_info); - - mContentLinearLayout = (LinearLayout) findViewById(R.id.udesk_content_ll); - mAudioImg = (ImageView) findViewById(R.id.udesk_img_audio); - if (UdeskSDKManager.getInstance().getUdeskConfig().isUseVoice) { - mAudioImg.setVisibility(View.VISIBLE); - } else { - mAudioImg.setVisibility(View.GONE); + udeskViewMode.getApiLiveData().messages(moreMarking); + //获取历史记录 + if (initCustomer == null || initCustomer.getCode() != 1000) { + //失败 结束流程, 走留言提示 + showFailToast(""); + curentStatus = UdeskConst.Status.failure; + setTitlebar(getString(R.string.udesk_ok), off); + initFragment(UdeskConst.CurrentFragment.agent); + return; } - mBtnAudio = (AudioRecordButton) findViewById(R.id.udesk_audio_btn); - mBtnAudio.init(UdeskUtils.getDirectoryPath(getApplicationContext(), UdeskConst.FileAduio)); - mBtnAudio.setRecordingListener(new AudioRecordButton.OnRecordingListener() { - @Override - public void recordStart() { - if (mRecordFilePlay != null) { - showStartOrStopAnaimaition( - mRecordFilePlay.getPlayAduioMessage(), false); - recycleVoiceRes(); - } - - } - - @Override - public void recordFinish(String audioFilePath, long recordTime) { - if (mPresenter != null) { - mPresenter.sendRecordAudioMsg(audioFilePath, recordTime); - } + if (!TextUtils.isEmpty(initCustomer.getUploadService().getReferer())) { + UdeskConst.REFERER_VALUE = initCustomer.getUploadService().getReferer(); + } + curentStatus = initCustomer.getStatus(); + Customer customer = initCustomer.getCustomer(); + customerId = customer != null ? customer.getId() : ""; + if (!TextUtils.isEmpty(customerId)) { + udeskViewMode.setCustomerId(customerId); + } + if (!UdeskXmppManager.getInstance().isConnection()) { + UdeskXmppManager.getInstance().connection(); + } + imSetting = initCustomer.getImSetting(); + if (curentStatus.equals(UdeskConst.Status.init)) { + //机器人判断 + robot = imSetting != null ? imSetting.getRobot() : null; + if (robot != null && robot.getEnable()) { + //进入机器人对话界面 + udeskViewMode.setRobotUrl(UdeskUtils.objectToString(robot.getUrl())); + initFragment(UdeskConst.CurrentFragment.robot); + setTitlebar(robot.getRobot_name(), on); + showTranferAgent(); + return; } - - @Override - public void recordError(String message) { - Message msg = Message.obtain(); - msg.what = MessageWhat.RECORD_ERROR; - mHandler.sendMessage(msg); - + } + initFragment(UdeskConst.CurrentFragment.agent); + //进入人工客服判断 非工作时间 结束后续流程 + if (!isWorkTime()) { + curentStatus = UdeskConst.Status.notWorkingTime; + setTitlebar(getString(R.string.udesk_label_customer_offline), off); + return; + } + if (curentStatus.equals(UdeskConst.Status.chatting)) { + //会话中 直接请求分配客服 + udeskViewMode.getApiLiveData().getAgentInfo(null, null); + } else if (curentStatus.equals(UdeskConst.Status.pre_session)) { + initAgentInfo(); + } else { + //如果客户被加入黑名单 则结束后续流程 + if (!isBlocked(customer)) { + initAgentInfo(); } - }); - - mEmojiImg = (ImageView) findViewById(R.id.udesk_emoji_img); - showEmoji(); - mMoreImg = (ImageView) findViewById(R.id.udesk_more_img); - mBotomFramlayout = (FrameLayout) findViewById(R.id.udesk_bottom_frame); - mEmotionlayout = (EmotionLayout) findViewById(R.id.udesk_emotion_view); - mMoreLayout = (LinearLayout) findViewById(R.id.udesk_more_layout); - mEmotionlayout.attachEditText(mInputEditView); - initEmotionKeyboard(); - - navigationRootView = findViewById(R.id.navigation_root_view); - addNavigationFragmentView = findViewById(R.id.fragment_view); - navigation_survy = findViewById(R.id.navigation_survy); - navigation_survy.setOnClickListener(this); - setNavigationViewVis(); - setListView(); - initDatabase(); - mPresenter.createIMCustomerInfo(); - isNeedRelogin = !UdeskUtils.isNetworkConnected(this); + } } catch (Exception e) { e.printStackTrace(); } } - private void showEmoji() { + private void initAgentInfo() { try { - if (UdeskSDKManager.getInstance().getUdeskConfig().isUseEmotion && LQREmotionKit.getEmotionPath() != null) { - mEmojiImg.setVisibility(View.VISIBLE); + pre_session_id = initCustomer.getPre_session().getPre_session_id(); + if (getPressionStatus()) { + String preTitle = initCustomer.getPre_session().getPre_session_title(); + if (TextUtils.isEmpty(pre_session_id)) { + udeskViewMode.getApiLiveData().getPressionInfo(); + } + curentStatus = UdeskConst.Status.pre_session; + mAgentInfo = null; + setTitlebar(preTitle, on); } else { - mEmojiImg.setVisibility(View.GONE); + udeskViewMode.getApiLiveData().getAgentInfo(pre_session_id, null); } } catch (Exception e) { e.printStackTrace(); } - } - - private void initfunctionItems() { - try { - functionItems.clear(); - if (UdeskSDKManager.getInstance().getUdeskConfig().isUsecamera) { - FunctionMode cameraItem = new FunctionMode(getString(R.string.funtion_camera), UdeskConst.UdeskFunctionFlag.Udesk_Camera, R.drawable.udesk_camer_normal1); - functionItems.add(cameraItem); - } - if (UdeskSDKManager.getInstance().getUdeskConfig().isUsephoto) { - FunctionMode photoItem = new FunctionMode(getString(R.string.photo), UdeskConst.UdeskFunctionFlag.Udesk_Photo, R.drawable.udesk_image_normal1); - functionItems.add(photoItem); - } - if (isOpenVideo() && mAgentInfo != null) { - FunctionMode videoItem = new FunctionMode(getString(R.string.video), UdeskConst.UdeskFunctionFlag.Udesk_Video, R.drawable.udesk_video_normal); - functionItems.add(videoItem); - } - - if (mAgentInfo != null && UdeskSDKManager.getInstance().getImSetting() != null && UdeskSDKManager.getInstance().getImSetting().getEnable_im_survey()) { - FunctionMode survyItem = new FunctionMode(getString(R.string.survy), UdeskConst.UdeskFunctionFlag.Udesk_Survy, R.drawable.udesk_survy_normal); - functionItems.add(survyItem); - } - if (UdeskSDKManager.getInstance().getUdeskConfig().isUseMap) { - FunctionMode mapItem = new FunctionMode(getString(R.string.location), UdeskConst.UdeskFunctionFlag.Udesk_Location, R.drawable.udesk_location_normal); - functionItems.add(mapItem); - } - - if (UdeskSDKManager.getInstance().getUdeskConfig().isUsefile) { - FunctionMode fileItem = new FunctionMode(getString(R.string.file), UdeskConst.UdeskFunctionFlag.Udesk_Udesk_File, R.drawable.udesk_file_icon); - functionItems.add(fileItem); - } - - if (UdeskSDKManager.getInstance().getUdeskConfig().extreFunctions != null - && UdeskSDKManager.getInstance().getUdeskConfig().extreFunctions.size() > 0) { - functionItems.addAll(UdeskSDKManager.getInstance().getUdeskConfig().extreFunctions); - } + } - udeskFunctionAdapter.setFunctionItems(functionItems); - } catch (Exception e) { - e.printStackTrace(); - } + private boolean isWorkTime() { + boolean isWorkTime = imSetting != null ? imSetting.getIs_worktime() : true; + return isWorkTime; } - private void setNavigationViewVis() { + private void showTranferAgent() { try { - if (UdeskSDKManager.getInstance().getUdeskConfig().isUseNavigationRootView) { - navigationRootView.setVisibility(View.VISIBLE); - } else { - navigationRootView.setVisibility(View.GONE); - } - if (UdeskSDKManager.getInstance().getUdeskConfig().navigationModes != null - && UdeskSDKManager.getInstance().getUdeskConfig().navigationModes.size() > 0) { - addNavigationFragment(); - } - if (UdeskSDKManager.getInstance().getUdeskConfig().isUseNavigationSurvy && mAgentInfo != null && - UdeskSDKManager.getInstance().getImSetting() != null - && UdeskSDKManager.getInstance().getImSetting().getEnable_im_survey()) { - navigation_survy.setVisibility(View.VISIBLE); - } else { - navigation_survy.setVisibility(View.GONE); + if (mTitlebar != null) { + if (robot != null && robot.getEnable_agent() && curentStatus.equals(UdeskConst.Status.robot) && !UdeskSDKManager.getInstance().getUdeskConfig().isOnlyUseRobot) { + if (robotSengMsgCount >= robot.getShow_robot_times()) { + mTitlebar.setRightViewVis(View.VISIBLE); + } else { + mTitlebar.setRightViewVis(View.GONE); + } + } else { + mTitlebar.setRightViewVis(View.GONE); + } } } catch (Exception e) { e.printStackTrace(); } - } - - private void recordError() { - try { - UdeskUtils.showToast(UdeskChatActivity.this.getApplicationContext(), getResources() - .getString(R.string.udesk_im_record_error)); - } catch (Resources.NotFoundException e) { - e.printStackTrace(); - } } - private boolean isOpenVideo() { + private void initUdeskViewMode() { try { - return UdeskSDKManager.getInstance().getImSetting() != null - && UdeskSDKManager.getInstance().getImSetting().getVcall() - && UdeskSDKManager.getInstance().getImSetting().getSdk_vcall() - && UdeskUtil.isClassExists("udesk.udeskvideo.UdeskVideoActivity"); - } catch (Exception e) { - e.printStackTrace(); - } - return false; - } - - private void initEmotionKeyboard() { - try { - mEmotionKeyboard = EmotionKeyboard.with(this); - mEmotionKeyboard.bindToEditText(mInputEditView); - mEmotionKeyboard.bindToContent(mContentLinearLayout); - mEmotionKeyboard.setEmotionLayout(mBotomFramlayout); - mEmotionKeyboard.bindToEmotionButton(mEmojiImg, mMoreImg); - mEmotionKeyboard.setOnEmotionButtonOnClickListener(new EmotionKeyboard.OnEmotionButtonOnClickListener() { + udeskViewMode = ViewModelProviders.of(this).get(UdeskViewMode.class); + udeskViewMode.setBaseValue( + UdeskSDKManager.getInstance().getDomain(getApplicationContext()), + UdeskSDKManager.getInstance().getAppkey(getApplicationContext()), + UdeskSDKManager.getInstance().getSdkToken(getApplicationContext()), + UdeskSDKManager.getInstance().getAppId(getApplicationContext()) + ); + udeskViewMode.getLiveDataMerger().observeForever(new Observer() { @Override - public boolean onEmotionButtonOnClickListener(View view) { - try { - if (isbolcked != null && isbolcked.equals("true")) { - toBolckedView(); - return true; - } - if (isMoreTanSendCount() && isNeedQueueMessageSave()) { + public void onChanged(@Nullable MergeMode mergeMode) { + Log.i("xxxxx", " type = " + mergeMode.getType()); + udeskViewMode.postNextMessage(mergeMode); + switch (mergeMode.getType()) { + case UdeskConst.LiveDataType.CustomerInitSuccess: + initCustomer = (InitCustomerBean) mergeMode.getData(); + UdeskSDKManager.getInstance().setInitCustomerBean(initCustomer); + doWithInitCustomer(); + break; + case UdeskConst.LiveDataType.CustomerInitFailure: + showFailToast(""); + curentStatus = UdeskConst.Status.failure; + initFragment(UdeskConst.CurrentFragment.agent); + break; + case UdeskConst.LiveDataType.SetPreSessionStatus: + pre_session_id = UdeskUtils.objectToString(mergeMode.getData()); + break; + //收到通过xmpp发送过来的消息 + case UdeskConst.LiveDataType.XmppReceiveLivaData_ReceiveXmppMessage: + MessageInfo receiveMsg = (MessageInfo) mergeMode.getData(); + if (receiveMsg == null) { + return; + } + if (receiveMsg.getMsgtype().equals(UdeskConst.ChatMsgTypeString.TYPE_REDIRECT)) { + try { + redirectMsg = receiveMsg; + JSONObject json = new JSONObject(receiveMsg.getMsgContent()); + String agent_id = json.optString("agent_id"); + String group_id = json.optString("group_id"); + curentStatus = UdeskConst.Status.init; + udeskViewMode.getApiLiveData().getRedirectAgentInfo(agent_id, group_id); + } catch (Exception e) { + e.printStackTrace(); + } + } else { + //多人会话发过来的消息 + if (receiveMsg.getInviterAgentInfo() != null && !TextUtils.isEmpty(receiveMsg.getInviterAgentInfo().getJid())) { + receiveMsg.setUser_avatar(receiveMsg.getInviterAgentInfo().getAvatar()); + receiveMsg.setReplyUser(receiveMsg.getInviterAgentInfo().getNick_name()); + } else { + if (mAgentInfo != null && mAgentInfo.getAgentCode() == UdeskConst.AgentReponseCode.HasAgent) { + if (!TextUtils.isEmpty(receiveMsg.getReplyUser())) { + mAgentInfo.setAgentNick(receiveMsg.getReplyUser()); + } else { + receiveMsg.setReplyUser(mAgentInfo.getAgentNick()); + } + if (!TextUtils.isEmpty(receiveMsg.getUser_avatar())) { + mAgentInfo.setHeadUrl(receiveMsg.getUser_avatar()); + } else { + receiveMsg.setUser_avatar(mAgentInfo.getHeadUrl()); + } + + if (!mAgentInfo.getAgentJid().contains(receiveMsg.getmAgentJid())) { + udeskViewMode.getApiLiveData().getAgentInfo(null, null); + mAgentInfo.setAgentJid(receiveMsg.getmAgentJid()); + String jid[] = receiveMsg.getmAgentJid().split("/"); + String[] urlAndNick = UdeskDBManager.getInstance().getAgentUrlAndNick(jid[0]); + String agentName = ""; + String headUrl = ""; + if (urlAndNick != null) { + headUrl = urlAndNick[0]; + agentName = urlAndNick[1]; + } + if (TextUtils.isEmpty(headUrl)) { + mAgentInfo.setHeadUrl(headUrl); + receiveMsg.setUser_avatar(headUrl); + } + if (!TextUtils.isEmpty(receiveMsg.getReplyUser())) { + mAgentInfo.setAgentNick(receiveMsg.getReplyUser()); + } else if (!TextUtils.isEmpty(agentName)) { + mAgentInfo.setAgentNick(agentName); + receiveMsg.setReplyUser(agentName); + } else { + receiveMsg.setReplyUser(mAgentInfo.getAgentNick()); + } + } + + } else if (!TextUtils.isEmpty(receiveMsg.getmAgentJid()) && mAgentInfo != null && mAgentInfo.getAgentCode() == UdeskConst.AgentReponseCode.WaitAgent) { + if (myRunnable != null) { + mHandler.removeCallbacks(myRunnable); + mHandler.post(myRunnable); + } + } else { + if (mAgentInfo != null && !TextUtils.isEmpty(receiveMsg.getmAgentJid())) { + udeskViewMode.getApiLiveData().getAgentInfo(pre_session_id, null); + } + } + } + mChatAdapter.addItem(receiveMsg); + UdeskDBManager.getInstance().addMessageInfo(receiveMsg); + mListView.smoothScrollToPosition(mChatAdapter.getCount()); + } + break; + //收到发送给客服的消息 客服给的回执 + case UdeskConst.LiveDataType.XmppReceiveLivaData_ReceiveXmppMessageReceived: + String successMsgId = UdeskUtils.objectToString(mergeMode.getData()); + if (!TextUtils.isEmpty(successMsgId)) { + udeskViewMode.getSendMessageLiveData().removeSendMsgCace(successMsgId); + changeImState(successMsgId, UdeskConst.SendFlag.RESULT_SUCCESS); + } + break; + //收到客服状态的presence消息 + case UdeskConst.LiveDataType.XmppReceiveLivaData_ReceiveXmmpPresence: + Map hashMap = (Map) mergeMode.getData(); + if (hashMap != null) { + int onlineflag = UdeskUtils.objectToInt(hashMap.get("onlineflag")); + String jid = UdeskUtils.objectToString(hashMap.get("jid")); + if (mAgentInfo == null || + isbolcked.equals("true") || + TextUtils.isEmpty(mAgentInfo.getAgentJid()) + || !jid.contains(mAgentInfo.getAgentJid())) { + return; + } + if (onlineflag == UdeskConst.ONLINEFLAG) { + if (!currentStatusIsOnline && isNeedStartExpandabLyout) { + expandableLayout.startAnimation(true); + currentStatusIsOnline = true; + isNeedStartExpandabLyout = false; + } + showOnlieStatus(mAgentInfo); + setUdeskImContainerVis(View.VISIBLE); + if (popWindow != null) { + popWindow.cancle(); + } + } else if (onlineflag == UdeskConst.OFFLINEFLAG) { + udeskViewMode.getApiLiveData().getIMStatus(mAgentInfo); + } + } + break; + //收到满意度调查的消息 + //弹出评价选项 + case UdeskConst.LiveDataType.XmppReceiveLivaData_ReceiveXmmpSurvey: + isSurvyOperate = true; + if (initCustomer != null && initCustomer.getIm_survey() != null) { + SurveyOptionsModel surveyOptions = initCustomer.getIm_survey(); + setIsPermmitSurvy(true); + if (surveyOptions != null) { + toLaunchSurveyView(surveyOptions); + } + } else { + udeskViewMode.getApiLiveData().getIMSurveyOptions(null); + } + break; + //收到客服在工单处回复SDK的消息 + case UdeskConst.LiveDataType.XmppReceiveLivaData_ReceiveXmmpTicketReplay: + if (!TextUtils.isEmpty(customerId)) { + udeskViewMode.getApiLiveData().getTicketReplies(1, UdeskConst.UDESK_HISTORY_COUNT); + } + break; + //收到结束会话通知 + case UdeskConst.LiveDataType.XmppReceiveLivaData_ReceiveXmmpOver: + curentStatus = UdeskConst.Status.over; + setTitlebar(getResources().getString(R.string.udesk_close_chart), off); + isMoreThan20 = false; + break; + // 发送消息增加到页面上,不break,共用收到消息刷新? + case UdeskConst.LiveDataType.AddMessage: + MessageInfo sendMessage = (MessageInfo) mergeMode.getData(); + if (sendMessage == null) { + return; + } + if (curentStatus.equals(UdeskConst.Status.robot)) { + sendMessage.setSendFlag(UdeskConst.SendFlag.RESULT_SUCCESS); + udeskViewMode.getRobotApiData().robotMessage(sendMessage); + mChatAdapter.addItem(sendMessage); + mListView.smoothScrollToPosition(mChatAdapter.getCount()); + udeskViewMode.getDbLiveData().saveMessageDB(sendMessage); + robotSengMsgCount++; + showTranferAgent(); + return; + } + changeFileProgress(sendMessage.getMsgId(), 100, 0, true); + if (mAgentInfo != null && mAgentInfo.getAgentCode() == 2000) { + sendMessage.setmAgentJid(mAgentInfo.getAgentJid()); + sendMessage.setSubsessionid(mAgentInfo.getIm_sub_session_id()); + sendMessage.setSeqNum(UdeskDBManager.getInstance().getSubSessionId(mAgentInfo.getIm_sub_session_id())); + } + if (!TextUtils.isEmpty(customerId)) { + sendMessage.setCustomerId(customerId); + } + if (getPressionStatus()) { + JSONObject preMessage = JsonObjectUtils.buildPreSessionInfo(sendMessage.getMsgtype(), + sendMessage.getMsgContent(), sendMessage.getMsgId(), + sendMessage.getDuration(), pre_session_id, sendMessage.getFilename(), + sendMessage.getFilesize()); + udeskViewMode.getApiLiveData().getAgentInfo(pre_session_id, preMessage); + udeskViewMode.addPressionMsg(sendMessage); + return; + } + mChatAdapter.addItem(sendMessage); + mListView.smoothScrollToPosition(mChatAdapter.getCount()); + udeskViewMode.getDbLiveData().saveMessageDB(sendMessage); + if (isNeedQueueMessageSave()) { + udeskViewMode.getSendMessageLiveData().sendQueueMessage(sendMessage); + return; + } + udeskViewMode.getSendMessageLiveData().sendMessage(sendMessage); + break; + //增加直接离线留消息 + case UdeskConst.LiveDataType.AddLeaveMsg: + MessageInfo leaveMsg = (MessageInfo) mergeMode.getData(); + if (leaveMsg == null) { + return; + } + mChatAdapter.addItem(leaveMsg); + mListView.smoothScrollToPosition(mChatAdapter.getCount()); + udeskViewMode.getDbLiveData().saveMessageDB(leaveMsg); + udeskViewMode.putLeavesMsg(leaveMsg); + break; + //检查本地收到客服消息是否有跳序 + case UdeskConst.LiveDataType.Check_Agent_Seq_Num: + int agent_seq_num = (int) mergeMode.getData(); + if (getAgentSeqNum() != 0 && agent_seq_num > getAgentSeqNum()) { +// isFirstLoad=true; + udeskViewMode.getApiLiveData().messages(""); + } + break; + //消息发送失败 + case UdeskConst.LiveDataType.Send_Message_Failure: + case UdeskConst.LiveDataType.RobotHitFailure: + case UdeskConst.LiveDataType.RobotMessageFailure: + String failureMsgId = UdeskUtils.objectToString(mergeMode.getData()); + changeImState(failureMsgId, UdeskConst.SendFlag.RESULT_FAIL); + break; + //messagesave 返回code 8002 需要重新请求流程 + case UdeskConst.LiveDataType.RECREATE_CUSTOMER_INFO: + reCreateIMCustomerInfo(); + break; + //排队中发送消息的错误提示 + case UdeskConst.LiveDataType.QueueMessageSaveError: + moreThanStirng = UdeskUtils.objectToString(mergeMode.getData()); + isMoreThan20 = true; UdeskUtils.showToast(getApplicationContext(), getMoreThanSendTip()); - mEmotionKeyboard.hideSoftInput(); - return true; - } - if (!isShowNotSendMsg()) { - mEmotionKeyboard.hideSoftInput(); - return true; - } - int i = view.getId(); - if (i == R.id.udesk_emoji_img) { - if (!mEmotionlayout.isShown()) { - if (mMoreLayout.isShown()) { - showEmotionLayout(); - hideMoreLayout(); - hideAudioButton(); - return true; + break; + //给出评价成功与否的提示 + case UdeskConst.LiveDataType.Survey_Result: + boolean isSuccess = (boolean) mergeMode.getData(); + setIsPermmitSurvy(true); + if (isSuccess) { + UdeskUtils.showToast(getApplicationContext(), getResources().getString(R.string.udesk_thanks_survy)); + } else { + UdeskUtils.showToast(getApplicationContext(), getResources().getString(R.string.udesk_survey_error)); + } + break; + //给出评价成功与否的提示 + case UdeskConst.LiveDataType.ROBOT_SURVEY_RESULT: + if ((boolean) mergeMode.getData()) { + UdeskUtils.showToast(getApplicationContext(), getResources().getString(R.string.udesk_thanks_survy)); + } else { + UdeskUtils.showToast(getApplicationContext(), getResources().getString(R.string.udesk_survey_error)); + } + break; + + case UdeskConst.LiveDataType.click_Survey: + if (initCustomer != null && initCustomer.getIm_survey() != null) { + SurveyOptionsModel surveyOptions = initCustomer.getIm_survey(); + setIsPermmitSurvy(true); + if (surveyOptions != null) { + toLaunchSurveyView(surveyOptions); } - } else if (mEmotionlayout.isShown() && !mMoreLayout.isShown()) { - mEmojiImg.setImageResource(R.drawable.udesk_ic_cheat_emo); - return false; + } else { + udeskViewMode.getApiLiveData().getIMSurveyOptions(null); } - showEmotionLayout(); - hideMoreLayout(); - hideAudioButton(); - - } else if (i == R.id.udesk_more_img) { - if (!mMoreLayout.isShown()) { - if (mEmotionlayout.isShown()) { - showMoreLayout(); - hideEmotionLayout(); - hideAudioButton(); - return true; + break; + case UdeskConst.LiveDataType.finsh_Survey: + if (initCustomer != null && initCustomer.getIm_survey() != null) { + SurveyOptionsModel surveyOptions = initCustomer.getIm_survey(); + setIsPermmitSurvy(true); + if (surveyOptions != null) { + toLaunchSurveyView(surveyOptions); } + } else { + finish(); } - showMoreLayout(); - hideEmotionLayout(); - hideAudioButton(); + break; - } - } catch (Exception e) { - e.printStackTrace(); + case UdeskConst.LiveDataType.toLaunchSurveyView: + SurveyOptionsModel surveyOptions = (SurveyOptionsModel) mergeMode.getData(); + setIsPermmitSurvy(true); + if (surveyOptions != null) { + toLaunchSurveyView(surveyOptions); + } + case UdeskConst.LiveDataType.RobotSessionHasSurvey: + if ((boolean) mergeMode.getData()) { + UdeskUtils.showToast(getApplicationContext(), getResources() + .getString(R.string.udesk_has_survey)); + } else { + SurveyOptionsModel surveyOptionsModel1 = UdeskUtil.buildSurveyOptionsModel(getApplicationContext()); + toLaunchSurveyView(surveyOptionsModel1); + } + break; + //给出已经评价的提示 + case UdeskConst.LiveDataType.HasSurvey: + setIsPermmitSurvy(true); + UdeskUtils.showToast(getApplicationContext(), getResources() + .getString(R.string.udesk_has_survey)); + break; + + //请求流程未完成的 失败提示 + case UdeskConst.LiveDataType.FailEnd: + String failMsg = UdeskUtils.objectToString(mergeMode.getData()); + showFailToast(failMsg); + curentStatus = UdeskConst.Status.failure; + break; + //处理正常请求客服的返回流程 + case UdeskConst.LiveDataType.DealAgentInfo: + AgentInfo agentInfo = (AgentInfo) mergeMode.getData(); + dealAgentInfo(agentInfo, false); + break; + //更新客服的是否在线状态 + case UdeskConst.LiveDataType.IMSTATUS: + String imStatus = UdeskUtils.objectToString(mergeMode.getData()); + doAgentStatus(imStatus); + break; + //处理收到转移客服请求的流程 + case UdeskConst.LiveDataType.RedirectAgentInfo: + AgentInfo redirectAgentInfo = (AgentInfo) mergeMode.getData(); + dealAgentInfo(redirectAgentInfo, true); + break; + //拉取留言消息接口后刷新listviiew + case UdeskConst.LiveDataType.PullEventModel: + AllMessageMode replieMode = (AllMessageMode) mergeMode.getData(); + if (replieMode != null && replieMode.getMessages() != null && replieMode.getMessages().size() > 0) { + List messageInfoList = new ArrayList<>(); + for (int i = 0; i < replieMode.getMessages().size(); i++) { + LogBean allMessage = (LogBean) replieMode.getMessages().get(i); + MessageInfo info = UdeskUtil.buildAllMessage(allMessage); + if (info != null) { + info.setSwitchStaffType(0); + messageInfoList.add(info); + } + } + currentMode = PullEventModel; + udeskViewMode.getDbLiveData().addAllMessageInfo(messageInfoList); + reFreshMessages(messageInfoList); + } + break; + //增加一条文件类型的消息(包含语言 图片 等) + case UdeskConst.LiveDataType.AddFileMessage: + MessageInfo fileMessage = (MessageInfo) mergeMode.getData(); + if (fileMessage == null) { + return; + } + if (mAgentInfo != null && mAgentInfo.getAgentCode() == 2000) { + fileMessage.setmAgentJid(mAgentInfo.getAgentJid()); + fileMessage.setSubsessionid(mAgentInfo.getIm_sub_session_id()); + fileMessage.setSeqNum(UdeskDBManager.getInstance().getSubSessionId(mAgentInfo.getIm_sub_session_id())); + } + if (!TextUtils.isEmpty(customerId)) { + fileMessage.setCustomerId(customerId); + } + mChatAdapter.addItem(fileMessage); + mListView.smoothScrollToPosition(mChatAdapter.getCount()); + udeskViewMode.getDbLiveData().saveMessageDB(fileMessage); + udeskViewMode.getFileLiveData().upLoadFile(fileMessage); + break; + //更新文件上传进度 + case UdeskConst.LiveDataType.UpLoadFileLiveData_progress: + MessageInfo progressMsg = (MessageInfo) mergeMode.getData(); + changeFileProgress(progressMsg.getMsgId(), progressMsg.getPrecent(), 0, true); + break; + //文件下载失败 + case UdeskConst.LiveDataType.DownFileError: + String msgId = UdeskUtils.objectToString(mergeMode.getData()); + changeFileProgress(msgId, 0, 0, false); + break; + //获取到拉取远程数据处理完的通知 + case UdeskConst.LiveDataType.PullMessages: + initLoadData(); + break; + //加载本地数据库 + case UdeskConst.LiveDataType.LoadHistoryDBMsg: + List msgs = (List) mergeMode.getData(); + for (MessageInfo messageInfo : msgs) { + messageInfo.setFirstLoad(true); + } + reFreshMessages(msgs); + break; + //刷新小视频第一帧图 + case UdeskConst.LiveDataType.ChangeVideoThumbnail: + String videoMsgId = UdeskUtils.objectToString(mergeMode.getData()); + changeVideoThumbnail(videoMsgId); + break; + //机器人初始化成功 + case UdeskConst.LiveDataType.RobotInitSuccess: + String robotInitMsg = UdeskUtils.objectToString(mergeMode.getData()); + robotInit = JsonUtils.parseRobotInit(robotInitMsg); + if (robotInit != null && robotInit.getWebConfig() != null) { + MessageInfo welcomInfo = UdeskUtil.buildWelcomeRelpy(robotInit); + MessageInfo questionInfo = UdeskUtil.buildRobotInitRelpy(robotInit); + List infoList = new ArrayList<>(); + if (UdeskUtils.objectToInt(robotInit.getSwitchStaffType()) == 2) { + welcomInfo.setSwitchStaffType(0); + questionInfo.setSwitchStaffType(0); + infoList.add(welcomInfo); + infoList.add(questionInfo); + mChatAdapter.listAddEventItems(infoList); + mListView.smoothScrollToPosition(mChatAdapter.getCount()); + udeskViewMode.setSessionId(robotInit.getSessionId()); + autoTransfer(); + } else { + infoList.add(welcomInfo); + infoList.add(questionInfo); + mChatAdapter.listAddEventItems(infoList); + mListView.smoothScrollToPosition(mChatAdapter.getCount()); + udeskViewMode.setSessionId(robotInit.getSessionId()); + } + } + break; + //机器人初始化失败 + case UdeskConst.LiveDataType.RobotInitFailure: + break; + //机器人发送文本请求返回成功 + case UdeskConst.LiveDataType.RobotMessageSuccess: + //机器人流程请求返回成功 + case UdeskConst.LiveDataType.RobotFlowSuccess: + //机器人点击请求返回成功 机器人返回消息 + case UdeskConst.LiveDataType.RobotHitSuccess: + String hitMessage = UdeskUtils.objectToString(mergeMode.getData()); + LogBean logBean = JsonUtils.parseLogBean(hitMessage); + if (logBean != null) { + if (logBean.getContent() != null) { + Content content = logBean.getContent(); + if (content.getData() != null) { + DataBean data = content.getData(); + if (data.getSwitchStaffType() == 1 && !TextUtils.isEmpty(data.getSwitchStaffTips()) && !UdeskSDKManager.getInstance().getUdeskConfig().isOnlyUseRobot) { + transferMap.put(UdeskUtils.objectToString(logBean.getMessage_id()), true); + usefulMap.put(UdeskUtils.objectToString(logBean.getMessage_id()), true); + } + if (data.getTopAsk() != null && data.getTopAsk().size() > 0 && !TextUtils.isEmpty(data.getContent())) { + usefulMap.put(UdeskUtils.objectToString(logBean.getMessage_id()), true); + } + if (content.getType().equals(UdeskConst.ChatMsgTypeString.TYPE_WECHAT_IMAGE)) { + usefulMap.put(UdeskUtils.objectToString(logBean.getMessage_id()), true); + } + } + } + MessageInfo info = UdeskUtil.buildAllMessage(logBean); + if (info != null) { + udeskViewMode.getDbLiveData().saveMessageDB(info); + mChatAdapter.addItem(info); + mListView.smoothScrollToPosition(mChatAdapter.getCount()); + if (info.getSwitchStaffType() == 2) { + autoTransfer(); + } + } + } + break; + //智能提示返回成功 + case UdeskConst.LiveDataType.RobotTipsSuccess: + String tipMsg = UdeskUtils.objectToString(mergeMode.getData()); + String inputTxt = ((QuestionMerMode) mergeMode).getQuestion(); + RobotTipBean tipBean = JsonUtils.parseRobotTip(tipMsg); + if (tipBean != null && tipBean.getList() != null && tipBean.getList().size() > 0) { + tipAdapter.setListAndContent(tipBean.getList(), inputTxt); + if (TextUtils.isEmpty(fragment.getInputContent())) { + isShowAssociate(false); + } else { + isShowAssociate(true); + } + } else { + isShowAssociate(false); + } + break; + //机器人智能提示点击 + case UdeskConst.LiveDataType.RobotTipHit: + RobotTipBean.ListBean listBean = (RobotTipBean.ListBean) mergeMode.getData(); + isShowAssociate(false); + fragment.clearInputContent(); + if (listBean != null) { + MessageInfo sendTipMsg = UdeskUtil.buildSendChildMsg((String) listBean.getQuestion()); + mChatAdapter.addItem(sendTipMsg); + udeskViewMode.getDbLiveData().saveMessageDB(sendTipMsg); + mListView.smoothScrollToPosition(mChatAdapter.getCount()); + robotSengMsgCount++; + showTranferAgent(); + udeskViewMode.getRobotApiData().robotHit(sendTipMsg.getMsgId(), 0, UdeskUtils.objectToString(listBean.getQuestion()), UdeskUtils.objectToInt(listBean.getQuestionId()), ((QuestionMerMode) mergeMode).getQueryType()); + } + break; + //机器人流程点击 + case UdeskConst.LiveDataType.ROBOT_FLOW_HIT: + MessageInfo flowInfo = (MessageInfo) mergeMode.getData(); + isShowAssociate(false); + fragment.clearInputContent(); + if (flowInfo != null) { + MessageInfo sendTipMsg = UdeskUtil.buildSendChildMsg(((QuestionMerMode) mergeMode).getQuestion()); + mChatAdapter.addItem(sendTipMsg); + udeskViewMode.getDbLiveData().saveMessageDB(sendTipMsg); + mListView.smoothScrollToPosition(mChatAdapter.getCount()); + robotSengMsgCount++; + showTranferAgent(); + udeskViewMode.getRobotApiData().robotHit(flowInfo.getMsgId(), flowInfo.getLogId(), ((QuestionMerMode) mergeMode).getQuestion(), ((QuestionMerMode) mergeMode).getQuestionId(), ((QuestionMerMode) mergeMode).getQueryType()); + } + break; + + //智能提示返回失败 + case UdeskConst.LiveDataType.RobotTipsFailure: + mLlAssociate.setVisibility(View.GONE); + break; + //问题待推荐点击子条目 + case UdeskConst.LiveDataType.RobotChildHit: + MessageInfo sendChildQueMsg = UdeskUtil.buildSendChildMsg(((QuestionMerMode) mergeMode).getQuestion()); + mChatAdapter.addItem(sendChildQueMsg); + udeskViewMode.getDbLiveData().saveMessageDB(sendChildQueMsg); + mListView.smoothScrollToPosition(mChatAdapter.getCount()); + robotSengMsgCount++; + showTranferAgent(); + udeskViewMode.getRobotApiData().robotHit(((QuestionMerMode) mergeMode).getMsgId(), ((QuestionMerMode) mergeMode).getLogId(), ((QuestionMerMode) mergeMode).getQuestion(), ((QuestionMerMode) mergeMode).getQuestionId(), ((QuestionMerMode) mergeMode).getQueryType()); + break; + //机器人发送文本消息 + case UdeskConst.LiveDataType.ROBOT_SEND_TXT_MSG: + MessageInfo txtMsg = UdeskUtil.buildSendChildMsg((UdeskUtils.objectToString(mergeMode.getData()))); + mChatAdapter.addItem(txtMsg); + mListView.smoothScrollToPosition(mChatAdapter.getCount()); + udeskViewMode.getDbLiveData().saveMessageDB(txtMsg); + udeskViewMode.getRobotApiData().robotMessage(txtMsg); + robotSengMsgCount++; + showTranferAgent(); + break; + + case UdeskConst.LiveDataType.ROBOT_TABLE_CLICK: + MessageInfo tableMsg = UdeskUtil.buildSendChildMsg((UdeskUtils.objectToString(mergeMode.getData()))); + mChatAdapter.addItem(tableMsg); + mListView.smoothScrollToPosition(mChatAdapter.getCount()); + udeskViewMode.getDbLiveData().saveMessageDB(tableMsg); + udeskViewMode.getRobotApiData().robotMessage(tableMsg); + robotSengMsgCount++; + showTranferAgent(); + break; + case UdeskConst.LiveDataType.ROBOT_TRANSFER_CLICK: + autoTransfer(); + break; + case UdeskConst.LiveDataType.ROBOT_SHOW_PRODUCT_CLICK: + ProductListBean productListBean = (ProductListBean) mergeMode.getData(); + MessageInfo replyProductMsg = UdeskUtil.buildReplyProductMsg(productListBean); + mChatAdapter.addItem(replyProductMsg); + mListView.smoothScrollToPosition(mChatAdapter.getCount()); + udeskViewMode.getDbLiveData().saveMessageDB(replyProductMsg); + udeskViewMode.getRobotApiData().robotMessage(replyProductMsg); + robotSengMsgCount++; + showTranferAgent(); + break; + + case UdeskConst.LiveDataType.V4PullMessagesSuccess: + String loadMsg = UdeskUtils.objectToString(mergeMode.getData()); + AllMessageMode allMessageMode = JsonUtils.parseMessage(loadMsg); + if (allMessageMode != null) { + List messageInfoList = new ArrayList<>(); + if (allMessageMode.getMessages() != null && allMessageMode.getMessages().size() > 0) { + for (int i = 0; i < allMessageMode.getMessages().size(); i++) { + LogBean allMessage = (LogBean) allMessageMode.getMessages().get(i); + MessageInfo info = UdeskUtil.buildAllMessage(allMessage); + if (info != null) { + messageInfoList.add(info); + } + } + if (TextUtils.isEmpty(moreMarking)) { + udeskViewMode.getDbLiveData().deleteAllMsg(); + currentMode = InitViewMode; +// isFirstLoad=false; + } else { + currentMode = PullRefreshModel; + } + udeskViewMode.getDbLiveData().addAllMessageInfo(messageInfoList); + reFreshMessages(messageInfoList); + } + moreMarking = allMessageMode.getMore_marking(); + } + break; + case UdeskConst.LiveDataType.ROBOT_TRANSFER: + MessageInfo robotTransferMsg = UdeskUtil.buildRobotTransferMsg(getResources().getString(R.string.udesk_transfer_person)); + mChatAdapter.addItem(robotTransferMsg); + mListView.smoothScrollToPosition(mChatAdapter.getCount()); + udeskViewMode.getDbLiveData().saveMessageDB(robotTransferMsg); + break; } - return false; } }); - - initListener(); } catch (Exception e) { e.printStackTrace(); } - } - - public void initListener() { - try { - mAudioImg.setOnClickListener(this); - //触摸消息区域 隐藏键盘 -// mContentLinearLayout.setOnTouchListener(new View.OnTouchListener() { -// @Override -// public boolean onTouch(View v, MotionEvent event) { -// bottomoPannelBegginStatus(); -// return false; -// } -// }); - - mEmotionlayout.setEmotionSelectedListener(this); - mEmotionlayout.setEmotionAddVisiable(true); - mEmotionlayout.setEmotionSettingVisiable(true); + } - mInputEditView.addTextChangedListener(new TextWatcher() { - @Override - public void beforeTextChanged(CharSequence s, int start, int count, int after) { + public void isShowAssociate(boolean b) { + if (b) { + mLlAssociate.setVisibility(View.VISIBLE); + } else { + mLlAssociate.setVisibility(View.GONE); + } + } + /** + * 机器人自动转人工 + */ + private void autoTransfer() { + try { + if (!UdeskSDKManager.getInstance().getUdeskConfig().isOnlyUseRobot) { + //判断是否有导航设置,有导航设置进入导航页面 + boolean enableImgroup = imSetting != null ? imSetting.getEnable_im_group() : false; + Customer customer = initCustomer.getCustomer(); + customerId = customer != null ? customer.getId() : ""; + if (!TextUtils.isEmpty(customerId)) { + udeskViewMode.setCustomerId(customerId); + } + List agentGroups = initCustomer.getIm_group(); + if (enableImgroup && agentGroups != null && agentGroups.size() > 0) { + UdeskOptionsAgentGroupActivity.start(UdeskChatActivity.this, IM_GROUP_REQUEST_CODE); + return; } - - @Override - public void onTextChanged(CharSequence s, int start, int before, int count) { - try { - if (mInputEditView.getText().toString().trim().length() > 0) { - sendBtn.setVisibility(View.VISIBLE); - mMoreImg.setVisibility(View.GONE); - } else { - sendBtn.setVisibility(View.GONE); - if (!isleaveMessageTypeMsg() || currentStatusIsOnline || isNeedQueueMessageSave()) { - mMoreImg.setVisibility(View.VISIBLE); - } - } - - if (isbolcked.equals("true") || !currentStatusIsOnline || isOverConversation) { - return; - } - if (TextUtils.isEmpty(mInputEditView.getText().toString())) { - mPresenter.sendPreMessage(); - return; - } - long currentTime = System.currentTimeMillis(); - if (currentTime - preMsgSendTime > 500) { - if (mPresenter != null) { - preMsgSendTime = currentTime; - mPresenter.sendPreMessage(); - } - } - } catch (Exception e) { - e.printStackTrace(); - } + initFragment(UdeskConst.CurrentFragment.agent); + udeskViewMode.getRobotApiData().robotTransfer(); + //进入人工客服判断 + if (!isWorkTime()) { + curentStatus = UdeskConst.Status.notWorkingTime; + setTitlebar(getString(R.string.udesk_label_customer_offline), off); + return; } - - @Override - public void afterTextChanged(Editable s) { - + if (!isBlocked(customer)) { + initAgentInfo(); } - }); + } } catch (Exception e) { e.printStackTrace(); } } - - private void showAudioButton() { + //是不是在黑名单 + private boolean isBlocked(Customer customer) { try { - mBtnAudio.setVisibility(View.VISIBLE); - mInputEditView.setVisibility(View.GONE); - mAudioImg.setImageResource(R.drawable.udesk_ic_cheat_keyboard); + //如果客户被加入黑名单 则结束后续流程 + if (customer != null && customer.getIs_blocked()) { + isbolcked = "true"; + bolckedNotice = initCustomer.getBlack_list_notice(); + if (TextUtils.isEmpty(bolckedNotice)) { + bolckedNotice = getString(R.string.add_bolcked_tips); + } + setTitlebar(bolckedNotice, off); + mHandler.postDelayed(new Runnable() { + @Override + public void run() { + toBolckedView(); + } + }, 1500); + return true; + } + } catch (Exception e) { + e.printStackTrace(); + } + return false; + } - if (mBotomFramlayout.isShown()) { - if (mEmotionKeyboard != null) { - mEmotionKeyboard.interceptBackPress(); + private void reFreshMessages(List msgs) { + try { + if (mChatAdapter != null && mListView != null) { + if (UdeskSDKManager.getInstance().getUdeskConfig().commodity != null) { + showCommodity(UdeskSDKManager.getInstance().getUdeskConfig().commodity); } - } else { - if (mEmotionKeyboard != null) { - mEmotionKeyboard.hideSoftInput(); + int selectIndex = msgs.size(); + if (currentMode == UdeskChatActivity.PullEventModel) { + mChatAdapter.listAddEventItems(msgs); + } else if (currentMode == UdeskChatActivity.PullRefreshModel) { + mChatAdapter.listAddItems(msgs, true); + } else { + mChatAdapter.listAddItems(msgs, false); + } + mListView.onRefreshComplete(); + if (currentMode == UdeskChatActivity.InitViewMode || currentMode == UdeskChatActivity.PullEventModel) { + mListView.setSelection(mChatAdapter.getCount()); + } else { + mListView.setSelection(selectIndex); } } } catch (Exception e) { e.printStackTrace(); } + } - private void hideAudioButton() { + + /** + * 根据来源创建底部fragment + * + * @param from + */ + private void initFragment(String from) { try { - mBtnAudio.setVisibility(View.GONE); - mInputEditView.setVisibility(View.VISIBLE); - mAudioImg.setImageResource(R.drawable.udesk_ic_cheat_voice); + FragmentManager fragmentManager = getSupportFragmentManager(); + FragmentTransaction transaction = fragmentManager.beginTransaction(); + if (TextUtils.equals(UdeskConst.CurrentFragment.agent, from)) { + fragment = new UdeskAgentFragment(); + mLlAssociate.setVisibility(View.GONE); + mTitlebar.setRightViewVis(View.GONE); + robotSengMsgCount = 0; + moreMarking = ""; + usefulMap.clear(); + transferMap.clear(); + } else if (TextUtils.equals(UdeskConst.CurrentFragment.robot, from)) { + fragment = new UdeskRobotFragment(); + curentStatus = UdeskConst.Status.robot; + } + transaction.replace(R.id.udesk_fragment_container, fragment).commitNowAllowingStateLoss(); } catch (Exception e) { e.printStackTrace(); } } - private void showEmotionLayout() { + /** + * titlebar 的设置 + */ + private void settingTitlebar() { try { - mEmotionlayout.setVisibility(View.VISIBLE); - mEmojiImg.setImageResource(R.drawable.udesk_ic_cheat_keyboard); + mTitlebar = (UdeskTitleBar) findViewById(R.id.udesktitlebar); + if (mTitlebar != null) { + UdekConfigUtil.setUITextColor(UdeskSDKManager.getInstance().getUdeskConfig().udeskTitlebarMiddleTextResId, mTitlebar.getUdeskTopText(), mTitlebar.getUdeskBottomText()); + UdekConfigUtil.setUITextColor(UdeskSDKManager.getInstance().getUdeskConfig().udeskTitlebarRightTextResId, mTitlebar.getRightTextView()); + if (mTitlebar.getRootView() != null) { + UdekConfigUtil.setUIbgDrawable(UdeskSDKManager.getInstance().getUdeskConfig().udeskTitlebarBgResId, mTitlebar.getRootView()); + } + if (UdeskConfig.DEFAULT != UdeskSDKManager.getInstance().getUdeskConfig().udeskbackArrowIconResId) { + mTitlebar.getUdeskBackImg().setImageResource(UdeskSDKManager.getInstance().getUdeskConfig().udeskbackArrowIconResId); + } + mTitlebar.setTopTextSequence(getString(R.string.udesk_agent_connecting)); + mTitlebar.setLeftLinearVis(View.VISIBLE); + mTitlebar.setLeftViewClick(new OnClickListener() { + @Override + public void onClick(View v) { + finishAcitivty(); + } + }); + //机器转人工 + mTitlebar.setRightViewClick(new OnClickListener() { + @Override + public void onClick(View v) { + autoTransfer(); + } + }); + mTitlebar.setRightViewVis(View.GONE); + } } catch (Exception e) { e.printStackTrace(); } } - private void hideEmotionLayout() { + /** + * 显示顶部商品布局 + * + * @param item + */ + private void showCommodity(final UdeskCommodityItem item) { try { - mEmotionlayout.setVisibility(View.GONE); - mEmojiImg.setImageResource(R.drawable.udesk_ic_cheat_emo); + commodityView.setVisibility(View.VISIBLE); + commodityTitle.setText(item.getTitle()); + commoditySubTitle.setText(item.getSubTitle()); + UdeskUtil.loadNoChangeView(getApplicationContext(), commodityThumbnail, Uri.parse(item.getThumbHttpUrl())); + commodityLink.setOnClickListener(new OnClickListener() { + @Override + public void onClick(View v) { + sentLink(item.getCommodityUrl()); + } + }); } catch (Exception e) { e.printStackTrace(); } } - private void showMoreLayout() { + private void initView() { try { - mMoreLayout.setVisibility(View.VISIBLE); + commodityView = findViewById(R.id.commodity_rl); + commodityView.setVisibility(View.GONE); + commodityThumbnail = (SimpleDraweeView) findViewById(R.id.udesk_im_commondity_thumbnail); + commodityTitle = (TextView) findViewById(R.id.udesk_im_commondity_title); + commoditySubTitle = (TextView) findViewById(R.id.udesk_im_commondity_subtitle); + commodityLink = (TextView) findViewById(R.id.udesk_im_commondity_link); + mListView = findViewById(R.id.udesk_conversation); + expandableLayout = (UdeskExpandableLayout) findViewById(R.id.udesk_change_status_info); + mContentLinearLayout = (LinearLayout) findViewById(R.id.udesk_content_ll); + mRvAssociate = (RecyclerView) findViewById(R.id.udesk_robot_rv_associate); + LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this); + linearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL); + mRvAssociate.setLayoutManager(linearLayoutManager); + mRvAssociate.addItemDecoration(new RecycleViewDivider(this, LinearLayoutManager.HORIZONTAL, UdeskUtil.dip2px(this, 1), getResources().getColor(R.color.udesk_color_d8d8d8), true)); + tipAdapter = new TipAdapter(this); + mRvAssociate.setAdapter(tipAdapter); + mLlAssociate = (LinearLayout) findViewById(R.id.udesk_robot_ll_associate); + popWindow = new UdeskConfirmPopWindow(this); + udeskViewMode.getDbLiveData().initDB(getApplicationContext()); + setListView(); + initLoadData(); + isNeedRelogin = !UdeskUtils.isNetworkConnected(this); } catch (Exception e) { e.printStackTrace(); } + } - private void hideMoreLayout() { + /** + * 是否打开video + * + * @return + */ + private boolean isOpenVideo() { try { - mMoreLayout.setVisibility(View.GONE); + return imSetting != null + && imSetting.getVcall() + && imSetting.getSdk_vcall() + && UdeskUtil.isClassExists("udesk.udeskvideo.UdeskVideoActivity"); } catch (Exception e) { e.printStackTrace(); } + return false; } -// private void closeBottomAndKeyboard() { -// mEmotionlayout.setVisibility(View.GONE); -// mMoreLayout.setVisibility(View.GONE); -// if (mEmotionKeyboard != null) { -// mEmotionKeyboard.interceptBackPress(); -// } -// } - private void setListView() { try { mChatAdapter = new MessageAdatper(this); mListView.setTranscriptMode(ListView.TRANSCRIPT_MODE_ALWAYS_SCROLL); mListView.setAdapter(mChatAdapter); - mListView - .setOnRefreshListener(new UDPullGetMoreListView.OnRefreshListener() { - @Override - public void onRefresh() { - loadHistoryRecords(UdeskChatActivity.PullRefreshModel); - } - }); - - mListView.setRecyclerListener(new AbsListView.RecyclerListener() { - public void onMovedToScrapHeap(View view) { - if (mRecordFilePlay != null) { - checkRecoredView(view); + mListView.setOnRefreshListener(new UDPullGetMoreListView.OnRefreshListener() { + @Override + public void onRefresh() { + // 已经没有更早的数据了 + if (TextUtils.isEmpty(moreMarking)) { + UdeskUtils.showToast(getApplicationContext(), getString(R.string.udesk_no_more_history)); + mListView.onRefreshComplete(); + mListView.setSelection(0); + } else { + currentMode = PullRefreshModel; + udeskViewMode.getApiLiveData().messages(moreMarking); } } }); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void initDatabase() { - try { - runOnUiThread(new Runnable() { + mListView.setRecyclerListener(new AbsListView.RecyclerListener() { @Override - public void run() { - try { - if (UdeskDBManager.getInstance().getSQLiteDatabase() == null) { - UdeskDBManager.getInstance().init(getApplicationContext(), UdeskSDKManager.getInstance().getSdkToken(getApplicationContext())); - } - historyCount = UdeskDBManager.getInstance().getMessageCount(); - loadHistoryRecords(UdeskChatActivity.InitViewMode); - UdeskDBManager.getInstance().updateAllMsgRead(); - } catch (Exception e) { - e.printStackTrace(); + public void onMovedToScrapHeap(View view) { + if (mRecordFilePlay != null) { + checkRecoredView(view); } - } }); } catch (Exception e) { @@ -1192,155 +1278,62 @@ public void run() { } - @Override protected void onResume() { super.onResume(); try { UdeskConst.sdk_page_status = UdeskConst.SDK_PAGE_FOREGROUND; UdeskBaseInfo.isNeedMsgNotice = false; - mInputEditView.clearFocus(); if (TextUtils.isEmpty(LQREmotionKit.getEmotionPath())) { LQREmotionKit.init(getApplicationContext()); } - if (UdeskSDKManager.getInstance().getImSetting() != null && !UdeskSDKManager.getInstance().getImSetting().getIs_worktime()) { + if (!isWorkTime()) { return; } - if (mPresenter != null) { - mPresenter.bindReqsurveyMsg(); - } - if (isInitComplete && !isSurvyOperate && !UdeskMessageManager.getInstance().isConnection()) { - mPresenter.createIMCustomerInfo(); +// if (!isSurvyOperate && !UdeskXmppManager.getInstance().isConnection()) { +// udeskViewMode.getApiLiveData().initCustomer(getApplicationContext()); +// } + if (mAgentInfo != null && isOpenVideo()) { + UdeskUtil.sendVideoMessage(imSetting, mAgentInfo, getApplicationContext()); } - sendVideoMessage(); registerNetWorkReceiver(); } catch (Exception e) { e.printStackTrace(); } } - - @Override - public void onClick(View v) { + //点击拍摄入口 + public void clickCamera() { try { - //检查是否处在可发消息的状态 - if (isbolcked != null && isbolcked.equals("true")) { - toBolckedView(); - return; - } - - if (isMoreTanSendCount() && isNeedQueueMessageSave()) { - UdeskUtils.showToast(getApplicationContext(), - getResources().getString(R.string.udesk_in_the_line_max_send)); - return; - } - - if (!isShowNotSendMsg()) { - mEmotionKeyboard.hideSoftInput(); - return; - } - - if (v.getId() == R.id.udesk_img_audio) { - if (mBtnAudio.isShown()) { - hideAudioButton(); - mInputEditView.requestFocus(); - if (mEmotionKeyboard != null) { - mEmotionKeyboard.showSoftInput(); - } - } else { - if (Build.VERSION.SDK_INT < 23) { - showAudioButton(); - hideEmotionLayout(); - hideMoreLayout(); - } else { - XPermissionUtils.requestPermissions(UdeskChatActivity.this, RequestCode.AUDIO, - new String[]{Manifest.permission.RECORD_AUDIO, - Manifest.permission.WRITE_EXTERNAL_STORAGE}, - new XPermissionUtils.OnPermissionListener() { - @Override - public void onPermissionGranted() { - showAudioButton(); - hideEmotionLayout(); - hideMoreLayout(); - } - - @Override - public void onPermissionDenied(String[] deniedPermissions, boolean alwaysDenied) { - Toast.makeText(UdeskChatActivity.this, - getResources().getString(R.string.aduido_denied), - Toast.LENGTH_SHORT).show(); - } - }); - } + if (Build.VERSION.SDK_INT < 23) { + takePhoto(); + } else { + XPermissionUtils.requestPermissions(UdeskChatActivity.this, RequestCode.CAMERA, + new String[]{Manifest.permission.CAMERA, + Manifest.permission.RECORD_AUDIO, + Manifest.permission.WRITE_EXTERNAL_STORAGE}, + new XPermissionUtils.OnPermissionListener() { + @Override + public void onPermissionGranted() { + takePhoto(); + } - } - } else if (R.id.udesk_bottom_send == v.getId()) { //发送文本消息 - if (TextUtils.isEmpty(mInputEditView.getText().toString())) { - UdeskUtils.showToast(getApplicationContext(), - getString(R.string.udesk_send_message_empty)); - return; - } - if (currentStatusIsOnline || isPresessionStatus || isNeedQueueMessageSave()) { - mPresenter.sendTxtMessage(); - } else if (UdeskSDKManager.getInstance().getImSetting() != null && - UdeskSDKManager.getInstance().getImSetting().getLeave_message_type().equals("msg")) { - if (!isLeavingmsg) { - mPresenter.addCustomerLeavMsg(); - isLeavingmsg = true; - } - mPresenter.sendLeaveMessage(); - } - } else if (R.id.navigation_survy == v.getId()) { - if (isPresessionStatus) { - UdeskUtils.showToast(getApplicationContext(), - getString(R.string.udesk_can_not_be_evaluated)); - return; - } - clickSurvy(); + @Override + public void onPermissionDenied(String[] deniedPermissions, boolean alwaysDenied) { + UdeskUtils.showToast(getApplicationContext(), getResources().getString(R.string.camera_denied)); + } + }); } } catch (Exception e) { e.printStackTrace(); - } catch (OutOfMemoryError error) { - error.printStackTrace(); - } - - } - - - //点击拍摄入口 - private void clickCamera() { - - if (Build.VERSION.SDK_INT < 23) { - takePhoto(); - bottomoPannelBegginStatus(); - } else { - XPermissionUtils.requestPermissions(UdeskChatActivity.this, RequestCode.CAMERA, - new String[]{Manifest.permission.CAMERA, - Manifest.permission.RECORD_AUDIO, - Manifest.permission.WRITE_EXTERNAL_STORAGE}, - new XPermissionUtils.OnPermissionListener() { - @Override - public void onPermissionGranted() { - takePhoto(); - bottomoPannelBegginStatus(); - } - - @Override - public void onPermissionDenied(String[] deniedPermissions, boolean alwaysDenied) { - Toast.makeText(UdeskChatActivity.this, - getResources().getString(R.string.camera_denied), - Toast.LENGTH_SHORT).show(); - } - }); } } //点击相册入口 - private void clickPhoto() { + public void clickPhoto() { try { if (Build.VERSION.SDK_INT < 23) { selectPhoto(); - bottomoPannelBegginStatus(); } else { XPermissionUtils.requestPermissions(UdeskChatActivity.this, RequestCode.EXTERNAL, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, @@ -1348,14 +1341,11 @@ private void clickPhoto() { @Override public void onPermissionGranted() { selectPhoto(); - bottomoPannelBegginStatus(); } @Override public void onPermissionDenied(String[] deniedPermissions, boolean alwaysDenied) { - Toast.makeText(UdeskChatActivity.this, - getResources().getString(R.string.photo_denied), - Toast.LENGTH_SHORT).show(); + UdeskUtils.showToast(getApplicationContext(), getResources().getString(R.string.photo_denied)); } }); } @@ -1365,11 +1355,10 @@ public void onPermissionDenied(String[] deniedPermissions, boolean alwaysDenied) } //点击文件入口 - private void clickFile() { + public void clickFile() { try { if (Build.VERSION.SDK_INT < 23) { selectFile(); - bottomoPannelBegginStatus(); } else { XPermissionUtils.requestPermissions(UdeskChatActivity.this, RequestCode.EXTERNAL, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, @@ -1377,14 +1366,11 @@ private void clickFile() { @Override public void onPermissionGranted() { selectFile(); - bottomoPannelBegginStatus(); } @Override public void onPermissionDenied(String[] deniedPermissions, boolean alwaysDenied) { - Toast.makeText(UdeskChatActivity.this, - getResources().getString(R.string.file_denied), - Toast.LENGTH_SHORT).show(); + UdeskUtils.showToast(getApplicationContext(), getResources().getString(R.string.file_denied)); } }); } @@ -1394,15 +1380,26 @@ public void onPermissionDenied(String[] deniedPermissions, boolean alwaysDenied) } //点击评价入口 - private void clickSurvy() { + public void clickSurvy() { try { - if (mPresenter != null && isPermmitSurvy && mAgentInfo != null) { + if (isPermmitSurvy && mAgentInfo != null && !TextUtils.isEmpty(mAgentInfo.getAgent_id()) && !TextUtils.isEmpty(mAgentInfo.getIm_sub_session_id())) { setIsPermmitSurvy(false); - mPresenter.getHasSurvey(mAgentInfo.getAgent_id(), null); + udeskViewMode.getApiLiveData().getHasSurvey(null); + } else { + UdeskUtils.showToast(getApplicationContext(), getResources().getString(R.string.udesk_survey_error)); + } + } catch (Resources.NotFoundException e) { + e.printStackTrace(); + } + } + + //点击机器人评价入口 + public void clickRobotSurvy() { + try { + if (robotInit != null && 0 != robotInit.getSessionId()) { + udeskViewMode.getRobotApiData().robotSessionHasSurvey(); } else { - Toast.makeText(UdeskChatActivity.this, - getResources().getString(R.string.udesk_survey_error), - Toast.LENGTH_SHORT).show(); + UdeskUtils.showToast(getApplicationContext(), getResources().getString(R.string.udesk_survey_error)); } } catch (Resources.NotFoundException e) { e.printStackTrace(); @@ -1410,7 +1407,7 @@ private void clickSurvy() { } //点击位置入口 - private void clickLocation() { + public void clickLocation() { try { //地理位置信息打开的页面 由客户传入 并通过Activity方式 来传递数据 if (UdeskSDKManager.getInstance().getUdeskConfig().cls != null) { @@ -1470,9 +1467,7 @@ public void onPermissionGranted() { @Override public void onPermissionDenied(String[] deniedPermissions, boolean alwaysDenied) { - Toast.makeText(UdeskChatActivity.this, - getResources().getString(R.string.call_denied), - Toast.LENGTH_SHORT).show(); + UdeskUtils.showToast(getApplicationContext(), getResources().getString(R.string.call_denied)); } }); } @@ -1490,7 +1485,11 @@ public void onEmojiSelected(String key) { @Override public void onStickerSelected(String categoryName, String stickerName, String bitmapPath) { try { - mPresenter.sendFileMessage(bitmapPath, UdeskConst.ChatMsgTypeString.TYPE_IMAGE); + if (curentStatus != UdeskConst.Status.robot) { + udeskViewMode.sendFileMessage(bitmapPath, UdeskConst.ChatMsgTypeString.TYPE_IMAGE); + } else { + UdeskUtils.showToast(getApplicationContext(), "暂不支持"); + } } catch (Exception e) { e.printStackTrace(); } @@ -1501,20 +1500,20 @@ public void onStickerSelected(String categoryName, String stickerName, String bi public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); try { - if (isMoreTanSendCount() && isNeedQueueMessageSave()) { + if (isMoreThan20 && isNeedQueueMessageSave()) { UdeskUtils.showToast(getApplicationContext(), getMoreThanSendTip()); return; } if (CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE == requestCode) { //拍照后发生图片 if (Activity.RESULT_OK == resultCode) { - if (mPresenter != null && photoUri != null && photoUri.getPath() != null) { + if (photoUri != null && photoUri.getPath() != null) { if (UdeskSDKManager.getInstance().getUdeskConfig().isScaleImg) { - mPresenter.scaleBitmap(UdeskUtil.parseOwnUri(photoUri, UdeskChatActivity.this, cameraFile)); + udeskViewMode.scaleBitmap(UdeskUtil.parseOwnUri(photoUri, UdeskChatActivity.this, cameraFile), getApplicationContext()); } else { - mPresenter.sendFileMessage(UdeskUtil.parseOwnUri(photoUri, UdeskChatActivity.this, cameraFile), UdeskConst.ChatMsgTypeString.TYPE_IMAGE); + udeskViewMode.sendFileMessage(UdeskUtil.parseOwnUri(photoUri, UdeskChatActivity.this, cameraFile), UdeskConst.ChatMsgTypeString.TYPE_IMAGE); } - } else if (data != null && data.hasExtra("data") && data.getParcelableExtra("data") != null && data.getParcelableExtra("data") instanceof Bitmap && mPresenter != null) { - mPresenter.sendBitmapMessage((Bitmap) data.getParcelableExtra("data")); + } else if (data != null && data.hasExtra("data") && data.getParcelableExtra("data") != null && data.getParcelableExtra("data") instanceof Bitmap) { + udeskViewMode.sendBitmapMessage((Bitmap) data.getParcelableExtra("data"), getApplicationContext()); } } @@ -1531,10 +1530,10 @@ public void onActivityResult(int requestCode, int resultCode, Intent data) { String type = bundle.getString(UdeskConst.SEND_SMALL_VIDEO); if (type.equals(UdeskConst.SMALL_VIDEO)) { String path = bundle.getString(UdeskConst.PREVIEW_Video_Path); - mPresenter.sendFileMessage(path, UdeskConst.ChatMsgTypeString.TYPE_VIDEO); + udeskViewMode.sendFileMessage(path, UdeskConst.ChatMsgTypeString.TYPE_SHORT_VIDEO); } else if (type.equals(UdeskConst.PICTURE)) { String path = bundle.getString(UdeskConst.BitMapData); - mPresenter.sendFileMessage(path, UdeskConst.ChatMsgTypeString.TYPE_IMAGE); + udeskViewMode.sendFileMessage(path, UdeskConst.ChatMsgTypeString.TYPE_IMAGE); } } @@ -1550,18 +1549,18 @@ public void onActivityResult(int requestCode, int resultCode, Intent data) { for (LocalMedia media : localMedias) { final String pictureType = media.getPictureType(); final int mediaMimeType = UdeskUtil.isPictureType(pictureType); - if (mediaMimeType == UdeskUtil.TYPE_VIDEO) { + if (mediaMimeType == UdeskUtil.TYPE_SHORT_VIDEO) { double size = UdeskUtils.getFileSize(new File(media.getPath())); if (size >= 30 * 1024 * 1024) { - Toast.makeText(getApplicationContext(), getString(R.string.udesk_file_to_large), Toast.LENGTH_SHORT).show(); + UdeskUtils.showToast(getApplicationContext(), getResources().getString(R.string.udesk_file_to_large)); break; } - mPresenter.sendFileMessage(media.getPath(), UdeskConst.ChatMsgTypeString.TYPE_VIDEO); + udeskViewMode.sendFileMessage(media.getPath(), UdeskConst.ChatMsgTypeString.TYPE_SHORT_VIDEO); } else if (mediaMimeType == UdeskUtil.TYPE_IMAGE) { if (isOrgin) { - mPresenter.sendFileMessage(media.getPath(), UdeskConst.ChatMsgTypeString.TYPE_IMAGE); + udeskViewMode.sendFileMessage(media.getPath(), UdeskConst.ChatMsgTypeString.TYPE_IMAGE); } else { - mPresenter.scaleBitmap(media.getPath()); + udeskViewMode.scaleBitmap(media.getPath(), getApplicationContext()); } } } @@ -1577,9 +1576,9 @@ public void onActivityResult(int requestCode, int resultCode, Intent data) { if (mImageCaptureUri != null) { String path = UdeskUtil.getFilePath(this, mImageCaptureUri); if (UdeskSDKManager.getInstance().getUdeskConfig().isScaleImg) { - mPresenter.scaleBitmap(path); + udeskViewMode.scaleBitmap(path, getApplicationContext()); } else { - mPresenter.sendFileMessage(path, UdeskConst.ChatMsgTypeString.TYPE_IMAGE); + udeskViewMode.sendFileMessage(path, UdeskConst.ChatMsgTypeString.TYPE_IMAGE); } } @@ -1593,10 +1592,7 @@ public void onActivityResult(int requestCode, int resultCode, Intent data) { if (extras != null) { Bitmap bitmap = extras.getParcelable("data"); if (bitmap != null) { - if (mPresenter != null) { - mPresenter.sendBitmapMessage(bitmap); - } - + udeskViewMode.sendBitmapMessage(bitmap, getApplicationContext()); } } } @@ -1633,10 +1629,23 @@ public void onActivityResult(int requestCode, int resultCode, Intent data) { String bitmapDir = data.getStringExtra(UdeskConfig.UdeskMapIntentName.BitmapDIR); double latitude = data.getDoubleExtra(UdeskConfig.UdeskMapIntentName.Latitude, 0.0); double longitude = data.getDoubleExtra(UdeskConfig.UdeskMapIntentName.Longitude, 0.0); + if (udeskViewMode != null) { + udeskViewMode.sendLocationMessage(latitude, longitude, postionValue, bitmapDir); + } + + } else if (IM_GROUP_REQUEST_CODE == requestCode) { + if (resultCode == Activity.RESULT_OK || data != null) { + initFragment(UdeskConst.CurrentFragment.agent); + udeskViewMode.getRobotApiData().robotTransfer(); + menuId = data.getStringExtra(UdeskConst.UDESKMENUID); + if (!TextUtils.isEmpty(menuId)) { + PreferenceHelper.write(this, UdeskConst.SharePreParams.Udesk_Sharepre_Name, + UdeskConst.SharePreParams.Udesk_Menu_Id, menuId); + } + udeskViewMode.getApiLiveData().setMenu_id(getMenuId()); + initAgentInfo(); - mPresenter.sendLocationMessage(latitude, longitude, postionValue, bitmapDir); - - + } } } catch (Exception e) { e.printStackTrace(); @@ -1651,13 +1660,13 @@ private void sendFile(String path) { try { double size = UdeskUtils.getFileSize(new File(path)); if (size >= 30 * 1024 * 1024) { - Toast.makeText(getApplicationContext(), getString(R.string.udesk_file_to_large), Toast.LENGTH_SHORT).show(); + UdeskUtils.showToast(getApplicationContext(), getResources().getString(R.string.udesk_file_to_large)); return; } - if (path.contains(".mp4") && mPresenter != null) { - mPresenter.sendFileMessage(path, UdeskConst.ChatMsgTypeString.TYPE_VIDEO); + if (path.contains(".mp4")) { + udeskViewMode.sendFileMessage(path, UdeskConst.ChatMsgTypeString.TYPE_SHORT_VIDEO); } else { - mPresenter.sendFileMessage(path, UdeskConst.ChatMsgTypeString.TYPE_File); + udeskViewMode.sendFileMessage(path, UdeskConst.ChatMsgTypeString.TYPE_File); } } catch (Exception e) { e.printStackTrace(); @@ -1666,26 +1675,25 @@ private void sendFile(String path) { } } - @Override + public void initLoadData() { try { offset = -1; historyCount = UdeskDBManager.getInstance().getMessageCount(); - loadHistoryRecords(UdeskChatActivity.InitViewMode); + currentMode = InitViewMode; + loadHistoryRecords(); } catch (Exception e) { e.printStackTrace(); } } - @Override public int getAgentSeqNum() { - try { if (mChatAdapter != null) { List listMessages = mChatAdapter.getList(); for (int i = listMessages.size() - 1; i > 0; i--) { MessageInfo messageUI = listMessages.get(i); - if (messageUI.getDirection() == UdeskConst.ChatMsgDirection.Recv) { + if (messageUI.getDirection() == UdeskConst.ChatMsgDirection.Recv && TextUtils.equals(UdeskConst.Sender.agent, messageUI.getSender())) { return messageUI.getSeqNum(); } } @@ -1700,13 +1708,12 @@ public int getAgentSeqNum() { /** * 读取数据库中的历史数据 */ - private void loadHistoryRecords(int mode) { + private void loadHistoryRecords() { try { mListView.setTranscriptMode(ListView.TRANSCRIPT_MODE_NORMAL); // 已经没有更早的数据了 if (offset == 0) { - UdeskUtils.showToast(this, - getString(R.string.udesk_no_more_history)); + UdeskUtils.showToast(getApplicationContext(), getString(R.string.udesk_no_more_history)); mListView.onRefreshComplete(); mListView.setSelection(0); } else { @@ -1721,15 +1728,7 @@ private void loadHistoryRecords(int mode) { offset = offset - UdeskConst.UDESK_HISTORY_COUNT; } offset = (offset < 0 ? 0 : offset); - List list = UdeskDBManager.getInstance().getMessages( - offset, pageNum); - if (list != null) { - Message msg = Message.obtain(); - msg.what = MessageWhat.loadHistoryDBMsg; - msg.arg1 = mode; - msg.obj = list; - mHandler.sendMessage(msg); - } + udeskViewMode.getDbLiveData().getHistoryMessage(offset, pageNum); } } catch (Exception e) { e.printStackTrace(); @@ -1745,7 +1744,7 @@ private void showOnlieStatus(AgentInfo mAgentInfo) { if (mAgentInfo == null || !currentStatusIsOnline) { return; } - setTitlebar(mAgentInfo.getAgentNick(), "on"); + setTitlebar(mAgentInfo.getAgentNick(), on); } catch (Exception e) { e.printStackTrace(); } @@ -1755,8 +1754,8 @@ private void showOnlieStatus(AgentInfo mAgentInfo) { //发送广告消息 private void sendCommodityMsg(UdeskCommodityItem commodity) { try { - if (commodity != null && mPresenter != null) { - mPresenter.sendCommodityMessage(commodity); + if (commodity != null && udeskViewMode != null) { + udeskViewMode.sendCommodityMessage(commodity); } } catch (Exception e) { @@ -1766,11 +1765,11 @@ private void sendCommodityMsg(UdeskCommodityItem commodity) { } } + //发送商品信息 private void sendProduct(Product product) { try { - if (product != null && mPresenter != null) { - mPresenter.sendProductMessage(product); - + if (product != null && udeskViewMode != null) { + udeskViewMode.sendProductMessage(product); } } catch (Exception e) { e.printStackTrace(); @@ -1782,8 +1781,8 @@ private void sendProduct(Product product) { //客户设置的第一句默认消息 private void sendDefualtMessage() { try { - if (!TextUtils.isEmpty(UdeskSDKManager.getInstance().getUdeskConfig().firstMessage) && mPresenter != null) { - mPresenter.sendTxtMessage(UdeskSDKManager.getInstance().getUdeskConfig().firstMessage); + if (!TextUtils.isEmpty(UdeskSDKManager.getInstance().getUdeskConfig().firstMessage)) { + udeskViewMode.sendTxtMessage(UdeskSDKManager.getInstance().getUdeskConfig().firstMessage); } } catch (Exception e) { e.printStackTrace(); @@ -1857,16 +1856,16 @@ private void selectFile() { //启动满意度调查 - private void toLuanchSurveyView(SurveyOptionsModel surveyOptions) { + private void toLaunchSurveyView(SurveyOptionsModel surveyOptions) { try { - setIsPermmitSurvy(true); if (surveyOptions.getOptions() == null || surveyOptions.getOptions().isEmpty() || surveyOptions.getType().isEmpty()) { - UdeskUtils.showToast(this, - getString(R.string.udesk_no_set_survey)); + UdeskUtils.showToast(getApplicationContext(), getString(R.string.udesk_no_set_survey)); return; } - showSurveyPopWindow(surveyOptions); + if (udeskSurvyPopwindow == null || !udeskSurvyPopwindow.isShowing()) { + showSurveyPopWindow(surveyOptions); + } } catch (Exception e) { e.printStackTrace(); } @@ -1874,17 +1873,34 @@ private void toLuanchSurveyView(SurveyOptionsModel surveyOptions) { WindowManager.LayoutParams params; + /** + * 显示满意度调查 + * + * @param surveyOptions + */ private void showSurveyPopWindow(SurveyOptionsModel surveyOptions) { try { - UdeskSurvyPopwindow udeskSurvyPopwindow = new UdeskSurvyPopwindow(this, surveyOptions, new UdeskSurvyPopwindow.SumbitSurvyCallBack() { - + udeskSurvyPopwindow = new UdeskSurvyPopwindow(this, surveyOptions, new UdeskSurvyPopwindow.SumbitSurvyCallBack() { @Override - public void sumbitSurvyCallBack(String optionId, String show_type, String survey_remark, String tags) { - mPresenter.putIMSurveyResult(optionId, show_type, survey_remark, tags); + public void sumbitSurvyCallBack(boolean isRobot, String optionId, String show_type, String survey_remark, String tags) { + if (isRobot) { + udeskViewMode.getRobotApiData().robotSessionSurvey(UdeskUtils.toInt(optionId), survey_remark); + } else { + if (TextUtils.isEmpty(customerId) || TextUtils.isEmpty(mAgentInfo.getAgent_id())) { + isPermmitSurvy = false; + return; + } + udeskViewMode.getApiLiveData().putIMSurveyResult(optionId, show_type, survey_remark, tags); + } } + }); - if (findViewById(R.id.udesk_im_content).getWindowToken() != null) { + if (!udeskSurvyPopwindow.isShowing() && + this.getWindow() != null && + this.getWindow().getDecorView() != null && + this.getWindow().getDecorView().getWindowToken() != null && + findViewById(R.id.udesk_im_content).getWindowToken() != null) { udeskSurvyPopwindow.showAtLocation(findViewById(R.id.udesk_im_content), Gravity.BOTTOM | Gravity.CENTER_HORIZONTAL, 0, 0); params = getWindow().getAttributes(); params.alpha = 0.7f; @@ -1904,7 +1920,7 @@ public void onDismiss() { } //显示黑名单提示框 - private void toBolckedView() { + public void toBolckedView() { try { String positiveLabel = this.getString(R.string.udesk_sure); @@ -1918,6 +1934,7 @@ private void toBolckedView() { popWindow.show(this, this.getWindow().getDecorView(), positiveLabel, negativeLabel, title, new OnPopConfirmClick() { + @Override public void onPositiveClick() { finish(); } @@ -1958,6 +1975,13 @@ public void run() { } } + /** + * 非wifi网络提示框 + * + * @param isupload + * @param info + * @param path + */ private void toGpsNetView(final boolean isupload, final MessageInfo info, final String path) { try { String positiveLabel = this.getString(R.string.udesk_sure); @@ -1976,13 +2000,14 @@ private void toGpsNetView(final boolean isupload, final MessageInfo info, final popWindow.show(this, this.getWindow().getDecorView(), positiveLabel, negativeLabel, content, new OnPopConfirmClick() { + @Override public void onPositiveClick() { try { if (isupload && !TextUtils.isEmpty(path)) { sendFile(path); } - if (!isupload && info != null && mPresenter != null) { - mPresenter.downFile(info); + if (!isupload && info != null) { + udeskViewMode.getFileLiveData().downFile(info, getApplicationContext()); } } catch (Exception e) { e.printStackTrace(); @@ -2015,9 +2040,7 @@ public void toWebViewAcivity(String mUrl) { @Override public void run() { try { - if (mPresenter != null) { - mPresenter.getAgentInfo(pre_session_id, null); - } + udeskViewMode.getApiLiveData().getAgentInfo(pre_session_id, null); } catch (Exception e) { e.printStackTrace(); } @@ -2028,18 +2051,19 @@ public void run() { private void checkRecoredView(View view) { try { Object tag = view.getTag(); - if (tag == null || !(tag instanceof AudioViewHolder)) { - return; - } - - AudioViewHolder holder = (AudioViewHolder) tag; - final RecordFilePlay recordFilePlay = mRecordFilePlay; - if (recordFilePlay != null) { - String path = recordFilePlay.getMediaPath(); - if (path != null - && (path.equalsIgnoreCase(holder.message.getLocalPath()) || path - .equalsIgnoreCase(holder.message.getMsgContent()))) { - recordFilePlay.recycleCallback(); + if (tag != null) { + BaseViewHolder holder = (BaseViewHolder) tag; + if (holder.message != null && + UdeskConst.parseTypeForMessage(holder.message.getMsgtype()) == UdeskConst.ChatMsgTypeInt.TYPE_AUDIO) { + final RecordFilePlay recordFilePlay = mRecordFilePlay; + if (recordFilePlay != null) { + String path = recordFilePlay.getMediaPath(); + if (path != null + && (path.equalsIgnoreCase(holder.message.getLocalPath()) || path + .equalsIgnoreCase(holder.message.getMsgContent()))) { + recordFilePlay.recycleCallback(); + } + } } } } catch (Exception e) { @@ -2121,67 +2145,25 @@ private void changeFileProgress(String msgId, int precent, long fileSize, boolea } } - - // 判断可发送消息 - private boolean isShowNotSendMsg() { + /** + * 重新创建会话 + */ + public void reCreateIMCustomerInfo() { try { - - if (!UdeskUtils.isNetworkConnected(this)) { - UdeskUtils.showToast(getApplicationContext(), - getResources().getString(R.string.udesk_has_wrong_net)); - return false; - } - - if (isMoreTanSendCount() && isNeedQueueMessageSave()) { - UdeskUtils.showToast(getApplicationContext(), - getResources().getString(R.string.udesk_in_the_line_max_send)); - return false; - } - - if (!isInitComplete) { - UdeskUtils.showToast(getApplicationContext(), - getResources().getString(R.string.udesk_agent_inti)); - return false; - } - - if (!TextUtils.isEmpty(pre_session_id)) { - return true; - } - if (isNeedQueueMessageSave()) { - return true; - } - if (isOverConversation) { - reCreateIMCustomerInfo(); - return false; - } - if (!currentStatusIsOnline && !isleaveMessageTypeMsg()) { - confirmToForm(); - return false; - } + UdeskUtils.showToast(getApplicationContext(), getResources().getString(R.string.udesk_agent_inti)); + curentStatus = UdeskConst.Status.init; + udeskViewMode.getApiLiveData().initCustomer(getApplicationContext()); } catch (Exception e) { e.printStackTrace(); } - return true; - } - - /** - * 重新创建会话 - */ - private void reCreateIMCustomerInfo() { - UdeskUtils.showToast(getApplicationContext(), - getResources().getString(R.string.udesk_agent_inti)); - isInitComplete = false; - isOverConversation = false; - mPresenter.createIMCustomerInfo(); } private boolean isOpenLeaveMsg() { boolean isOpen = false; try { - SDKIMSetting imsetting = UdeskSDKManager.getInstance().getImSetting(); - if (imsetting != null) { - isOpen = imsetting.getEnable_web_im_feedback(); + if (imSetting != null) { + isOpen = imSetting.getEnable_web_im_feedback(); } } catch (Exception e) { e.printStackTrace(); @@ -2190,13 +2172,12 @@ private boolean isOpenLeaveMsg() { } //弹出表单留言的提示框 - private void confirmToForm() { + public void confirmToForm() { try { boolean isOpen; - SDKIMSetting imsetting = UdeskSDKManager.getInstance().getImSetting(); //是否弹出表单: 如果获取到管理员的配置,使用管理员的配置。没获取到则使用配置中默认设置 - if (imsetting != null) { - isOpen = imsetting.getEnable_web_im_feedback(); + if (imSetting != null) { + isOpen = imSetting.getEnable_web_im_feedback(); } else { isOpen = UdeskSDKManager.getInstance().getUdeskConfig().isUserForm; } @@ -2211,15 +2192,15 @@ private void confirmToForm() { String negativeLabel = this.getString(R.string.udesk_cancel); String title; if (isOpen) { - if (imsetting != null && !TextUtils.isEmpty(imsetting.getLeave_message_guide())) { - title = imsetting.getLeave_message_guide(); + if (imSetting != null && !TextUtils.isEmpty(imSetting.getLeave_message_guide())) { + title = imSetting.getLeave_message_guide(); } else { title = this.getString(R.string.udesk_msg_offline_to_form); } } else { //关闭留言的文案,如果获取到后台的设置,则使用后台的设置,没获取的后台的,本地客户设置了,则使用客户的设置文案。否则用默认的文案 - if (imsetting != null && !TextUtils.isEmpty(imsetting.getNo_reply_hint())) { - title = imsetting.getNo_reply_hint(); + if (imSetting != null && !TextUtils.isEmpty(imSetting.getNo_reply_hint())) { + title = imSetting.getNo_reply_hint(); } else { title = this.getString(R.string.udesk_msg_busy_default_to_form); } @@ -2239,6 +2220,7 @@ private void confirmToForm() { popWindow.show(this, this.getWindow().getDecorView(), finalPositiveLabel, negativeLabel, title, new OnPopConfirmClick() { + @Override public void onPositiveClick() { try { dismissFormWindow(); @@ -2290,25 +2272,23 @@ public void toWebViewAcivity(String mUrl) { public void leaveMessage() { try { + curentStatus = UdeskConst.Status.leaveMessage; if (UdeskSDKManager.getInstance().getUdeskConfig().formCallBack != null) { UdeskSDKManager.getInstance().getUdeskConfig().formCallBack.toLuachForm(UdeskChatActivity.this); return; } if (isleaveMessageTypeMsg()) { //直接留言 - isInTheQueue = false; if (mAgentInfo != null) { mAgentInfo = null; } if (mHandler != null && myRunnable != null) { mHandler.removeCallbacks(myRunnable); } - if (mPresenter != null) { - mPresenter.quitQuenu(UdeskConfig.UdeskQuenuFlag.FORCE_QUIT); - mPresenter.addLeavMsgWeclome(UdeskSDKManager.getInstance().getImSetting().getLeave_message_guide()); - } + udeskViewMode.getApiLiveData().quitQuenu(UdeskConfig.UdeskQuenuFlag.FORCE_QUIT); + addWeclomeMessage(); setUdeskImContainerVis(View.GONE); - setTitlebar(getString(R.string.udesk_ok), "off"); + setTitlebar(getString(R.string.udesk_ok), off); } else { goToForm(); @@ -2335,44 +2315,12 @@ private void dismissFormWindow() { } } - - @Override - public Context getContext() { - return this; - } - - @Override - public CharSequence getInputContent() { - if (mInputEditView != null) { - return mInputEditView.getText(); - } - return ""; - } - - @Override - public void clearInputContent() { - if (mInputEditView != null) { - mInputEditView.setText(""); - } - } - - @Override public void showFailToast(final String failMsg) { - try { - this.runOnUiThread(new Runnable() { - - @Override - public void run() { - isInitComplete = true; - isInTheQueue = false; - setTitlebar(getResources().getString( - R.string.udesk_api_error), "off"); - if (!TextUtils.isEmpty(failMsg)) { - UdeskUtils.showToast(UdeskChatActivity.this, failMsg); - } - } - }); + setTitlebar(getResources().getString(R.string.udesk_api_error), off); + if (!TextUtils.isEmpty(failMsg)) { + UdeskUtils.showToast(getApplicationContext(), failMsg); + } } catch (Exception e) { e.printStackTrace(); } catch (OutOfMemoryError error) { @@ -2380,33 +2328,17 @@ public void run() { } } - @Override - public void updatePreSessionStatus(String pre_session_id) { - isInitComplete = true; - if (TextUtils.isEmpty(pre_session_id)) { - this.pre_session_id = ""; - isPresessionStatus = false; - } else { - this.pre_session_id = pre_session_id; - isPresessionStatus = true; - } - - } - - - @Override - public boolean getPressionStatus(MessageInfo msg) { + public boolean getPressionStatus() { try { - if (isPresessionStatus || isOverConversation) { - JSONObject preMessage = JsonObjectUtils.buildPreSessionInfo(msg.getMsgtype(), msg.getMsgContent(), msg.getMsgId(), - msg.getDuration(), pre_session_id, msg.getFilename(), msg.getFilesize()); - mPresenter.getAgentInfo(pre_session_id, preMessage); + if (curentStatus.equals(UdeskConst.Status.pre_session) || curentStatus.equals(UdeskConst.Status.robot) + || (curentStatus.equals(UdeskConst.Status.init) && initCustomer.getPre_session().getShow_pre_session() && initCustomer.getPre_session().getPre_session()) + ) { return true; } } catch (Exception e) { e.printStackTrace(); } - return isPresessionStatus; + return false; } /** @@ -2414,160 +2346,153 @@ public boolean getPressionStatus(MessageInfo msg) { * * @param agentInfo */ - @Override - public void dealAgentInfo(final AgentInfo agentInfo) { + public void dealAgentInfo(final AgentInfo agentInfo, boolean isRedirect) { try { - isInitComplete = true; if (agentInfo == null) { return; } switch (agentInfo.getAgentCode()) { case UdeskConst.AgentReponseCode.NoAgent: - Message msgNoAgent = mHandler.obtainMessage(MessageWhat.NoAgent); - msgNoAgent.obj = agentInfo; - mHandler.sendMessage(msgNoAgent); + curentStatus = UdeskConst.Status.noAgent; + dismissFormWindow(); + udeskViewMode.sendPrefilterMsg(false); + if (isleaveMessageTypeMsg()) { + addWeclomeMessage(); + setUdeskImContainerVis(View.GONE); + setTitlebar(getString(R.string.udesk_ok), off); + } else { + mAgentInfo = agentInfo; + setTitlebar(getString(R.string.udesk_label_customer_offline), off); + delayShowtips(mHandler); + } + if (queueItem != null && mChatAdapter != null) { + mChatAdapter.removeQueueMessage(queueItem); + queueItem = null; + mListView.smoothScrollToPosition(mChatAdapter.getCount()); + } break; case UdeskConst.AgentReponseCode.HasAgent: + curentStatus = UdeskConst.Status.chatting; // 有客服titlebar上显示 UdeskDBManager.getInstance().addAgentInfo(agentInfo); - Message msgHasAgent = mHandler.obtainMessage(MessageWhat.HasAgent); - msgHasAgent.obj = agentInfo; - mHandler.sendMessage(msgHasAgent); - break; - case UdeskConst.AgentReponseCode.WaitAgent: - Message msgWaitAgent = mHandler - .obtainMessage(MessageWhat.WaitAgent); - msgWaitAgent.obj = agentInfo; - mHandler.sendMessage(msgWaitAgent); - break; - case UdeskConst.AgentReponseCode.NonExistentAgent: - runOnUiThread(new Runnable() { - @Override - public void run() { - Toast.makeText(UdeskChatActivity.this, getString(R.string.udesk_nonexistent_agent), Toast.LENGTH_SHORT).show(); + mAgentInfo = agentInfo; + udeskViewMode.setAgentInfo(mAgentInfo); + if (!isRedirect) { + dismissFormWindow(); + setUdeskImContainerVis(View.VISIBLE); + setNavigationViewVis(); + initfunctionItems(); + if (queueItem != null && mChatAdapter != null) { + mChatAdapter.removeQueueMessage(queueItem); + queueItem = null; + mListView.smoothScrollToPosition(mChatAdapter.getCount()); } - }); - break; - case UdeskConst.AgentReponseCode.NonExistentGroupId: - runOnUiThread(new Runnable() { - @Override - public void run() { - Toast.makeText(UdeskChatActivity.this, getString(R.string.udesk_nonexistent_groupId), Toast.LENGTH_SHORT).show(); + udeskViewMode.sendPrefilterMsg(true); + if (!hasSendCommodity) { + hasSendCommodity = true; + sendCommodityMsg(UdeskSDKManager.getInstance().getUdeskConfig().commodity); + sendProduct(UdeskSDKManager.getInstance().getUdeskConfig().mProduct); } - }); - break; - - default: - break; - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - /** - * 处理请求转移客服获取到客服信息 - * - * @param agentInfo - */ - @Override - public void dealRedirectAgentInfo(AgentInfo agentInfo) { - try { - isInitComplete = true; - if (agentInfo == null) { - return; - } - switch (agentInfo.getAgentCode()) { - case UdeskConst.AgentReponseCode.NoAgent: - Message msgNoAgent = mHandler.obtainMessage(MessageWhat.NoAgent); - msgNoAgent.obj = agentInfo; - mHandler.sendMessage(msgNoAgent); - break; - case UdeskConst.AgentReponseCode.HasAgent: - String redirectTip = getString(R.string.udesk_transfer_success) + agentInfo.getAgentNick() + getString(R.string.udesk_service); - if (redirectMsg != null) { - redirectMsg.setMsgContent(redirectTip); - UdeskDBManager.getInstance().addMessageInfo(redirectMsg); + if (!hasSendFirstMessage) { + hasSendFirstMessage = true; + sendDefualtMessage(); + } + } else { + String redirectTip = getString(R.string.udesk_transfer_success) + agentInfo.getAgentNick() + getString(R.string.udesk_service); + if (redirectMsg != null) { + redirectMsg.setMsgContent(redirectTip); + UdeskDBManager.getInstance().addMessageInfo(redirectMsg); + } + if (mChatAdapter != null) { + mChatAdapter.addItem(redirectMsg); + mListView.smoothScrollToPosition(mChatAdapter.getCount()); + } + } + currentStatusIsOnline = true; + showOnlieStatus(mAgentInfo); + if (mAgentInfo != null && isOpenVideo()) { + UdeskUtil.sendVideoMessage(imSetting, mAgentInfo, getApplicationContext()); } + break; + case UdeskConst.AgentReponseCode.WaitAgent: + curentStatus = UdeskConst.Status.queuing; mAgentInfo = agentInfo; - UdeskDBManager.getInstance().addAgentInfo(mAgentInfo); - Message msgHasRedirect = mHandler.obtainMessage(MessageWhat.redirectSuccess); - msgHasRedirect.obj = redirectMsg; - mHandler.sendMessage(msgHasRedirect); + setTitlebar(getApplicationContext().getResources().getString(R.string.udesk_in_the_line), queue); + setUdeskImContainerVis(View.VISIBLE); + mHandler.postDelayed(myRunnable, QUEUE_RETEY_TIME); + udeskViewMode.sendPrefilterMsg(true); + if (!hasSendCommodity) { + hasSendCommodity = true; + sendCommodityMsg(UdeskSDKManager.getInstance().getUdeskConfig().commodity); + sendProduct(UdeskSDKManager.getInstance().getUdeskConfig().mProduct); + } + if (!hasSendFirstMessage) { + hasSendFirstMessage = true; + sendDefualtMessage(); + } + if (queueItem == null) { + queueItem = new UdeskQueueItem(isOpenLeaveMsg(), mAgentInfo.getMessage()); + if (mChatAdapter != null) { + mChatAdapter.addItem(queueItem); + mListView.smoothScrollToPosition(mChatAdapter.getCount()); + } + } else { + queueItem.setQueueContent(mAgentInfo.getMessage()); + mChatAdapter.notifyDataSetChanged(); + } break; - case UdeskConst.AgentReponseCode.WaitAgent: - Message msgWaitAgent = mHandler - .obtainMessage(MessageWhat.WaitAgent); - msgWaitAgent.obj = agentInfo; - mHandler.sendMessage(msgWaitAgent); + case UdeskConst.AgentReponseCode.NonExistentAgent: + UdeskUtils.showToast(getApplicationContext(), getResources().getString(R.string.udesk_nonexistent_agent)); + break; + case UdeskConst.AgentReponseCode.NonExistentGroupId: + UdeskUtils.showToast(getApplicationContext(), getResources().getString(R.string.udesk_nonexistent_groupId)); break; + default: break; } } catch (Exception e) { e.printStackTrace(); } - } - - @Override - public void addMessage(MessageInfo message) { + public String getAgentId() { try { - Message msgWaitAgent = mHandler - .obtainMessage(MessageWhat.refreshAdapter); - msgWaitAgent.obj = message; - mHandler.sendMessage(msgWaitAgent); + if (TextUtils.isEmpty(agentId)) { + return PreferenceHelper.readString(this, UdeskConst.SharePreParams.Udesk_Sharepre_Name, + UdeskConst.SharePreParams.Udesk_Agent_Id); + } } catch (Exception e) { e.printStackTrace(); } - } - - @Override - public AgentInfo getAgentInfo() { - if (mAgentInfo != null) { - return mAgentInfo; - } - return new AgentInfo(); - } - - @Override - public void setAgentInfo(AgentInfo agentInfo) { - mAgentInfo = agentInfo; - } - - @Override - public Handler getHandler() { - return mHandler; - } - - - @Override - public String getAgentId() { - if (TextUtils.isEmpty(agentId)) { - return PreferenceHelper.readString(this, UdeskConst.SharePreParams.Udesk_Sharepre_Name, - UdeskConst.SharePreParams.Udesk_Agent_Id); - } return agentId; } - - @Override public String getGroupId() { - if (TextUtils.isEmpty(groupId)) { - return PreferenceHelper.readString(this, UdeskConst.SharePreParams.Udesk_Sharepre_Name, - UdeskConst.SharePreParams.Udesk_Group_Id); + try { + if (TextUtils.isEmpty(groupId)) { + return PreferenceHelper.readString(this, UdeskConst.SharePreParams.Udesk_Sharepre_Name, + UdeskConst.SharePreParams.Udesk_Group_Id); + } + } catch (Exception e) { + e.printStackTrace(); } return groupId; } - @Override - public void changgeiSSurvyOperate() { - isSurvyOperate = true; + public String getMenuId() { + try { + if (TextUtils.isEmpty(menuId)) { + return PreferenceHelper.readString(this, UdeskConst.SharePreParams.Udesk_Sharepre_Name, + UdeskConst.SharePreParams.Udesk_Menu_Id); + } + } catch (Exception e) { + e.printStackTrace(); + } + return menuId; } - @Override public void setIsPermmitSurvy(boolean isPermmit) { try { isPermmitSurvy = isPermmit; @@ -2616,23 +2541,25 @@ public void run() { } for (int i = 0, count = mListView.getChildCount(); i < count; i++) { View child = mListView.getChildAt(i); - if (child == null || child.getTag() == null - || !(child.getTag() instanceof AudioViewHolder)) { + if (child == null || child.getTag() == null) { continue; } - AudioViewHolder holder = (AudioViewHolder) child.getTag(); + BaseViewHolder holder = (BaseViewHolder) child.getTag(); MessageInfo msgTemp = holder.message; - holder.endAnimationDrawable(); - if (msgTemp != info) { - } else { - if (isstart) { - holder.startAnimationDrawable(); + if (msgTemp != null && + UdeskConst.parseTypeForMessage(msgTemp.getMsgtype()) == UdeskConst.ChatMsgTypeInt.TYPE_AUDIO) { + holder.endAnimationDrawable(); + if (msgTemp != info) { } else { - holder.endAnimationDrawable(); + if (isstart) { + holder.startAnimationDrawable(); + } else { + holder.endAnimationDrawable(); + } + } } - } } catch (Exception e) { e.printStackTrace(); @@ -2640,13 +2567,10 @@ public void run() { } }); - - } // 点击播放录音及动画 public void clickRecordFile(MessageInfo message) { - try { if (mRecordFilePlay == null) { mRecordFilePlay = new RecordPlay(UdeskChatActivity.this); @@ -2654,20 +2578,24 @@ public void clickRecordFile(MessageInfo message) { } if (mPlayCallback == null) { mPlayCallback = new RecordPlayCallback() { + @Override public void onPlayComplete(MessageInfo message) { showStartOrStopAnaimaition(message, false); recycleVoiceRes(); } + @Override public void onPlayStart(MessageInfo message) { showStartOrStopAnaimaition(message, true); } + @Override public void onPlayPause(MessageInfo message) { showStartOrStopAnaimaition(message, false); recycleVoiceRes(); } + @Override public void onPlayEnd(MessageInfo message) { showStartOrStopAnaimaition(message, false); recycleVoiceRes();// 新添加 @@ -2693,7 +2621,7 @@ public void endAnimation() { } if ((TextUtils.isEmpty(message.getLocalPath()) || !UdeskUtils.isExitFileByPath(message.getLocalPath())) && !UdeskUtils.fileIsExitByUrl(UdeskChatActivity.this.getApplicationContext(), UdeskConst.FileAduio, message.getMsgContent())) { - mPresenter.downAudio(message); + udeskViewMode.getFileLiveData().downAudio(message, getApplicationContext()); } mRecordFilePlay.click(message, mPlayCallback); } catch (Exception e) { @@ -2704,7 +2632,7 @@ public void endAnimation() { //回收录音资源 - private void recycleVoiceRes() { + public void recycleVoiceRes() { try { if (mRecordFilePlay != null) { mRecordFilePlay.recycleRes(); @@ -2728,6 +2656,7 @@ public void handleText(final MessageInfo message, View targetView) { UdeskChatActivity.this); menuWindow.show(UdeskChatActivity.this, targetView, menuLabel, new OnPopMultiMenuClick() { + @Override public void onMultiClick(int MenuIndex) { if (MenuIndex == 0) { doCopy(message.getMsgContent()); @@ -2761,36 +2690,30 @@ private void doCopy(String content) { public void sentLink(String linkMsg) { try { if (!UdeskUtils.isNetworkConnected(this)) { - UdeskUtils.showToast(this, - getResources().getString(R.string.udesk_has_wrong_net)); + UdeskUtils.showToast(getApplicationContext(), getResources().getString(R.string.udesk_has_wrong_net)); return; } - if (mPresenter != null) { - if (currentStatusIsOnline) { - mPresenter.sendTxtMessage(linkMsg); - } else if (isPresessionStatus) { - Toast.makeText(UdeskChatActivity.this, - getResources().getString(R.string.udesk_agent_connecting), - Toast.LENGTH_SHORT).show(); - mPresenter.sendTxtMessage(linkMsg); - } else if (UdeskSDKManager.getInstance().getImSetting() != null && - UdeskSDKManager.getInstance().getImSetting().getLeave_message_type().equals("msg")) { - if (!isLeavingmsg) { - mPresenter.addCustomerLeavMsg(); - isLeavingmsg = true; - } - mPresenter.sendLeaveMessage(linkMsg); - } else if (isNeedQueueMessageSave()) { - if (isMoreTanSendCount()) { - UdeskUtils.showToast(getApplicationContext(), getMoreThanSendTip()); - return; - } - //排队中需要保存消息 - mPresenter.sendTxtMessage(linkMsg); - } else { - confirmToForm(); + if (curentStatus.equals(UdeskConst.Status.robot) || currentStatusIsOnline) { + udeskViewMode.sendTxtMessage(linkMsg); + } else if (getPressionStatus()) { + UdeskUtils.showToast(getApplicationContext(), getResources().getString(R.string.udesk_agent_connecting)); + udeskViewMode.sendTxtMessage(linkMsg); + } else if (imSetting != null && + imSetting.getLeave_message_type().equals("msg")) { + if (!udeskViewMode.isLeavingMsg()) { + addCustomerLeavMsg(); + udeskViewMode.setLeavingMsg(true); + } + udeskViewMode.sendLeaveMessage(linkMsg); + } else if (isNeedQueueMessageSave()) { + if (isMoreThan20) { + UdeskUtils.showToast(getApplicationContext(), getMoreThanSendTip()); + return; } - + //排队中需要发送消息 + udeskViewMode.sendTxtMessage(linkMsg); + } else { + confirmToForm(); } } catch (Resources.NotFoundException e) { e.printStackTrace(); @@ -2802,22 +2725,33 @@ public void sentLink(String linkMsg) { public void retrySendMsg(MessageInfo message) { try { if (!UdeskUtils.isNetworkConnected(this)) { - UdeskUtils.showToast(this, - getResources().getString(R.string.udesk_has_wrong_net)); + UdeskUtils.showToast(getApplicationContext(), getResources().getString(R.string.udesk_has_wrong_net)); + return; } - if (isMoreTanSendCount() && isNeedQueueMessageSave()) { + if (isMoreThan20 && isNeedQueueMessageSave()) { UdeskUtils.showToast(getApplicationContext(), getMoreThanSendTip()); return; } //不在无消息对话过滤状态,也不在排队,也不是在线情况下 提示客服 - if (!isPresessionStatus && !currentStatusIsOnline && !isInTheQueue) { + if (!getPressionStatus() && !currentStatusIsOnline && !curentStatus.equals(UdeskConst.Status.queuing) && !curentStatus.equals(UdeskConst.Status.robot)) { UdeskUtils.showToast(getApplicationContext(), getResources().getString(R.string.udesk_label_customer_offline)); return; } - if (mPresenter != null && message != null) { + if (message != null) { changeImState(message.getMsgId(), UdeskConst.SendFlag.RESULT_RETRY); - mPresenter.startRetryMsg(message); + + if (message.getMsgtype().equals(UdeskConst.ChatMsgTypeString.TYPE_LEAVEMSG)) { + if (!TextUtils.isEmpty(customerId)) { + udeskViewMode.putLeavesMsg(message); + } + return; + } + if (curentStatus.equals(UdeskConst.Status.robot)) { + udeskViewMode.getRobotApiData().robotMessage(message); + } else { + udeskViewMode.startRetryMsg(message); + } } } catch (Exception e) { e.printStackTrace(); @@ -2827,8 +2761,8 @@ public void retrySendMsg(MessageInfo message) { //取消上传视频消息 public void cancleSendVideoMsg(MessageInfo message) { try { - if (mPresenter != null && message != null) { - mPresenter.cancleUploadFile(message); + if (message != null) { + udeskViewMode.getFileLiveData().cancleUploadFile(message); } } catch (Exception e) { e.printStackTrace(); @@ -2839,16 +2773,15 @@ public void cancleSendVideoMsg(MessageInfo message) { public void downLoadMsg(MessageInfo message) { try { if (!UdeskUtils.isNetworkConnected(this)) { - UdeskUtils.showToast(this, - getResources().getString(R.string.udesk_has_wrong_net)); + UdeskUtils.showToast(getApplicationContext(), getResources().getString(R.string.udesk_has_wrong_net)); return; } - if (mPresenter != null && message != null) { + if (message != null) { if (UdeskUtil.isGpsNet(getApplicationContext())) { toGpsNetView(false, message, null); return; } - mPresenter.downFile(message); + udeskViewMode.getFileLiveData().downFile(message, getApplicationContext()); } } catch (Exception e) { e.printStackTrace(); @@ -2858,12 +2791,11 @@ public void downLoadMsg(MessageInfo message) { public synchronized void downLoadVideo(MessageInfo message) { try { if (!UdeskUtils.isNetworkConnected(this)) { - UdeskUtils.showToast(this, - getResources().getString(R.string.udesk_has_wrong_net)); + UdeskUtils.showToast(getApplicationContext(), getResources().getString(R.string.udesk_has_wrong_net)); return; } - if (mPresenter != null && message != null) { - mPresenter.downVideo(message); + if (message != null) { + udeskViewMode.getFileLiveData().downVideo(message, getApplicationContext()); } } catch (Exception e) { e.printStackTrace(); @@ -2871,14 +2803,6 @@ public synchronized void downLoadVideo(MessageInfo message) { } - private void bottomoPannelBegginStatus() { - try { - mEmotionKeyboard.hideSoftInput(); - } catch (Exception e) { - e.printStackTrace(); - } - } - /** * @param title * @param status on / off @@ -2886,72 +2810,32 @@ private void bottomoPannelBegginStatus() { private void setTitlebar(String title, String status) { try { if (mTitlebar != null) { - mTitlebar.setLeftTextSequence(title); - if (status.equals("on")) { - mTitlebar.getudeskStateImg().setImageResource(R.drawable.udesk_online_status); - } else if (status.equals("off")) { - mTitlebar.getudeskStateImg().setImageResource(R.drawable.udesk_offline_status); - } else if (status.equals("queue")) { - mTitlebar.getudeskStateImg().setImageResource(R.drawable.udesk_queue_status); + mTitlebar.setTopTextSequence(title); + if (status.equals(on)) { + mTitlebar.setBottomTextSequence(getString(R.string.udesk_online)); + } else if (status.equals(off)) { + mTitlebar.setBottomTextSequence(getString(R.string.udesk_offline)); + } else if (status.equals(queue)) { + mTitlebar.setBottomTextSequence(getString(R.string.udesk_in_the_line)); } - mTitlebar.setOnTouchListener(new View.OnTouchListener() { - @Override - public boolean onTouch(View view, MotionEvent motionEvent) { - if (mBotomFramlayout.isShown()) { - if (mEmotionKeyboard != null) { - mEmotionKeyboard.interceptBackPress(); - } - } else { - if (mEmotionKeyboard != null) { - mEmotionKeyboard.hideSoftInput(); - } - } - return false; - } - }); - - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - - public void isOverConversation(Boolean isOver) { - try { - isOverConversation = isOver; - if (isOver) { - runOnUiThread(new Runnable() { - @Override - public void run() { - setTitlebar(getResources().getString( - R.string.udesk_close_chart), "off"); - } - }); - isMoreThan20 = false; } } catch (Exception e) { e.printStackTrace(); } } - @Override public void onBackPressed() { try { - if (mEmotionlayout.isShown() || mMoreLayout.isShown()) { - mEmotionKeyboard.interceptBackPress(); - } else { - finishAcitivty(); - } + fragment.onBackPressed(); } catch (Exception e) { e.printStackTrace(); } } - private void finishAcitivty() { + public void finishAcitivty() { //后台勾选开启后,对于同一个对话,用户多次进入,点击返回离开,若没有进行过满意度调查, // 则返回点击后均弹出满意度调查窗口,若已经有满意度调查结果,则返回不再发起调查都关闭. @@ -2961,12 +2845,10 @@ private void finishAcitivty() { } isFirstFinish = false; try { - SDKIMSetting imsetting = UdeskSDKManager.getInstance().getImSetting(); - if (!currentStatusIsOnline || imsetting == null || !imsetting.isInvestigation_when_leave() || !imsetting.getEnable_im_survey()) { + if (!currentStatusIsOnline || imSetting == null || !imSetting.getInvestigation_when_leave() || !imSetting.getEnable_im_survey()) { finish(); - } else if (mPresenter != null && mAgentInfo != null && !TextUtils.isEmpty(mAgentInfo.getAgent_id())) { - mPresenter.getHasSurvey(mAgentInfo.getAgent_id(), new ChatActivityPresenter.IUdeskHasSurvyCallBack() { - + } else if (initCustomer != null && initCustomer.getIm_survey() != null && mAgentInfo != null && !TextUtils.isEmpty(mAgentInfo.getAgent_id())) { + udeskViewMode.getApiLiveData().getHasSurvey(new IUdeskHasSurvyCallBack() { @Override public void hasSurvy(boolean hasSurvy) { finish(); @@ -2981,35 +2863,30 @@ public void hasSurvy(boolean hasSurvy) { } } - //设置会话时的语音图片等按钮的显隐藏 - private void setUdeskImContainerVis(int vis) { + private void setNavigationViewVis() { try { - if (UdeskSDKManager.getInstance().getUdeskConfig().isUseVoice) { - mAudioImg.setVisibility(vis); - if (vis == View.GONE) { - mInputEditView.setVisibility(View.VISIBLE); - mBtnAudio.setVisibility(View.GONE); - } - } - showEmoji(); - if (UdeskSDKManager.getInstance().getUdeskConfig().isUseMore) { - mMoreImg.setVisibility(vis); - if (vis == View.GONE) { - hideMoreLayout(); - } - } - if (UdeskSDKManager.getInstance().getUdeskConfig().isUseNavigationRootView) { - navigationRootView.setVisibility(vis); - } + fragment.setNavigationViewVis(); + } catch (Exception e) { + e.printStackTrace(); + } + } + + private void initfunctionItems() { + try { + fragment.initfunctionItems(); } catch (Exception e) { e.printStackTrace(); } } - private boolean isleaveMessageTypeMsg() { + //设置会话时的语音图片等按钮的显隐藏 + private void setUdeskImContainerVis(int vis) { + fragment.setUdeskImContainerVis(vis); + } + + public boolean isleaveMessageTypeMsg() { try { - SDKIMSetting sdkimSetting = UdeskSDKManager.getInstance().getImSetting(); - return sdkimSetting != null && sdkimSetting.getEnable_web_im_feedback() && sdkimSetting.getLeave_message_type().equals("msg"); + return imSetting != null && imSetting.getEnable_web_im_feedback() && imSetting.getLeave_message_type().equals("msg"); } catch (Exception e) { e.printStackTrace(); } @@ -3026,92 +2903,26 @@ public void onRequestPermissionsResult(int requestCode, @NonNull String[] permis } } - - public void showVideoThumbnail(final MessageInfo info) { - - new Thread(new Runnable() { - @Override - public void run() { - try { - Bitmap bitmap = UdeskUtil.getVideoThumbnail(info.getMsgContent()); - if (bitmap != null) { - UdeskUtils.saveBitmap(UdeskChatActivity.this.getApplicationContext(), info.getMsgContent(), bitmap); - Message message = getHandler().obtainMessage( - MessageWhat.ChangeVideoThumbnail); - message.obj = info.getMsgId(); - getHandler().sendMessage(message); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - }).start(); - - - } - - public void pullByJumpOrder(int seqNUm, String imSessionId) { - if (mPresenter != null) { - mPresenter.pullMessages(seqNUm, imSessionId); - } - } - - public void sendVideoMessage() { - + /** + * video缩略图 + * + * @param info + */ + public void showVideoThumbnail(MessageInfo info) { try { - SDKIMSetting sdkimSetting = UdeskSDKManager.getInstance().getImSetting(); - if (sdkimSetting != null && mAgentInfo != null && isOpenVideo()) { - //分配到客服后。建立websocket连接 - String domain = UdeskSDKManager.getInstance().getDomain(getApplicationContext()); - String[] domains = domain.split("\\."); - if (domains.length > 0) { - domain = domains[0]; - } - if (!TextUtils.isEmpty(mAgentInfo.getIm_sub_session_id())) { - UdeskConst.IMBusseniessId = mAgentInfo.getIm_sub_session_id(); - } - if (!TextUtils.isEmpty(mAgentInfo.getAgentJid())) { - UdeskConst.IMAgentJid = mAgentInfo.getAgentJid(); - } - if (!TextUtils.isEmpty(mAgentInfo.getAgentNick())) { - UdeskConst.IMAgentName = mAgentInfo.getAgentNick(); - } - if (!TextUtils.isEmpty(XmppInfo.getInstance().getLoginName())) { - UdeskConst.IMCustomerJid = XmppInfo.getInstance().getLoginName(); - } - if (!TextUtils.isEmpty(sdkimSetting.getVc_app_id())) { - UdeskConst.vc_app_id = sdkimSetting.getVc_app_id(); - } - if (!TextUtils.isEmpty(sdkimSetting.getAgora_app_id())) { - UdeskConst.agora_app_id = sdkimSetting.getAgora_app_id(); - } - if (!TextUtils.isEmpty(sdkimSetting.getServer_url())) { - UdeskConst.server_url = sdkimSetting.getServer_url(); - } - - if (!TextUtils.isEmpty(sdkimSetting.getVcall_token_url())) { - UdeskConst.signToenUrl = sdkimSetting.getVcall_token_url(); - } - if (!TextUtils.isEmpty(domain)) { - UdeskConst.Subdomain = domain; - } - - InvokeEventContainer.getInstance().event_OnConnectWebsocket.invoke(getApplicationContext()); - } + udeskViewMode.getFileLiveData().getBitmap(getApplicationContext(), info); } catch (Exception e) { e.printStackTrace(); } } - public ChatActivityPresenter getmPresenter() { - return mPresenter; - } - - private void addNavigationFragment() { + /** + * 拉取跳序信息 + */ + public void pullByJumpOrder() { try { - FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); - transaction.replace(R.id.fragment_view, new NavigationFragment()); - transaction.commit(); + moreMarking = ""; + udeskViewMode.getApiLiveData().messages(moreMarking); } catch (Exception e) { e.printStackTrace(); } @@ -3119,14 +2930,8 @@ private void addNavigationFragment() { @Override protected void onPause() { - try { UdeskBaseInfo.isNeedMsgNotice = true; - if (mPresenter != null) { - mPresenter.unbindReqsurveyMsg(); - } - //失去焦点 就启动 - MessageCache.getInstance().putAll(mPresenter.getSendingMsgCache(), getApplicationContext()); if (isFinishing()) { cleanSource(); } else { @@ -3140,7 +2945,6 @@ protected void onPause() { @Override protected void onStop() { - recycleVoiceRes(); super.onStop(); } @@ -3152,18 +2956,6 @@ protected void onDestroy() { } - private static class MyUpdateMsgRead extends Thread { - - @Override - public void run() { - try { - UdeskDBManager.getInstance().updateAllMsgRead(); - } catch (Exception e) { - e.printStackTrace(); - } - } - } - @Override public boolean dispatchTouchEvent(MotionEvent ev) { try { @@ -3220,89 +3012,182 @@ private boolean isShouldHideKeyboard(View v, MotionEvent event) { return false; } - @Override public boolean isNeedQueueMessageSave() { - return isInTheQueue && UdeskSDKManager.getInstance().getEnableSendMessageWhenQueue(); + return curentStatus.equals(UdeskConst.Status.queuing) && UdeskSDKManager.getInstance().getEnableSendMessageWhenQueue(); } - String moreThanStirng; - - @Override - public void isMoreThan(boolean isMore, String msg) { + public String getMoreThanSendTip() { + return TextUtils.isEmpty(moreThanStirng) ? getResources().getString(R.string.udesk_in_the_line_max_send) : moreThanStirng; + } + private void doAgentStatus(String imStatus) { try { - isMoreThan20 = isMore; - moreThanStirng = msg; - this.runOnUiThread(new Runnable() { - - @Override - public void run() { - UdeskUtils.showToast(UdeskChatActivity.this, getMoreThanSendTip()); + if (imStatus.equals(off)) { + curentStatus = UdeskConst.Status.off; + if (isleaveMessageTypeMsg()) { + setUdeskImContainerVis(View.GONE); + addWeclomeMessage(); + setTitlebar(getString(R.string.udesk_ok), off); + } else { + if (mAgentInfo != null) { + setTitlebar(mAgentInfo.getAgentNick(), off); + } else { + setTitlebar(getResources().getString( + R.string.udesk_label_customer_offline), off); + } + delayShowtips(mHandler); } - }); + if (currentStatusIsOnline) { + expandableLayout.startAnimation(false); + currentStatusIsOnline = false; + isNeedStartExpandabLyout = true; + } + } } catch (Exception e) { e.printStackTrace(); } - } - - public boolean isMoreTanSendCount() { - return isMoreThan20; - } - public String getMoreThanSendTip() { - - return TextUtils.isEmpty(moreThanStirng) ? getResources().getString(R.string.udesk_in_the_line_max_send) : moreThanStirng; } + /** + * 清理资源 + */ private void cleanSource() { - if (isDestroyed) { - return; - } - // 回收资源 - UdeskConst.sdk_page_status = UdeskConst.SDK_PAGE_FINISH; - isDestroyed = true; try { + if (isDestroyed) { + return; + } + // 回收资源 + UdeskConst.sdk_page_status = UdeskConst.SDK_PAGE_FINISH; + MergeModeManager.getmInstance().clear(); + isDestroyed = true; + if (popWindow != null && popWindow.isShowing()) { popWindow.dismiss(); } + fragment.cleanSource(); XPermissionUtils.destory(); - functionItems.clear(); - new MyUpdateMsgRead().start(); recycleVoiceRes(); - if (mPresenter != null) { - mPresenter.clearMsg(); - mPresenter.quitQuenu(UdeskSDKManager.getInstance().getUdeskConfig().UdeskQuenuMode); - mPresenter.unBind(); - mPresenter.removeCallBack(); - mPresenter = null; - } if (mHandler != null && myRunnable != null) { mHandler.removeCallbacks(myRunnable); } - UdeskDBManager.getInstance().updateSendFlagToFail(); - //设置了开启推送标识,离开会话界面开启推送, - if (!TextUtils.isEmpty(UdeskSDKManager.getInstance().getRegisterId(UdeskChatActivity.this)) && UdeskSDKManager.getInstance().getUdeskConfig().isUserSDkPush) { - UdeskSDKManager.getInstance().setSdkPushStatus(UdeskSDKManager.getInstance().getDomain(this), - UdeskSDKManager.getInstance().getAppkey(this), UdeskSDKManager.getInstance().getSdkToken(getApplicationContext()), UdeskConfig.UdeskPushFlag.ON, - UdeskSDKManager.getInstance().getRegisterId(UdeskChatActivity.this), UdeskSDKManager.getInstance().getAppId(this)); - } - if (mEmotionKeyboard != null) { - mEmotionKeyboard.destory(); - mEmotionKeyboard = null; - } if (queueItem != null) { queueItem = null; } - if (mBtnAudio != null){ - mBtnAudio.setRecordingListener(null); - mBtnAudio.destoryRelease(); - } - XPermissionUtils.destory(); unRegister(); - UdeskHttpFacade.getInstance().cancel(); - InvokeEventContainer.getInstance().event_IsOver.unBind(this); + InvokeEventContainer.getInstance().event_OnVideoEventReceived.unBind(this); + } catch (Exception e) { + e.printStackTrace(); + } + } + + public void recordError(String message) { + runOnUiThread(new Runnable() { + @Override + public void run() { + UdeskUtils.showToast(UdeskChatActivity.this.getApplicationContext(), getResources() + .getString(R.string.udesk_im_record_error)); + } + }); + } + + //增加一条客户留言事件 + public void addCustomerLeavMsg() { + try { + MessageInfo msg = UdeskUtil.buildSendMessage( + UdeskConst.ChatMsgTypeString.TYPE_EVENT, + System.currentTimeMillis(), getString(R.string.udesk_customer_leavemsg)); + msg.setSendFlag(UdeskConst.SendFlag.RESULT_SUCCESS); + msg.setDirection(UdeskConst.ChatMsgDirection.Recv); + udeskViewMode.getDbLiveData().saveMessageDB(msg); + mChatAdapter.addItem(msg); + } catch (Exception e) { + e.printStackTrace(); + } + } + + public void addWeclomeMessage() { + try { + if (TextUtils.isEmpty(leavMsgId) && imSetting != null && !TextUtils.isEmpty(imSetting.getLeave_message_guide())) { + leavMsgId = UdeskIdBuild.buildMsgId(); + MessageInfo weclomeMsg = UdeskUtil.addLeavMsgWeclome(imSetting.getLeave_message_guide(), leavMsgId); + mChatAdapter.addItem(weclomeMsg); + mListView.smoothScrollToPosition(mChatAdapter.getCount()); + } + }catch (Exception e){ + e.printStackTrace(); + } + + } + + public void onVideoEvent(String event, String id, String message, Boolean isInvite) { + + try { + if (mAgentInfo != null && mAgentInfo.getAgentCode() == 2000) { + if (event.equals(UdeskConst.ReceiveType.StartMedio)) { + MessageInfo messageInfo = UdeskUtil.buildVideoEventMsg(id, isInvite, message, customerId, + mAgentInfo.getAgentJid(), mAgentInfo.getAgentNick(), mAgentInfo.getIm_sub_session_id()); + udeskViewMode.getDbLiveData().saveMessageDB(messageInfo); + } else if (event.equals(UdeskConst.ReceiveType.Cancle)) { + //取消 + UdeskDBManager.getInstance().updateMsgContent(id, + message); + MessageInfo eventMsg = UdeskDBManager.getInstance().getMessage(id); + addMessage(eventMsg); + + } else if (event.equals(UdeskConst.ReceiveType.Busy)) { + message = mAgentInfo.getAgentNick() + message; + UdeskDBManager.getInstance().updateMsgContent(id, message); + MessageInfo eventMsg = UdeskDBManager.getInstance().getMessage(id); + addMessage(eventMsg); + } else if (event.equals(UdeskConst.ReceiveType.Timeout)) { + message = mAgentInfo.getAgentNick() + message; + UdeskDBManager.getInstance().updateMsgContent(id, + message); + MessageInfo eventMsg = UdeskDBManager.getInstance().getMessage(id); + addMessage(eventMsg); + } else if (event.equals(UdeskConst.ReceiveType.Reject)) { + UdeskDBManager.getInstance().updateMsgContent(id, + message); + MessageInfo eventMsg = UdeskDBManager.getInstance().getMessage(id); + addMessage(eventMsg); + } else if (event.equals(UdeskConst.ReceiveType.Over)) { + UdeskDBManager.getInstance().updateMsgContent(id, + message); + MessageInfo eventMsg = UdeskDBManager.getInstance().getMessage(id); + addMessage(eventMsg); + } + } + } catch (Exception e) { + e.printStackTrace(); + } + + } + + public void addMessage(final MessageInfo message) { + try { + runOnUiThread(new Runnable() { + @Override + public void run() { + mChatAdapter.addItem(message); + mListView.smoothScrollToPosition(mChatAdapter.getCount()); + } + }); } catch (Exception e) { e.printStackTrace(); } } + + public Map getUsefulMap() { + return usefulMap; + } + + public Map getTransferMap() { + return transferMap; + } + + public List getRandomList() { + return randomList; + } + } diff --git a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/activity/UdeskFormActivity.java b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/activity/UdeskFormActivity.java index 02df0dda..e12c3caf 100644 --- a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/activity/UdeskFormActivity.java +++ b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/activity/UdeskFormActivity.java @@ -44,7 +44,8 @@ private void loadingView() { private void settingTitlebar() { try { if (mTitlebar != null) { - UdekConfigUtil.setUITextColor(UdeskSDKManager.getInstance().getUdeskConfig().udeskTitlebarTextLeftRightResId, mTitlebar.getLeftTextView(), mTitlebar.getRightTextView()); + UdekConfigUtil.setUITextColor(UdeskSDKManager.getInstance().getUdeskConfig().udeskTitlebarMiddleTextResId, mTitlebar.getUdeskTopText(), mTitlebar.getRightTextView()); + UdekConfigUtil.setUITextColor(UdeskSDKManager.getInstance().getUdeskConfig().udeskTitlebarRightTextResId, mTitlebar.getRightTextView()); if (mTitlebar.getRootView() != null){ UdekConfigUtil.setUIbgDrawable(UdeskSDKManager.getInstance().getUdeskConfig().udeskTitlebarBgResId ,mTitlebar.getRootView()); } @@ -52,7 +53,7 @@ private void settingTitlebar() { mTitlebar.getUdeskBackImg().setImageResource(UdeskSDKManager.getInstance().getUdeskConfig().udeskbackArrowIconResId); } mTitlebar - .setLeftTextSequence(getString(R.string.udesk_ok)); + .setTopTextSequence(getString(R.string.udesk_ok)); mTitlebar.setLeftLinearVis(View.VISIBLE); mTitlebar.setLeftViewClick(new OnClickListener() { diff --git a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/activity/UdeskHelperActivity.java b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/activity/UdeskHelperActivity.java index e08750fd..361d8294 100644 --- a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/activity/UdeskHelperActivity.java +++ b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/activity/UdeskHelperActivity.java @@ -104,7 +104,7 @@ private void settingTitlebar() { try { mTitlebar = (UdeskTitleBar) findViewById(R.id.udesktitlebar); if (mTitlebar != null) { - mTitlebar.setLeftTextSequence(getString(R.string.udesk_navi_helper_title_main)); + mTitlebar.setTopTextSequence(getString(R.string.udesk_navi_helper_title_main)); mTitlebar.setLeftLinearVis(View.VISIBLE); mTitlebar.setLeftViewClick(new OnClickListener() { @@ -116,7 +116,8 @@ public void onClick(View v) { if (UdeskConfig.DEFAULT != UdeskSDKManager.getInstance().getUdeskConfig().udeskbackArrowIconResId) { mTitlebar.getUdeskBackImg().setImageResource(UdeskSDKManager.getInstance().getUdeskConfig().udeskbackArrowIconResId); } - UdekConfigUtil.setUITextColor(UdeskSDKManager.getInstance().getUdeskConfig().udeskTitlebarTextLeftRightResId, mTitlebar.getLeftTextView(), mTitlebar.getRightTextView()); + UdekConfigUtil.setUITextColor(UdeskSDKManager.getInstance().getUdeskConfig().udeskTitlebarMiddleTextResId, mTitlebar.getUdeskTopText(), mTitlebar.getRightTextView()); + UdekConfigUtil.setUITextColor(UdeskSDKManager.getInstance().getUdeskConfig().udeskTitlebarRightTextResId, mTitlebar.getRightTextView()); if (mTitlebar.getRootView() != null) { UdekConfigUtil.setUIbgDrawable(UdeskSDKManager.getInstance().getUdeskConfig().udeskTitlebarBgResId, mTitlebar.getRootView()); } @@ -202,7 +203,9 @@ public void onClick(View v) { startGetSerchHelper(search); } } else if (v.getId() == R.id.udesk_navi_to_im) { - UdeskSDKManager.getInstance().entryChat(getApplicationContext(), UdeskSDKManager.getInstance().getUdeskConfig(), UdeskSDKManager.getInstance().getSdkToken(getApplicationContext())); + UdeskSDKManager.getInstance().entryChat(getApplicationContext(), + UdeskSDKManager.getInstance().getUdeskConfig(), + UdeskSDKManager.getInstance().getSdkToken(getApplicationContext())); } } catch (Exception e) { e.printStackTrace(); diff --git a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/activity/UdeskHelperArticleActivity.java b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/activity/UdeskHelperArticleActivity.java index 945eb966..64c27b8e 100644 --- a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/activity/UdeskHelperArticleActivity.java +++ b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/activity/UdeskHelperArticleActivity.java @@ -55,12 +55,13 @@ private void settingTitlebar(){ try { mTitlebar = (UdeskTitleBar) findViewById(R.id.udesktitlebar); if(mTitlebar != null){ - UdekConfigUtil.setUITextColor(UdeskSDKManager.getInstance().getUdeskConfig().udeskTitlebarTextLeftRightResId,mTitlebar.getLeftTextView(),mTitlebar.getRightTextView()); - UdekConfigUtil.setUIbgDrawable(UdeskSDKManager.getInstance().getUdeskConfig().udeskTitlebarBgResId ,mTitlebar.getRootView()); + UdekConfigUtil.setUITextColor(UdeskSDKManager.getInstance().getUdeskConfig().udeskTitlebarMiddleTextResId,mTitlebar.getUdeskTopText(),mTitlebar.getUdeskBottomText()); + UdekConfigUtil.setUITextColor(UdeskSDKManager.getInstance().getUdeskConfig().udeskTitlebarRightTextResId, mTitlebar.getRightTextView()); + UdekConfigUtil.setUIbgDrawable(UdeskSDKManager.getInstance().getUdeskConfig().udeskTitlebarBgResId ,mTitlebar.getRootView()); if (UdeskConfig.DEFAULT != UdeskSDKManager.getInstance().getUdeskConfig().udeskbackArrowIconResId) { mTitlebar.getUdeskBackImg().setImageResource(UdeskSDKManager.getInstance().getUdeskConfig().udeskbackArrowIconResId); } - mTitlebar.setLeftTextSequence(getString(R.string.udesk_navi_helper_title_main)); + mTitlebar.setTopTextSequence(getString(R.string.udesk_navi_helper_title_main)); mTitlebar.setLeftLinearVis(View.VISIBLE); mTitlebar.setLeftViewClick(new OnClickListener() { diff --git a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/activity/UdeskOptionsAgentGroupActivity.java b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/activity/UdeskOptionsAgentGroupActivity.java index 62d68546..1f2e45a5 100644 --- a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/activity/UdeskOptionsAgentGroupActivity.java +++ b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/activity/UdeskOptionsAgentGroupActivity.java @@ -1,20 +1,16 @@ package cn.udesk.activity; +import android.app.Activity; import android.content.Intent; import android.os.Bundle; -import android.text.TextUtils; import android.view.View; import android.widget.AdapterView; import android.widget.ListView; import android.widget.TextView; -import android.widget.Toast; - -import org.json.JSONObject; import java.util.ArrayList; import java.util.List; -import cn.udesk.JsonUtils; import cn.udesk.R; import cn.udesk.UdeskSDKManager; import cn.udesk.UdeskUtil; @@ -24,9 +20,7 @@ import cn.udesk.model.AgentGroupNode; import cn.udesk.widget.UdeskDialog; import cn.udesk.widget.UdeskTitleBar; -import udesk.core.UdeskCallBack; import udesk.core.UdeskConst; -import udesk.core.UdeskHttpFacade; /** @@ -44,6 +38,14 @@ public class UdeskOptionsAgentGroupActivity extends UdeskBaseActivity implements private String rootId = "item_0"; private AgentGroupNode backMode = null; + private boolean startActivityForResult = false; + + public static void start(Activity context, int requestCode) { + Intent intent = new Intent(context, UdeskOptionsAgentGroupActivity.class); + intent.putExtra("forResult", true); + context.startActivityForResult(intent, requestCode); + } + @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -51,7 +53,12 @@ protected void onCreate(Bundle savedInstanceState) { UdeskUtil.setOrientation(this); setContentView(R.layout.udesk_options_agentgroup_view); initView(); - getImGroupInfo(); + if (getIntent() != null) { + startActivityForResult = getIntent().getBooleanExtra("forResult", false); + } + groups = UdeskSDKManager.getInstance().getInitCustomerBean().getIm_group(); + settingTitlebar(); + drawView(rootId); } catch (Exception e) { e.printStackTrace(); } @@ -76,54 +83,6 @@ public void onClick(View view) { } } - /** - * 请求客服组信息,没有客服组则直接进入会话界面 - */ - private void getImGroupInfo() { - try { - showLoading(); - UdeskHttpFacade.getInstance().getImGroupApi( - UdeskSDKManager.getInstance().getDomain(this), - UdeskSDKManager.getInstance().getAppkey(this), - UdeskSDKManager.getInstance().getSdkToken(this), - UdeskSDKManager.getInstance().getAppId(this), - new UdeskCallBack() { - - @Override - public void onSuccess(String message) { - dismiss(); - try { - JSONObject resultJson = new JSONObject(message); - if (resultJson.optInt("code") == 1000) { - groups = JsonUtils.parseIMGroup(message); - if (groups == null || groups.isEmpty()) { - luanchChat(); - return; - } - settingTitlebar(); - drawView(rootId); - } else { - Toast.makeText(UdeskOptionsAgentGroupActivity.this, UdeskOptionsAgentGroupActivity.this.getString(R.string.udesk_error), Toast.LENGTH_SHORT).show(); - finish(); - } - } catch (Exception e) { - Toast.makeText(UdeskOptionsAgentGroupActivity.this, UdeskOptionsAgentGroupActivity.this.getString(R.string.udesk_error), Toast.LENGTH_SHORT).show(); - finish(); - } - - } - - @Override - public void onFail(String message) { - dismiss(); - Toast.makeText(UdeskOptionsAgentGroupActivity.this, UdeskOptionsAgentGroupActivity.this.getString(R.string.udesk_has_bad_net), Toast.LENGTH_SHORT).show(); - finish(); - } - }); - } catch (Exception e) { - e.printStackTrace(); - } - } //进入会话界面 private void luanchChat() { @@ -144,7 +103,8 @@ private void settingTitlebar() { try { if (mTitlebar != null) { - UdekConfigUtil.setUITextColor(UdeskSDKManager.getInstance().getUdeskConfig().udeskTitlebarTextLeftRightResId, mTitlebar.getLeftTextView(), mTitlebar.getRightTextView()); + UdekConfigUtil.setUITextColor(UdeskSDKManager.getInstance().getUdeskConfig().udeskTitlebarMiddleTextResId, mTitlebar.getUdeskTopText(), mTitlebar.getUdeskBottomText()); + UdekConfigUtil.setUITextColor(UdeskSDKManager.getInstance().getUdeskConfig().udeskTitlebarRightTextResId, mTitlebar.getRightTextView()); if (mTitlebar.getRootView() != null) { UdekConfigUtil.setUIbgDrawable(UdeskSDKManager.getInstance().getUdeskConfig().udeskTitlebarBgResId, mTitlebar.getRootView()); } @@ -152,7 +112,7 @@ private void settingTitlebar() { mTitlebar.getUdeskBackImg().setImageResource(UdeskSDKManager.getInstance().getUdeskConfig().udeskbackArrowIconResId); } mTitlebar - .setLeftTextSequence(getString(R.string.udesk_options_agentgroup)); + .setTopTextSequence(getString(R.string.udesk_options_agentgroup)); mTitlebar.setLeftLinearVis(View.VISIBLE); mTitlebar.setLeftViewClick(new View.OnClickListener() { @@ -194,14 +154,20 @@ public void onItemClick(AdapterView adapterView, View view, int i, long l) { AgentGroupNode groupNode = adapter.getItem(i); backMode = groupNode; if (groupNode != null) { - if (TextUtils.isEmpty(groupNode.getGroup_id())) { + if (groupNode.getHas_next()) { drawView(groupNode.getId()); } else { - Intent intent = new Intent(getApplicationContext(), UdeskChatActivity.class); - intent.putExtra(UdeskConst.UDESKGROUPID, groupNode.getGroup_id()); - intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - startActivity(intent); - finish(); + if (startActivityForResult) { + finshActivity(groupNode.getId()); + } else { + Intent intent = new Intent(getApplicationContext(), UdeskChatActivity.class); + intent.putExtra(UdeskConst.UDESKMENUID, groupNode.getId()); + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + startActivity(intent); + finish(); + } + + } } @@ -211,21 +177,13 @@ public void onItemClick(AdapterView adapterView, View view, int i, long l) { } - private void showLoading() { - try { - dialog = new UdeskDialog(UdeskOptionsAgentGroupActivity.this, R.style.udesk_dialog); - dialog.show(); - } catch (Exception e) { - e.printStackTrace(); - } - + private void finshActivity(String groupId) { + Intent intent = new Intent(); + intent.putExtra(UdeskConst.UDESKMENUID, groupId); + setResult(RESULT_OK, intent); + UdeskOptionsAgentGroupActivity.this.finish(); } - private void dismiss() { - if (dialog != null) { - dialog.dismiss(); - } - } //根据id 画出相应的UI显示 private void drawView(String currentId) { diff --git a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/activity/UdeskRobotActivity.java b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/activity/UdeskRobotActivity.java deleted file mode 100644 index 3044d40a..00000000 --- a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/activity/UdeskRobotActivity.java +++ /dev/null @@ -1,185 +0,0 @@ -package cn.udesk.activity; - -import android.content.Intent; -import android.os.Bundle; -import android.text.TextUtils; -import android.util.Log; -import android.view.View; -import android.view.View.OnClickListener; - -import cn.udesk.R; -import cn.udesk.UdeskSDKManager; -import cn.udesk.UdeskUtil; -import cn.udesk.config.UdekConfigUtil; -import cn.udesk.config.UdeskConfig; -import cn.udesk.model.SDKIMSetting; -import cn.udesk.widget.UdeskTitleBar; -import udesk.core.UdeskConst; -import udesk.core.UdeskHttpFacade; -import udesk.core.utils.UdeskUtils; - -public class UdeskRobotActivity extends UdeskBaseWebViewActivity { - private String h5Url = null; - private String tranfer = null; - private boolean isTranferByImGroup = true; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - try { - UdeskUtil.setOrientation(this); - initData(); - loadingView(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void initData() { - try { - Intent intent = getIntent(); - if (intent != null) { - h5Url = intent.getStringExtra(UdeskConst.UDESKHTMLURL); - tranfer = intent.getStringExtra(UdeskConst.UDESKTRANSFER); - isTranferByImGroup = intent.getBooleanExtra(UdeskConst.UDESKISTRANFERSESSION, true); - } - } catch (Exception e) { - e.printStackTrace(); - } - - } - - private void loadingView() { - try { - settingTitlebar(tranfer); - if (!TextUtils.isEmpty(h5Url)) { - String url = UdeskHttpFacade.getInstance().buildRobotUrlWithH5( - this, UdeskSDKManager.getInstance().getAppkey(this), - h5Url, - UdeskSDKManager.getInstance().getSdkToken(this)); - url = url + "&udesk_sdk_features=show_transfer,go_chat,auto_transfer"; - if (!UdeskUtil.isZh(this)) { - url = url + "&language=en-us"; - } - if (!TextUtils.isEmpty(UdeskSDKManager.getInstance().getAppId(this))) { - url = url + "&app_id=" + UdeskSDKManager.getInstance().getAppId(this); - } - if (!TextUtils.isEmpty(UdeskSDKManager.getInstance().getUdeskConfig().robot_modelKey)) { - url = url + "&robot_modelKey=" + UdeskSDKManager.getInstance().getUdeskConfig().robot_modelKey; - } - if (!TextUtils.isEmpty(UdeskSDKManager.getInstance().getUdeskConfig().concatRobotUrlWithCustomerInfo)) { - url = url + UdeskSDKManager.getInstance().getUdeskConfig().concatRobotUrlWithCustomerInfo; - } - if (UdeskConst.isDebug) { - Log.i("udesksdk", "roboturl = " + url); - } - mwebView.loadUrl(url); - } else { - finish(); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - - /** - * titlebar 的设置 - */ - private void settingTitlebar(String tranfer) { - try { - mTitlebar = (UdeskTitleBar) findViewById(R.id.udesktitlebar); - if (mTitlebar != null) { - UdekConfigUtil.setUITextColor(UdeskSDKManager.getInstance().getUdeskConfig().udeskTitlebarTextLeftRightResId, mTitlebar.getLeftTextView(), mTitlebar.getRightTextView()); - if (mTitlebar.getRootView() != null) { - UdekConfigUtil.setUIbgDrawable(UdeskSDKManager.getInstance().getUdeskConfig().udeskTitlebarBgResId, mTitlebar.getRootView()); - } - if (UdeskConfig.DEFAULT != UdeskSDKManager.getInstance().getUdeskConfig().udeskbackArrowIconResId) { - mTitlebar.getUdeskBackImg().setImageResource(UdeskSDKManager.getInstance().getUdeskConfig().udeskbackArrowIconResId); - } - mTitlebar - .setLeftTextSequence(UdeskSDKManager.getInstance().getImSetting() != null && UdeskSDKManager.getInstance().getImSetting().getRobot_name() != null - ? UdeskUtils.objectToString(UdeskSDKManager.getInstance().getImSetting().getRobot_name()) - : getString(R.string.udesk_robot_title)); - mTitlebar.setLeftLinearVis(View.VISIBLE); - mTitlebar.setLeftViewClick(new OnClickListener() { - - @Override - public void onClick(View v) { - finish(); - - } - }); - - SDKIMSetting sdkimSetting = UdeskSDKManager.getInstance().getImSetting(); - if (sdkimSetting != null && UdeskUtils.objectToInt(sdkimSetting.getShow_robot_times()) > 0) { - return; - } - settingTitleBarRight(tranfer); - - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - @Override - protected void showTransfer() { -// super.showTransfer(); - if (tranfer.trim().equals("true")) { - settingTitleBarRight("true"); - } - } - - //根据传入的tranfer 控制右侧是否显示转人工 - private void settingTitleBarRight(String tranfer) { - try { - if (tranfer != null && tranfer.trim().equals("true")) { - mTitlebar.setRightTextVis(View.VISIBLE); - mTitlebar - .setRightTextSequence(getString(R.string.udesk_transfer_persion)); - mTitlebar.setudeskTransferImgVis(View.VISIBLE); - mTitlebar.setRightViewClick(new OnClickListener() { - - @Override - public void onClick(View v) { - goChat(); - } - }); - } else { - mTitlebar.setRightTextVis(View.GONE); - mTitlebar.setudeskTransferImgVis(View.GONE); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - @Override - protected void goChat() { - try { - if (isTranferByImGroup) { - Intent intent = new Intent(getApplicationContext(), UdeskOptionsAgentGroupActivity.class); - intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - startActivity(intent); - } else { - Intent intent = new Intent(UdeskRobotActivity.this, UdeskChatActivity.class); - intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - UdeskRobotActivity.this.startActivity(intent); - } - } catch (Exception e) { - e.printStackTrace(); - } - - } - - @Override - protected void autoTransfer() { - goChat(); - } - - @Override - protected void onDestroy() { - super.onDestroy(); - } -} \ No newline at end of file diff --git a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/activity/UdeskWebChromeClient.java b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/activity/UdeskWebChromeClient.java index 04f90042..0b844676 100644 --- a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/activity/UdeskWebChromeClient.java +++ b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/activity/UdeskWebChromeClient.java @@ -92,11 +92,6 @@ public void onReachedMaxAppCacheSize(long requiredStorage, long quota, WebStorag quotaUpdater.updateQuota(requiredStorage*2); } -// @Override -// public void onConsoleMessage(String message, int lineNumber, String sourceID) { -// Log.e("h5log", String.format("%s -- From line %s of %s", message, lineNumber, sourceID)); -// } - @Override public void onReceivedTitle(WebView view, String title) { if (h5TitleListener != null){ @@ -178,8 +173,9 @@ private void onActivityResultAboveL(int requestCode, int resultCode, Intent inte results[i] = item.getUri(); } } - if (dataString != null) + if (dataString != null) { results = new Uri[]{Uri.parse(dataString)}; + } } } uploadMessageAboveL.onReceiveValue(results); diff --git a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/activity/UdeskWebViewUrlAcivity.java b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/activity/UdeskWebViewUrlAcivity.java index ab4a3dfa..d0e31127 100644 --- a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/activity/UdeskWebViewUrlAcivity.java +++ b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/activity/UdeskWebViewUrlAcivity.java @@ -30,7 +30,7 @@ protected void onCreate(Bundle savedInstanceState) { setH5TitleListener(new UdeskWebChromeClient.GetH5Title() { @Override public void h5Title(String title) { - mTitlebar.setLeftTextSequence(title); + mTitlebar.setTopTextSequence(title); } }); } catch (Exception e) { @@ -42,15 +42,15 @@ public void h5Title(String title) { private void settingTitlebar() { try { - UdekConfigUtil.setUITextColor(UdeskSDKManager.getInstance().getUdeskConfig().udeskTitlebarTextLeftRightResId, mTitlebar.getLeftTextView(), mTitlebar.getRightTextView()); - + UdekConfigUtil.setUITextColor(UdeskSDKManager.getInstance().getUdeskConfig().udeskTitlebarMiddleTextResId, mTitlebar.getUdeskTopText(), mTitlebar.getUdeskBottomText()); + UdekConfigUtil.setUITextColor(UdeskSDKManager.getInstance().getUdeskConfig().udeskTitlebarRightTextResId, mTitlebar.getRightTextView()); if (mTitlebar.getRootView() != null){ UdekConfigUtil.setUIbgDrawable(UdeskSDKManager.getInstance().getUdeskConfig().udeskTitlebarBgResId, mTitlebar.getRootView()); } if (UdeskConfig.DEFAULT != UdeskSDKManager.getInstance().getUdeskConfig().udeskbackArrowIconResId) { mTitlebar.getUdeskBackImg().setImageResource(UdeskSDKManager.getInstance().getUdeskConfig().udeskbackArrowIconResId); } - mTitlebar.setLeftTextSequence(UdeskWebViewUrlAcivity.this.getString(R.string.udesk_titlebar_back)); + mTitlebar.setTopTextSequence(UdeskWebViewUrlAcivity.this.getString(R.string.udesk_titlebar_back)); mTitlebar.setLeftLinearVis(View.VISIBLE); mTitlebar.setLeftViewClick(new View.OnClickListener() { @Override diff --git a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/activity/UdeskZoomImageActivty.java b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/activity/UdeskZoomImageActivty.java index 9c2562b5..9d44020b 100644 --- a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/activity/UdeskZoomImageActivty.java +++ b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/activity/UdeskZoomImageActivty.java @@ -1,11 +1,11 @@ package cn.udesk.activity; +import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.os.Environment; import android.view.View; import android.view.View.OnClickListener; -import android.widget.Toast; import com.facebook.drawee.backends.pipeline.Fresco; @@ -17,15 +17,20 @@ import cn.udesk.R; import cn.udesk.UdeskUtil; +import cn.udesk.xphotoview.IXphotoView; +import cn.udesk.xphotoview.XPhotoView; import me.relex.photodraweeview.OnPhotoTapListener; import me.relex.photodraweeview.PhotoDraweeView; +import udesk.core.utils.UdeskUtils; public class UdeskZoomImageActivty extends UdeskBaseActivity implements OnClickListener { private PhotoDraweeView zoomImageView; - private View saveIdBtn; + private View saveIdBtn, originaPhotosBtn; private Uri uri; + private XPhotoView xPhotoView; + @Override protected void onCreate(Bundle arg0) { @@ -47,7 +52,21 @@ public void onPhotoTap(View view, float x, float y) { uri = bundle.getParcelable("image_path"); UdeskUtil.loadImage(getApplicationContext(), zoomImageView, uri); saveIdBtn = findViewById(R.id.udesk_zoom_save); + originaPhotosBtn = findViewById(R.id.udesk_original_photos); saveIdBtn.setOnClickListener(this); + originaPhotosBtn.setOnClickListener(this); + xPhotoView = findViewById(R.id.udesk_xphoto_view); + xPhotoView.setSingleTabListener(new IXphotoView.OnTabListener() { + @Override + public void onSingleTab() { + finish(); + } + + @Override + public void onLongTab() { + + } + }); } catch (Exception e) { e.printStackTrace(); } catch (OutOfMemoryError error) { @@ -70,6 +89,22 @@ public void run() { } }.start(); + } else if (v.getId() == R.id.udesk_original_photos) { + File file = UdeskUtil.getFileFromDiskCache(UdeskZoomImageActivty.this.getApplicationContext(), uri); + if (file == null) { + String oldPath = uri.getPath(); + file = new File(oldPath); + } + + if (file.exists()){ + zoomImageView.setVisibility(View.GONE); + xPhotoView.recycleAll(); + xPhotoView.setVisibility(View.VISIBLE); + xPhotoView.setImage(file); + originaPhotosBtn.setVisibility(View.GONE); + }else { + UdeskUtils.showToast(getApplicationContext(),getString(R.string.wait_try_again)); + } } } catch (Exception e) { e.printStackTrace(); @@ -102,11 +137,11 @@ public void saveImage() { @Override public void run() { - Toast.makeText( - UdeskZoomImageActivty.this, - getResources().getString( - R.string.udesk_success_save_image) + folder.getAbsolutePath(), - Toast.LENGTH_SHORT).show(); + Intent intent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE); + Uri uri = Uri.fromFile(newFile); + intent.setData(uri); + UdeskZoomImageActivty.this.sendBroadcast(intent); + UdeskUtils.showToast(getApplicationContext(),getString(R.string.udesk_success_save_image)); UdeskZoomImageActivty.this.finish(); } }); @@ -117,11 +152,7 @@ public void run() { @Override public void run() { - Toast.makeText( - UdeskZoomImageActivty.this, - getResources().getString( - R.string.udesk_fail_save_image), - Toast.LENGTH_SHORT).show(); + UdeskUtils.showToast(getApplicationContext(),getString(R.string.udesk_fail_save_image)); UdeskZoomImageActivty.this.finish(); } }); diff --git a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/adapter/NavigationAdapter.java b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/adapter/NavigationAdapter.java index 27e90d3a..8aecef04 100644 --- a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/adapter/NavigationAdapter.java +++ b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/adapter/NavigationAdapter.java @@ -2,6 +2,7 @@ import android.content.Context; import android.support.v7.widget.RecyclerView; +import android.text.TextUtils; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -13,6 +14,7 @@ import cn.udesk.R; import cn.udesk.UdeskSDKManager; import cn.udesk.model.NavigationMode; +import udesk.core.UdeskConst; /** * Created by user on 2018/3/28. @@ -32,12 +34,19 @@ public void setOnItemClickListener(OnRecyclerViewItemClickListener listener) { this.mOnItemClickListener = listener; } - public NavigationAdapter(Context context) { + public NavigationAdapter(Context context,String currentView) { this.mContext = context; - if (UdeskSDKManager.getInstance().getUdeskConfig().navigationModes != null){ - navigationModes = UdeskSDKManager.getInstance().getUdeskConfig().navigationModes; + if (TextUtils.equals(currentView,UdeskConst.CurrentFragment.agent)){ + if (UdeskSDKManager.getInstance().getUdeskConfig().navigationModes != null){ + navigationModes = UdeskSDKManager.getInstance().getUdeskConfig().navigationModes; + } + }else { + if (UdeskSDKManager.getInstance().getUdeskConfig().robotnavigationModes != null){ + navigationModes = UdeskSDKManager.getInstance().getUdeskConfig().robotnavigationModes; + } } + } @Override diff --git a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/adapter/SurvyAdapter.java b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/adapter/SurvyAdapter.java index d50181e3..4f4c8507 100644 --- a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/adapter/SurvyAdapter.java +++ b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/adapter/SurvyAdapter.java @@ -1,9 +1,7 @@ package cn.udesk.adapter; import android.content.Context; -import android.content.res.Resources; import android.support.v7.widget.RecyclerView; -import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -16,9 +14,7 @@ import java.util.List; import cn.udesk.R; -import cn.udesk.UdeskSDKManager; import cn.udesk.UdeskUtil; -import cn.udesk.model.NavigationMode; import cn.udesk.model.OptionsModel; import udesk.core.UdeskConst; import udesk.core.utils.UdeskUtils; diff --git a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/adapter/TagAdapter.java b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/adapter/TagAdapter.java index e44fcc88..f07f504e 100644 --- a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/adapter/TagAdapter.java +++ b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/adapter/TagAdapter.java @@ -12,8 +12,6 @@ import java.util.List; import cn.udesk.R; -import cn.udesk.UdeskSDKManager; -import cn.udesk.model.NavigationMode; import cn.udesk.model.Tag; /** diff --git a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/callback/IFunctionItemClickCallBack.java b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/callback/IFunctionItemClickCallBack.java index d634c2a5..9d2567f1 100644 --- a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/callback/IFunctionItemClickCallBack.java +++ b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/callback/IFunctionItemClickCallBack.java @@ -2,7 +2,7 @@ import android.content.Context; -import cn.udesk.presenter.ChatActivityPresenter; +import cn.udesk.aac.UdeskViewMode; /** * 支持自定义功能按钮后 点击事件回调 和直接发送文本,图片,视频,文件,地理位置,商品信息 @@ -10,5 +10,5 @@ public interface IFunctionItemClickCallBack { - void callBack(Context context, ChatActivityPresenter mPresenter, int id, String name); + void callBack(Context context, UdeskViewMode viewMode, int id, String name); } diff --git a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/callback/INavigationItemClickCallBack.java b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/callback/INavigationItemClickCallBack.java index 6e5e1cf4..3712904e 100644 --- a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/callback/INavigationItemClickCallBack.java +++ b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/callback/INavigationItemClickCallBack.java @@ -2,8 +2,8 @@ import android.content.Context; +import cn.udesk.aac.UdeskViewMode; import cn.udesk.model.NavigationMode; -import cn.udesk.presenter.ChatActivityPresenter; /** * 支持客户在导航处添加自定义按钮的点击回调事件 @@ -13,7 +13,7 @@ public interface INavigationItemClickCallBack { /** * @param context - * @param mPresenter 支持直接后续操作发送 文本,图片,视频,文件,地理位置,商品信息 + * @param udeskViewMode 支持直接后续操作发送 文本,图片,视频,文件,地理位置,商品信息 */ - void callBack(Context context, ChatActivityPresenter mPresenter, NavigationMode navigationMode); + void callBack(Context context, UdeskViewMode udeskViewMode, NavigationMode navigationMode,String currentView); } diff --git a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/camera/CameraInterface.java b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/camera/CameraInterface.java index 98e02df1..e1194b47 100644 --- a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/camera/CameraInterface.java +++ b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/camera/CameraInterface.java @@ -78,7 +78,7 @@ public class CameraInterface implements Camera.PreviewCallback { private String videoFileAbsPath; - public static void destroyCameraInterface() { + public void destroyCameraInterface() { if (mCameraInterface != null) { mCameraInterface = null; } @@ -93,11 +93,13 @@ private CameraInterface() { //获取CameraInterface单例 public static synchronized CameraInterface getInstance() { - if (mCameraInterface == null) + if (mCameraInterface == null) { synchronized (CameraInterface.class) { - if (mCameraInterface == null) + if (mCameraInterface == null) { mCameraInterface = new CameraInterface(); + } } + } return mCameraInterface; } @@ -620,6 +622,7 @@ void registerSensorManager(Context context) { } private SensorEventListener sensorEventListener = new SensorEventListener() { + @Override public void onSensorChanged(SensorEvent event) { if (Sensor.TYPE_ACCELEROMETER != event.sensor.getType()) { return; @@ -629,6 +632,7 @@ public void onSensorChanged(SensorEvent event) { rotationAnimation(); } + @Override public void onAccuracyChanged(Sensor sensor, int accuracy) { } }; diff --git a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/camera/CaptureButton.java b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/camera/CaptureButton.java index 278c6813..eda1b72c 100644 --- a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/camera/CaptureButton.java +++ b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/camera/CaptureButton.java @@ -139,14 +139,16 @@ public boolean onTouchEvent(MotionEvent event) { try { switch (event.getAction()) { case MotionEvent.ACTION_DOWN: - if (event.getPointerCount() > 1 || state != STATE_IDLE) + if (event.getPointerCount() > 1 || state != STATE_IDLE) { break; + } event_Y = event.getY(); //记录Y值 state = STATE_PRESS; //修改当前状态为点击按下 //判断按钮状态是否为可录制状态 - if ((button_state == BUTTON_STATE_ONLY_RECORDER || button_state == BUTTON_STATE_BOTH)) + if ((button_state == BUTTON_STATE_ONLY_RECORDER || button_state == BUTTON_STATE_BOTH)) { postDelayed(longPressRunnable, 500); //同时延长500启动长按后处理的逻辑Runnable + } break; case MotionEvent.ACTION_MOVE: if (captureLisenter != null @@ -198,10 +200,11 @@ private void recordEnd() { try { if (captureLisenter != null) { - if (recorded_time < min_duration) + if (recorded_time < min_duration) { captureLisenter.recordShort(recorded_time);//回调录制时间过短 - else + } else { captureLisenter.recordEnd(recorded_time); //回调录制结束 + } } resetRecordAnim(); //重制按钮状态 } catch (Exception e) { @@ -283,8 +286,9 @@ public void onAnimationEnd(Animator animation) { super.onAnimationEnd(animation); //设置为录制状态 if (state == STATE_LONG_PRESS) { - if (captureLisenter != null) + if (captureLisenter != null) { captureLisenter.recordStart(); + } state = STATE_RECORDERING; timer.start(); } diff --git a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/camera/UdeskCameraView.java b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/camera/UdeskCameraView.java index a43c5390..f5f9c7f9 100644 --- a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/camera/UdeskCameraView.java +++ b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/camera/UdeskCameraView.java @@ -40,7 +40,7 @@ public class UdeskCameraView extends FrameLayout implements CameraOpenOverCallba //拍照浏览时候的类型 public static final int TYPE_PICTURE = 0x001; - public static final int TYPE_VIDEO = 0x002; + public static final int TYPE_SHORT_VIDEO = 0x002; public static final int TYPE_SHORT = 0x003; public static final int TYPE_DEFAULT = 0x004; @@ -419,7 +419,7 @@ public void setCloseListener(OnClickListener listener) { public void resetState(int type) { try { switch (type) { - case TYPE_VIDEO: + case TYPE_SHORT_VIDEO: stopVideo(); //停止播放 //初始化VideoView UdeskUtils.deleteFile(videoUrl); @@ -448,7 +448,7 @@ public void resetState(int type) { public void confirmState(int type) { try { switch (type) { - case TYPE_VIDEO: + case TYPE_SHORT_VIDEO: stopVideo(); //停止播放 mVideoView.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)); machine.start(mVideoView.getHolder(), screenProp); diff --git a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/camera/state/BorrowVideoState.java b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/camera/state/BorrowVideoState.java index 8d4bf357..142ac4fa 100644 --- a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/camera/state/BorrowVideoState.java +++ b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/camera/state/BorrowVideoState.java @@ -67,7 +67,7 @@ public void stopRecord(boolean isShort, long time) { @Override public void cancle(SurfaceHolder holder, float screenProp) { try { - machine.getView().resetState(UdeskCameraView.TYPE_VIDEO); + machine.getView().resetState(UdeskCameraView.TYPE_SHORT_VIDEO); machine.setState(machine.getPreviewState()); } catch (Exception e) { e.printStackTrace(); @@ -77,7 +77,7 @@ public void cancle(SurfaceHolder holder, float screenProp) { @Override public void confirm() { try { - machine.getView().confirmState(UdeskCameraView.TYPE_VIDEO); + machine.getView().confirmState(UdeskCameraView.TYPE_SHORT_VIDEO); machine.setState(machine.getPreviewState()); } catch (Exception e) { e.printStackTrace(); diff --git a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/camera/util/CameraParamUtil.java b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/camera/util/CameraParamUtil.java index 61617126..4d9456c3 100644 --- a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/camera/util/CameraParamUtil.java +++ b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/camera/util/CameraParamUtil.java @@ -103,6 +103,7 @@ public boolean isSupportedPictureFormats(List supportedPictureFormats, } private class CameraSizeComparator implements Comparator { + @Override public int compare(Camera.Size lhs, Camera.Size rhs) { if (lhs.width == rhs.width) { return 0; diff --git a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/config/ImagePipelineConfigFactory.java b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/config/ImagePipelineConfigFactory.java index 6a5dcec5..044c2bfc 100644 --- a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/config/ImagePipelineConfigFactory.java +++ b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/config/ImagePipelineConfigFactory.java @@ -68,6 +68,7 @@ private static void configureCaches(ImagePipelineConfig.Builder configBuilder, C configBuilder .setBitmapMemoryCacheParamsSupplier( new Supplier() { + @Override public MemoryCacheParams get() { return bitmapCacheParams; } @@ -83,8 +84,9 @@ public MemoryCacheParams get() { } public static File getExternalCacheDir(final Context context) { - if (hasExternalCacheDir()) + if (hasExternalCacheDir()) { return context.getExternalCacheDir(); + } // Before Froyo we need to construct the external cache dir ourselves final String cacheDir = "/Android/data/" + context.getPackageName() + "/cache/"; diff --git a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/config/UdeskConfig.java b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/config/UdeskConfig.java index 71cc8cfb..2c249906 100644 --- a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/config/UdeskConfig.java +++ b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/config/UdeskConfig.java @@ -1,9 +1,7 @@ package cn.udesk.config; -import java.util.ArrayList; import java.util.List; -import java.util.Locale; import java.util.Map; import cn.udesk.R; @@ -30,9 +28,11 @@ public class UdeskConfig { // 标题栏TitleBar的背景色 通过颜色设置 public int udeskTitlebarBgResId = DEFAULT; - // 标题栏TitleBar,左右两侧文字的颜色 - public int udeskTitlebarTextLeftRightResId = DEFAULT; - //IM界面,左侧文字的字体颜色 + // 标题栏TitleBar,中部上下文字的颜色 + public int udeskTitlebarMiddleTextResId = DEFAULT; + // 标题栏TitleBar,右侧文字的颜色 + public int udeskTitlebarRightTextResId = DEFAULT; + // //IM界面,左侧文字的字体颜色 public int udeskIMLeftTextColorResId = DEFAULT; //IM界面,右侧文字的字体颜色 public int udeskIMRightTextColorResId = DEFAULT; @@ -73,6 +73,8 @@ public class UdeskConfig { public boolean isUseMore = true; //设置是否使用导航UI rue表示使用 false表示不使用 public boolean isUseNavigationRootView = false; + //设置是否使用导航UI rue表示使用 false表示不使用 + public boolean isUseRobotNavigationRootView = false; //设置是否使用导航UI中的满意度评价UI rue表示使用 false表示不使用 public boolean isUseNavigationSurvy = true; //设置是否需要小视频的功能 rue表示使用 false表示不使用 @@ -87,18 +89,12 @@ public class UdeskConfig { public String Orientation = OrientationValue.portrait; //在没有请求到管理员在后端对sdk使用配置下,在默认的情况下,是否需要表单留言,true需要, false 不需要 public boolean isUserForm = false; - //创建用户的基本信息 - public Map defualtUserInfo; - //创建自定义的文本信息 + //创建 更新用户的基本信息 + public Map defaultUserInfo; + //创建 更新自定义的文本信息 public Map definedUserTextField; //创建自定义的列表信息 public Map definedUserRoplist; - //用户需要更新的基本信息 - public Map updateDefualtUserInfo; - //用户需要更新自定义字段文本信息 - public Map updatedefinedUserTextField; - //用户需要更新自定义列表字段信息 - public Map updatedefinedUserRoplist; //设置带入一条消息 会话分配就发送给客服 public String firstMessage; //udesk 机器人配置欢迎语 对应的Id值 @@ -125,6 +121,8 @@ public class UdeskConfig { public INavigationItemClickCallBack navigationItemClickCallBack; //约定传递的自定义按钮集合 public List navigationModes; + //约定传递的自定义按钮集合 + public List robotnavigationModes; //点击地理位置信息的回调接口 public ILocationMessageClickCallBack locationMessageClickCallBack; //传入打开的地图的activity @@ -148,7 +146,8 @@ public class UdeskConfig { UdeskConfig(Builder builder) { this.udeskTitlebarBgResId = builder.udeskTitlebarBgResId; - this.udeskTitlebarTextLeftRightResId = builder.udeskTitlebarTextLeftRightResId; + this.udeskTitlebarMiddleTextResId = builder.udeskTitlebarMiddleTextResId; + this.udeskTitlebarRightTextResId=builder.udeskTitlebarRightTextResId; this.udeskIMLeftTextColorResId = builder.udeskIMLeftTextColorResId; this.udeskIMRightTextColorResId = builder.udeskIMRightTextColorResId; this.udeskIMAgentNickNameColorResId = builder.udeskIMAgentNickNameColorResId; @@ -170,6 +169,7 @@ public class UdeskConfig { this.isUseEmotion = builder.isUseEmotion; this.isUseMore = builder.isUseMore; this.isUseNavigationRootView = builder.isUseNavigationRootView; + this.isUseRobotNavigationRootView = builder.isUseRobotNavigationRootView; this.isUseNavigationSurvy = builder.isUseNavigationSurvy; this.isUseSmallVideo = builder.isUseSmallVideo; this.isScaleImg = builder.isScaleImg; @@ -177,12 +177,9 @@ public class UdeskConfig { this.useMapType = builder.useMapType; this.Orientation = builder.Orientation; this.isUserForm = builder.isUserForm; - this.defualtUserInfo = builder.defualtUserInfo; + this.defaultUserInfo = builder.defaultUserInfo; this.definedUserTextField = builder.definedUserTextField; this.definedUserRoplist = builder.definedUserRoplist; - this.updateDefualtUserInfo = builder.updateDefualtUserInfo; - this.updatedefinedUserTextField = builder.updatedefinedUserTextField; - this.updatedefinedUserRoplist = builder.updatedefinedUserRoplist; this.firstMessage = builder.firstMessage; this.robot_modelKey = builder.robot_modelKey; this.concatRobotUrlWithCustomerInfo = builder.concatRobotUrlWithCustomerInfo; @@ -196,6 +193,7 @@ public class UdeskConfig { this.extreFunctions = builder.extreFunctions; this.navigationItemClickCallBack = builder.navigationItemClickCallBack; this.navigationModes = builder.navigationModes; + this.robotnavigationModes = builder.robotnavigationModes; this.locationMessageClickCallBack = builder.locationMessageClickCallBack; this.cls = builder.cls; this.groupId = builder.groupId; @@ -216,8 +214,10 @@ public static UdeskConfig createDefualt() { public static class Builder { // 标题栏TitleBar的背景色 通过颜色设置 private int udeskTitlebarBgResId = DEFAULT; - // 标题栏TitleBar,左右两侧文字的颜色 - private int udeskTitlebarTextLeftRightResId = DEFAULT; + // 标题栏TitleBar,中部上下文字的颜色 + public int udeskTitlebarMiddleTextResId = DEFAULT; + // 标题栏TitleBar,右侧文字的颜色 + public int udeskTitlebarRightTextResId = DEFAULT; //IM界面,左侧文字的字体颜色 private int udeskIMLeftTextColorResId = DEFAULT; //IM界面,右侧文字的字体颜色 @@ -260,6 +260,8 @@ public static class Builder { private boolean isUseMore = true; //设置是否使用导航UI rue表示使用 false表示不使用 private boolean isUseNavigationRootView = false; + //设置是否使用导航UI rue表示使用 false表示不使用 + private boolean isUseRobotNavigationRootView = false; //设置是否使用导航UI中的满意度评价UI rue表示使用 false表示不使用 private boolean isUseNavigationSurvy = true; //设置是否需要小视频的功能 rue表示使用 false表示不使用 @@ -275,17 +277,11 @@ public static class Builder { //在没有请求到管理员在后端对sdk使用配置下,在默认的情况下,是否需要表单留言,true需要, false 不需要 private boolean isUserForm = false; //创建用户的基本信息 - private Map defualtUserInfo; + private Map defaultUserInfo; //创建自定义的文本信息 private Map definedUserTextField; //创建自定义的列表信息 private Map definedUserRoplist; - //用户需要更新的基本信息 - private Map updateDefualtUserInfo; - //用户需要更新自定义字段文本信息 - private Map updatedefinedUserTextField; - //用户需要更新自定义列表字段信息 - private Map updatedefinedUserRoplist; //设置带入一条消息 会话分配就发送给客服 private String firstMessage; //udesk 机器人配置欢迎语 对应的Id值 @@ -311,6 +307,9 @@ public static class Builder { private INavigationItemClickCallBack navigationItemClickCallBack; //约定传递的自定义按钮集合 private List navigationModes; + //约定传递的自定义按钮集合 + private List robotnavigationModes; + //点击地理位置信息的回调接口 private ILocationMessageClickCallBack locationMessageClickCallBack; //传入打开的地图的activity @@ -341,13 +340,20 @@ public Builder setUdeskTitlebarBgResId(int udeskTitlebarBgResId) { this.udeskTitlebarBgResId = udeskTitlebarBgResId; return this; } - /** - * @param udeskTitlebarTextLeftRightResId 标题栏TitleBar,左右两侧文字的颜色 + * @param udeskTitlebarMiddleTextResId 标题栏TitleBar,中间上下文字的颜色 + * @return + */ + public Builder setUdeskTitlebarMiddleTextResId(int udeskTitlebarMiddleTextResId) { + this.udeskTitlebarMiddleTextResId = udeskTitlebarMiddleTextResId; + return this; + } + /** + * @param udeskTitlebarRightTextResId 标题栏TitleBar,右侧文字的颜色 * @return */ - public Builder setUdeskTitlebarTextLeftRightResId(int udeskTitlebarTextLeftRightResId) { - this.udeskTitlebarTextLeftRightResId = udeskTitlebarTextLeftRightResId; + public Builder setUdeskTitlebarRightTextResId(int udeskTitlebarRightTextResId) { + this.udeskTitlebarRightTextResId = udeskTitlebarRightTextResId; return this; } @@ -583,10 +589,10 @@ public Builder setUserForm(boolean userForm) { } /** - * @param defualtUserInfo 创建用户的基本信息 + * @param defaultUserInfo 创建用户的基本信息 */ - public Builder setDefualtUserInfo(Map defualtUserInfo) { - this.defualtUserInfo = defualtUserInfo; + public Builder setdefaultUserInfo(Map defaultUserInfo) { + this.defaultUserInfo = defaultUserInfo; return this; } @@ -609,10 +615,10 @@ public Builder setDefinedUserRoplist(Map definedUserRoplist) { /** * 用户需要更新的基本信息 * - * @param updateDefualtUserInfo + * @param updatedefaultUserInfo */ - public Builder setUpdateDefualtUserInfo(Map updateDefualtUserInfo) { - this.updateDefualtUserInfo = updateDefualtUserInfo; + public Builder setUpdatedefaultUserInfo(Map updatedefaultUserInfo) { + this.defaultUserInfo = updatedefaultUserInfo; return this; } @@ -620,7 +626,7 @@ public Builder setUpdateDefualtUserInfo(Map updateDefualtUserInf * @param updatedefinedUserTextField 用户需要更新自定义字段文本信息 */ public Builder setUpdatedefinedUserTextField(Map updatedefinedUserTextField) { - this.updatedefinedUserTextField = updatedefinedUserTextField; + this.definedUserTextField = updatedefinedUserTextField; return this; } @@ -628,7 +634,7 @@ public Builder setUpdatedefinedUserTextField(Map updatedefinedUs * @param updatedefinedUserRoplist 用户需要更新自定义列表字段信息 */ public Builder setUpdatedefinedUserRoplist(Map updatedefinedUserRoplist) { - this.updatedefinedUserRoplist = updatedefinedUserRoplist; + this.definedUserRoplist = updatedefinedUserRoplist; return this; } @@ -728,6 +734,19 @@ public Builder setNavigations(boolean useNavigationRootView, List robotNavigationModes, + INavigationItemClickCallBack navigationItemClickCallBack) { + this.isUseRobotNavigationRootView = useRobotNavigationRootView; + this.robotnavigationModes = robotNavigationModes; + this.navigationItemClickCallBack = navigationItemClickCallBack; + return this; + } + /** * @param useNavigationSurvy 设置是否使用导航UI中的满意度评价UI rue表示使用 false表示不使用 diff --git a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/db/UdeskDBManager.java b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/db/UdeskDBManager.java index 66dcf610..6fb08900 100644 --- a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/db/UdeskDBManager.java +++ b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/db/UdeskDBManager.java @@ -13,6 +13,7 @@ import cn.udesk.UdeskUtil; import udesk.core.UdeskConst; import udesk.core.model.AgentInfo; +import udesk.core.model.InviterAgentInfo; import udesk.core.model.MessageInfo; import udesk.core.utils.UdeskUtils; @@ -94,11 +95,7 @@ public boolean addAllMessageInfo(List messages) { getSQLiteDatabase().beginTransaction(); try { for (MessageInfo msg : messages) { - if (msg.getDirection() == UdeskConst.ChatMsgDirection.Send) { - if (isExitMessage(msg.getMsgId()) == null) { - addMessageInfo(msg); - } - } else { + if (isExitMessage(msg.getMsgId()) == null) { addMessageInfo(msg); } } @@ -563,134 +560,6 @@ public synchronized int getMessageCount() { return count; } -// /** -// * 增加一条在发送的消息 -// * -// * @param msgId -// * @param sendFlag -// * @param time -// * @return -// */ -// public synchronized boolean addSendingMsg(String msgId, int sendFlag, long time) { -// if (getSQLiteDatabase() == null) { -// return false; -// } -// String sql = "replace into " + UdeskDBHelper.UdeskSendIngMsgs -// + "(MsgID,SendFlag,Time) values(?,?,?)"; -// try { -// getSQLiteDatabase().execSQL(sql, -// new Object[]{msgId, sendFlag, time}); -// return true; -// } catch (Exception e) { -// e.printStackTrace(); -// return false; -// } -// } - -// /** -// * 删除一条发送中的消息 -// * -// * @param msgId -// * @return -// */ -// public boolean deleteSendingMsg(String msgId) { -// if (getSQLiteDatabase() == null) { -// return false; -// } -// String sql = "delete from " + UdeskDBHelper.UdeskSendIngMsgs + " where MsgID=?"; -// try { -// getSQLiteDatabase().execSQL(sql, new Object[]{msgId}); -// return true; -// } catch (Exception e) { -// e.printStackTrace(); -// return false; -// } -// } -// -// /** -// * 删除所有的发送中的消息 -// */ -// public synchronized boolean delAllSendingMsg() { -// if (getSQLiteDatabase() == null) { -// return false; -// } -// String sql = "delete from " + UdeskDBHelper.UdeskSendIngMsgs; -// try { -// getSQLiteDatabase().execSQL(sql); -// return true; -// } catch (Exception e) { -// e.printStackTrace(); -// return false; -// } -// } - -// /** -// * message调用二次就可以了 -// * 获取5秒到半15之间都没发送成功的所有消息的MsgID -// * -// * @param currentTime -// * @return -// */ -// public synchronized List getNeedRetryMsg(long currentTime) { -// String sql = "select MsgID from " + UdeskDBHelper.UdeskSendIngMsgs + " where (" + currentTime + " - Time >= 5000 )" + " And (" + currentTime + " - Time <= 15000 )"; -// List listItems = null; -// Cursor cursor = null; -// if (getSQLiteDatabase() == null) { -// return null; -// } -// try { -// cursor = getSQLiteDatabase().rawQuery(sql, null); -// int count = cursor.getCount(); -// if (count < 1) { -// return null; -// } -// listItems = new ArrayList(); -// while (cursor.moveToNext()) { -// listItems.add(cursor.getString(0)); -// } -// } catch (Exception e) { -// e.printStackTrace(); -// } finally { -// if (cursor != null) { -// cursor.close(); -// } -// } -// return listItems; -// } -// -// /** -// * 获取大于半分钟都未发送成功的消息 -// * -// * @param currentTime -// * @return -// */ -// public synchronized List getNeedUpdateFailedMsg(long currentTime) { -// String sql = "select MsgID from " + UdeskDBHelper.UdeskSendIngMsgs + " where (" + currentTime + " - Time > 30000 )"; -// List listItems = null; -// Cursor cursor = null; -// if (getSQLiteDatabase() == null) { -// return null; -// } -// try { -// cursor = getSQLiteDatabase().rawQuery(sql, null); -// int count = cursor.getCount(); -// if (count < 1) { -// return null; -// } -// listItems = new ArrayList(); -// while (cursor.moveToNext()) { -// listItems.add(cursor.getString(0)); -// } -// } catch (Exception e) { -// e.printStackTrace(); -// } finally { -// if (cursor != null) { -// cursor.close(); -// } -// } -// return listItems; -// } - /** * 判断消息是否已经存在 * @@ -767,6 +636,7 @@ public synchronized void updateMsgHasRead(String msgId) { public synchronized void updateAllMsgRead() { + String sql = "update " + UdeskDBHelper.UdeskMessage + " set " + "ReadFlag= ?"; try { if (getSQLiteDatabase() == null) { @@ -832,8 +702,9 @@ public synchronized int getUnReadMessageCount() { Cursor cursor = null; try { cursor = getSQLiteDatabase().rawQuery(sql, new String[]{UdeskConst.ChatMsgReadFlag.unread + ""}); - if (cursor.getCount() < 1) + if (cursor.getCount() < 1) { return 0; + } cursor.moveToFirst(); count = cursor.getInt(0); } catch (Exception e) { @@ -895,7 +766,27 @@ public synchronized boolean addAgentInfo(AgentInfo agentInfo) { return false; } } + public synchronized boolean addInviterAgentInfo(InviterAgentInfo agentInfo) { + try { + + if (getSQLiteDatabase() == null) { + return false; + } + + String sql = "replace into " + + UdeskDBHelper.UdeskAgentMsg + + "(Receive_AgentJid ,HeadUrl ,AgentNick )" + + " values (?,?,?)"; + getSQLiteDatabase().execSQL( + sql, + new Object[]{agentInfo.getJid(), agentInfo.getAvatar(), agentInfo.getNick_name()}); + return true; + } catch (SQLException e) { + e.printStackTrace(); + return false; + } + } /** * 本地保存序号字段 * diff --git a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/emotion/EmojiManager.java b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/emotion/EmojiManager.java index a087fb1e..87cfeab0 100644 --- a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/emotion/EmojiManager.java +++ b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/emotion/EmojiManager.java @@ -53,8 +53,9 @@ public class EmojiManager { mDrawableCache = new LruCache(CACHE_MAX_SIZE) { @Override protected void entryRemoved(boolean evicted, String key, Bitmap oldValue, Bitmap newValue) { - if (oldValue != newValue) + if (oldValue != newValue) { oldValue.recycle(); + } } }; } diff --git a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/emotion/EmotionKeyboard.java b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/emotion/EmotionKeyboard.java index 73dcd4ff..786a4e67 100644 --- a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/emotion/EmotionKeyboard.java +++ b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/emotion/EmotionKeyboard.java @@ -16,6 +16,8 @@ import java.lang.reflect.Field; +import udesk.core.event.InvokeEventContainer; + /** * 表情键盘协调工具 */ @@ -66,6 +68,7 @@ public boolean onTouch(View v, MotionEvent event) { if (event.getAction() == MotionEvent.ACTION_UP && mEmotionLayout.isShown()) { lockContentHeight();//显示软件盘时,锁定内容高度,防止跳闪。 hideEmotionLayout(true);//隐藏表情布局,显示软件盘 + InvokeEventContainer.getInstance().eventui_OnHideLayout.invoke(true); //软件盘显示后,释放内容高度 mEditText.postDelayed(new Runnable() { @Override @@ -232,7 +235,7 @@ private void hideEmotionLayout(boolean showSoftInput) { /** * 锁定内容高度,防止跳闪 */ - private void lockContentHeight() { + public void lockContentHeight() { try { LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) mContentView.getLayoutParams(); params.height = mContentView.getHeight(); @@ -264,6 +267,7 @@ public void run() { public void showSoftInput() { try { mEditText.requestFocus(); + InvokeEventContainer.getInstance().eventui_OnHideLayout.invoke(true); mEditText.post(new Runnable() { @Override public void run() { diff --git a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/emotion/EmotionLayout.java b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/emotion/EmotionLayout.java index f3d1a30a..69290fc4 100644 --- a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/emotion/EmotionLayout.java +++ b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/emotion/EmotionLayout.java @@ -274,9 +274,9 @@ public void onClick(View v) { private void setCurPageCommon(int position) { try { - if (mTabPosi == 0) + if (mTabPosi == 0) { setCurPage(position, (int) Math.ceil(EmojiManager.getDisplayCount() / (float) EmotionLayout.EMOJI_PER_PAGE)); - else { + } else { StickerCategory category = StickerManager.getInstance().getStickerCategories().get(mTabPosi - 1); setCurPage(position, (int) Math.ceil(category.getStickers().size() / (float) EmotionLayout.STICKER_PER_PAGE)); } @@ -294,8 +294,9 @@ public void onClick(View v) { public void selectTab(int tabPosi) { try { - if (tabPosi == mTabViewArray.size() - 1) + if (tabPosi == mTabViewArray.size() - 1) { return; + } for (int i = 0; i < mTabCount; i++) { View tab = mTabViewArray.get(i); diff --git a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/emotion/EmotionViewPagerAdapter.java b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/emotion/EmotionViewPagerAdapter.java index 9ff24c49..ede7b528 100644 --- a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/emotion/EmotionViewPagerAdapter.java +++ b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/emotion/EmotionViewPagerAdapter.java @@ -40,10 +40,11 @@ public EmotionViewPagerAdapter(int emotionLayoutWidth, int emotionLayoutHeight, mEmotionLayoutHeight = emotionLayoutHeight; mTabPosi = tabPosi; - if (mTabPosi == 0) + if (mTabPosi == 0) { mPageCount = (int) Math.ceil(EmojiManager.getDisplayCount() / (float) EmotionLayout.EMOJI_PER_PAGE); - else + } else { mPageCount = (int) Math.ceil(StickerManager.getInstance().getStickerCategories().get(mTabPosi - 1).getStickers().size() / (float) EmotionLayout.STICKER_PER_PAGE); + } this.listener = listener; } @@ -156,8 +157,9 @@ public void onItemClick(AdapterView parent, View view, int position, long id) private void onEmojiSelected(String key) { try { - if (mMessageEditText == null) + if (mMessageEditText == null) { return; + } Editable editable = mMessageEditText.getText(); if (key.equals("/DEL")) { mMessageEditText.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_DEL)); diff --git a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/emotion/MoonUtils.java b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/emotion/MoonUtils.java index f0e7b9c2..61d54c9c 100644 --- a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/emotion/MoonUtils.java +++ b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/emotion/MoonUtils.java @@ -30,8 +30,9 @@ public class MoonUtils { * EditText用来转换表情文字的方法,如果没有使用EmoticonPickerView的attachEditText方法,则需要开发人员手动调用方法来又识别EditText中的表情 */ public static void replaceEmoticons(Context context, Editable editable, int start, int count) { - if (count <= 0 || editable.length() < start + count) + if (count <= 0 || editable.length() < start + count) { return; + } CharSequence s = editable.subSequence(start, start + count); Matcher matcher = EmojiManager.getPattern().matcher(s); @@ -48,15 +49,17 @@ public static void replaceEmoticons(Context context, Editable editable, int star } public static boolean isHasEmotions(String string){ - if (TextUtils.isEmpty(string)) + if (TextUtils.isEmpty(string)) { return false; + } Matcher matcher = EmojiManager.getPattern().matcher(string); return matcher.find(); } public static SpannableString replaceEmoticons(Context context, String string, int textSize) { - if (TextUtils.isEmpty(string)) + if (TextUtils.isEmpty(string)) { return null; + } SpannableString spannable = new SpannableString(string); Matcher matcher = EmojiManager.getPattern().matcher(string); while (matcher.find()) { diff --git a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/emotion/MyImageSpan.java b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/emotion/MyImageSpan.java index 4b349ed6..748cb893 100644 --- a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/emotion/MyImageSpan.java +++ b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/emotion/MyImageSpan.java @@ -16,6 +16,7 @@ public MyImageSpan(Drawable d) { super(d); } + @Override public int getSize(Paint paint, CharSequence text, int start, int end, Paint.FontMetricsInt fm) { Drawable d = getDrawable(); diff --git a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/messagemanager/Concurrents.java b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/messagemanager/Concurrents.java deleted file mode 100644 index 11cb03c0..00000000 --- a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/messagemanager/Concurrents.java +++ /dev/null @@ -1,38 +0,0 @@ -package cn.udesk.messagemanager; - -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.ThreadFactory; -import java.util.concurrent.atomic.AtomicInteger; - - -public class Concurrents { - public static ExecutorService newSingleThreadExecutor(final String name) { - return Executors.newSingleThreadExecutor(new DefaultThreadFactory(name)); - } - - public static class DefaultThreadFactory implements ThreadFactory { - private final ThreadGroup group; - private final AtomicInteger threadNumber = new AtomicInteger(1); - private final String namePrefix; - - public DefaultThreadFactory(String name) { - SecurityManager s = System.getSecurityManager(); - group = (s != null) ? s.getThreadGroup() : - Thread.currentThread().getThreadGroup(); - namePrefix = name + "-thread-"; - } - - public Thread newThread(Runnable r) { - Thread t = new Thread(group, r, - namePrefix + threadNumber.getAndIncrement(), - 0); - if (t.isDaemon()) - t.setDaemon(false); - if (t.getPriority() != Thread.NORM_PRIORITY) - t.setPriority(Thread.NORM_PRIORITY); - return t; - } - } - -} diff --git a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/messagemanager/UdeskMessageManager.java b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/messagemanager/UdeskMessageManager.java deleted file mode 100644 index 8161e81f..00000000 --- a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/messagemanager/UdeskMessageManager.java +++ /dev/null @@ -1,303 +0,0 @@ -package cn.udesk.messagemanager; - -import android.text.TextUtils; -import android.util.Log; - -import java.util.concurrent.ExecutorService; - -import cn.udesk.UdeskSDKManager; -import cn.udesk.config.UdeskBaseInfo; -import cn.udesk.config.UdeskConfig; -import cn.udesk.db.UdeskDBManager; -import cn.udesk.model.MsgNotice; -import udesk.core.UdeskConst; -import udesk.core.event.InvokeEventContainer; -import udesk.core.event.ReflectInvokeMethod; -import udesk.core.model.MessageInfo; -import udesk.core.utils.UdeskUtils; -import udesk.org.jivesoftware.smack.packet.Message; - - -public class UdeskMessageManager { - - private UdeskXmppManager mUdeskXmppManager; - private ExecutorService messageExecutor; - public ReflectInvokeMethod event_OnNewMessage = new ReflectInvokeMethod(new Class[]{Message.class, String.class, - String.class, String.class, String.class, Long.class, String.class, String.class, - Integer.class, String.class, String.class, Long.class}); - public ReflectInvokeMethod eventui_OnMessageReceived = new ReflectInvokeMethod(new Class[]{String.class}); - public ReflectInvokeMethod eventui_OnNewMessage = new ReflectInvokeMethod(new Class[]{MessageInfo.class}); - public ReflectInvokeMethod eventui_OnNewPresence = new ReflectInvokeMethod(new Class[]{String.class, Integer.class}); - public ReflectInvokeMethod eventui_OnReqsurveyMsg = new ReflectInvokeMethod(new Class[]{Boolean.class}); - public ReflectInvokeMethod event_OnNewMsgNotice = new ReflectInvokeMethod(new Class[]{MsgNotice.class}); - public ReflectInvokeMethod event_OnTicketReplayNotice = new ReflectInvokeMethod(new Class[]{Boolean.class}); - - - private static UdeskMessageManager instance = new UdeskMessageManager(); - - public static UdeskMessageManager getInstance() { - return instance; - } - - private UdeskMessageManager() { - bindEvent(); - mUdeskXmppManager = new UdeskXmppManager(); - ensureMessageExecutor(); - } - - private void ensureMessageExecutor() { - if (messageExecutor == null) { - messageExecutor = Concurrents - .newSingleThreadExecutor("messageExecutor"); - } - } - - public boolean isConnection() { - if (mUdeskXmppManager != null) { - return mUdeskXmppManager.isConnection(); - } - return false; - } - - public void connection() { - try { - ensureMessageExecutor(); - messageExecutor.submit(new Runnable() { - @Override - public void run() { - if (mUdeskXmppManager != null) { - UdeskUtils.resetTime(); - UdeskConst.sdk_xmpp_statea = UdeskConst.CONNECTING; - mUdeskXmppManager.cancel(); - mUdeskXmppManager.startLoginXmpp(); - } - } - }); - } catch (Exception e) { - e.printStackTrace(); - } - } - - public void sendVCCallMessage(String type, String to, String text) { - mUdeskXmppManager.sendVCCallMessage(type, to, text); - } - - public void sendMessage(final MessageInfo messageInfo) { - - try { - ensureMessageExecutor(); - messageExecutor.submit(new Runnable() { - @Override - public void run() { - if (mUdeskXmppManager != null) { - mUdeskXmppManager.sendMessage(messageInfo); - } - } - }); - } catch (Exception e) { - e.printStackTrace(); - } - - } - -// public void sendMessage(String type, String text, String msgId, String to, long duration, String subsessionId, boolean noNeedSave, int seqNum, String fileName, String filesize) { -// mUdeskXmppManager.sendMessage(type, text, msgId, to, duration, subsessionId, noNeedSave, seqNum, fileName, filesize); -// } - - public void sendComodityMessage(String text, String to) { - mUdeskXmppManager.sendComodityMessage(text, to); - } - - public void sendPreMsg(final String type, final String text, final String to) { - //防止堵塞 导致anr 无须关注结果 - try { - ensureMessageExecutor(); - messageExecutor.submit(new Runnable() { - @Override - public void run() { - if (mUdeskXmppManager != null) { - mUdeskXmppManager.sendPreMessage(type, text, to); - } - } - }); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void bindEvent() { - event_OnNewMessage.bind(this, "onNewMessage"); - InvokeEventContainer.getInstance().event_OnMessageReceived.bind(this, "onMessageReceived"); - InvokeEventContainer.getInstance().event_OnNewPresence.bind(this, "onNewPresence"); - InvokeEventContainer.getInstance().event_OnReqsurveyMsg.bind(this, "onReqsurveyMsg"); - InvokeEventContainer.getInstance().event_OnActionMsg.bind(this, "onActionMsg"); - } - - public void onMessageReceived(final String msgId) { - - try { - ensureMessageExecutor(); - messageExecutor.submit(new Runnable() { - @Override - public void run() { - UdeskDBManager.getInstance().updateMsgSendFlag(msgId, UdeskConst.SendFlag.RESULT_SUCCESS); -// UdeskDBManager.getInstance().deleteSendingMsg(msgId); - eventui_OnMessageReceived.invoke(msgId); - } - }); - } catch (Exception e) { - e.printStackTrace(); - } - } - - - public void onNewMessage(final Message message, String agentJid, final String type, final String msgId, final String content, - final Long duration, final String send_status, String imsessionId, Integer seqNum, - String fileName, String fileSize, Long receiveMsgTime) { - try { - String jid[] = agentJid.split("/"); - MessageInfo msginfo = null; - //判断是否是撤回消息 - if (send_status.equals("rollback")) { - if (UdeskDBManager.getInstance().deleteMsgById(msgId)) { - String[] urlAndNick = UdeskDBManager.getInstance().getAgentUrlAndNick(jid[0]); - String agentName = ""; - if (urlAndNick != null) { - agentName = urlAndNick[1]; - } - String buildrollBackMsg = agentName; - msginfo = buildReceiveMessage(jid[0], UdeskConst.ChatMsgTypeString.TYPE_EVENT, msgId, buildrollBackMsg, - duration, send_status, imsessionId, seqNum, fileName, fileSize, receiveMsgTime); - } - } else { - //消息在本地数据库存在,则结束后续流程 - if (UdeskDBManager.getInstance().hasReceviedMsg(msgId)) { - return; - } - msginfo = buildReceiveMessage(jid[0], type, msgId, content, duration, send_status, - imsessionId, seqNum, fileName, fileSize, receiveMsgTime); - } - - if (!type.equals(UdeskConst.ChatMsgTypeString.TYPE_REDIRECT)) { - boolean isSaveSuccess = UdeskDBManager.getInstance().addMessageInfo(msginfo); - if (isSaveSuccess) { - if (mUdeskXmppManager != null) { - mUdeskXmppManager.sendReceivedMsg(message); - } - } - } else { - if (mUdeskXmppManager != null) { - mUdeskXmppManager.sendReceivedMsg(message); - } - } - if (UdeskConst.isDebug && msginfo != null) { - Log.i("newMessage", msginfo.toString()); - } - eventui_OnNewMessage.invoke(msginfo); - if (type.equals(UdeskConst.ChatMsgTypeString.TYPE_REDIRECT)) { - return; - } - if (UdeskBaseInfo.isNeedMsgNotice) { - MsgNotice msgNotice = new MsgNotice(msgId, type, content); - event_OnNewMsgNotice.invoke(msgNotice); - - } - } catch (Exception e) { - e.printStackTrace(); - } - - } - - public MessageInfo buildReceiveMessage(String agentJid, String msgType, String msgId, - String content, long duration, String send_status, - String imsessionId, Integer seqNum, String fileName, String fileSize, Long receiveMsgTime) { - MessageInfo msg = new MessageInfo(); - try { - msg.setMsgtype(msgType); - msg.setTime(receiveMsgTime); - msg.setMsgId(msgId); - msg.setDirection(UdeskConst.ChatMsgDirection.Recv); - msg.setSendFlag(UdeskConst.SendFlag.RESULT_SUCCESS); - msg.setReadFlag(UdeskConst.ChatMsgReadFlag.unread); - msg.setMsgContent(content); - msg.setPlayflag(UdeskConst.PlayFlag.NOPLAY); - msg.setLocalPath(""); - msg.setDuration(duration); - msg.setmAgentJid(agentJid); - msg.setSend_status(send_status); - msg.setSubsessionid(imsessionId); - msg.setSeqNum(seqNum); - msg.setFilename(fileName); - msg.setFilesize(fileSize); - } catch (Exception e) { - e.printStackTrace(); - } - return msg; - } - - public void onNewPresence(String jid, Integer onlineflag) { - try { - eventui_OnNewPresence.invoke(jid, onlineflag); - } catch (Exception e) { - e.printStackTrace(); - } - - } - - public void onReqsurveyMsg(Boolean isSurvey) { - try { - eventui_OnReqsurveyMsg.invoke(isSurvey); - } catch (Exception e) { - e.printStackTrace(); - } - - } - - public void onActionMsg(String type, String actionText, String agentJId) { - try { - if (TextUtils.isEmpty(actionText)) { - return; - } - if (type.equals("ticket_reply")) { - //调用获取工单离线消息 - event_OnTicketReplayNotice.invoke(true); - return; - } - if (actionText.equals("overtest")) { - mUdeskXmppManager.sendActionMessage(agentJId); - } else if (actionText.equals("over")) { - InvokeEventContainer.getInstance().event_IsOver.invoke(true); - try { - Thread.sleep(2000); - cancleXmpp(); - } catch (InterruptedException e) { - e.printStackTrace(); - } - - } - } catch (Exception e) { - e.printStackTrace(); - } - - } - - public void cancleXmpp() { - try { - UdeskUtils.resetTime(); - UdeskConst.sdk_xmpp_statea = UdeskConst.CONNECTION_FAILED; - ensureMessageExecutor(); - messageExecutor.submit(new Runnable() { - @Override - public void run() { - if (mUdeskXmppManager != null) { - mUdeskXmppManager.cancel(); - } - } - }); - } catch (Exception e) { - e.printStackTrace(); - } - } - - -} diff --git a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/messagemanager/UdeskXmppManager.java b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/messagemanager/UdeskXmppManager.java index 510fd7f4..629f3510 100644 --- a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/messagemanager/UdeskXmppManager.java +++ b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/messagemanager/UdeskXmppManager.java @@ -9,17 +9,17 @@ import java.util.UUID; import java.util.concurrent.ArrayBlockingQueue; -import java.util.concurrent.ConcurrentLinkedQueue; -import java.util.concurrent.LinkedBlockingQueue; import cn.udesk.UdeskSDKManager; import cn.udesk.config.UdeskBaseInfo; -import cn.udesk.config.UdeskConfig; +import cn.udesk.db.UdeskDBManager; +import cn.udesk.model.MsgNotice; +import cn.udesk.model.IMInfo; import udesk.core.UdeskConst; import udesk.core.event.InvokeEventContainer; +import udesk.core.model.InviterAgentInfo; import udesk.core.model.MessageInfo; import udesk.core.utils.UdeskUtils; -import udesk.core.xmpp.XmppInfo; import udesk.org.jivesoftware.smack.ConnectionConfiguration; import udesk.org.jivesoftware.smack.ConnectionListener; import udesk.org.jivesoftware.smack.PacketListener; @@ -52,6 +52,7 @@ public class UdeskXmppManager implements ConnectionListener, PacketListener { volatile boolean isConnecting = false; private static long heartSpaceTime = 0; + /** * 基于插入和删除元素是不会产生和销毁额外的对象实例 * 并且 在此处场景 插入和删除就是互斥的, xmpp正常使用的时候是会不加入的 @@ -59,6 +60,18 @@ public class UdeskXmppManager implements ConnectionListener, PacketListener { */ private ArrayBlockingQueue queue = new ArrayBlockingQueue(30); + private static class LazyHolder { + private static final UdeskXmppManager INSTANCE = new UdeskXmppManager(); + } + + private UdeskXmppManager() { + } + + public static final UdeskXmppManager getInstance() { + return LazyHolder.INSTANCE; + } + + //xmpp没有连接或连接上 或 发送异常加入队列 private void addQueue(MessageInfo messageInfo) { queue.add(messageInfo); @@ -67,8 +80,9 @@ private void addQueue(MessageInfo messageInfo) { //xmpp 链接上后调用 private void xmppConnectionRetrySend() { - while (sendQueueMessage(queue.poll())) + while (sendQueueMessage(queue.poll())) { ; + } } @@ -82,22 +96,18 @@ private boolean sendQueueMessage(MessageInfo msg) { } - public UdeskXmppManager() { - - } - - public synchronized boolean startLoginXmpp() { - if (TextUtils.isEmpty(XmppInfo.getInstance().getLoginServer()) - || TextUtils.isEmpty(XmppInfo.getInstance().getLoginPassword()) - || TextUtils.isEmpty(XmppInfo.getInstance().getLoginName())) { + IMInfo info = UdeskSDKManager.getInstance().getImInfo(); + if (info == null || TextUtils.isEmpty(info.getServer()) + || TextUtils.isEmpty(info.getPassword()) + || TextUtils.isEmpty(info.getUsername())) { return false; } - return this.startLoginXmpp(XmppInfo.getInstance().getLoginName(), - XmppInfo.getInstance().getLoginPassword(), - XmppInfo.getInstance().getLoginServer(), - XmppInfo.getInstance().getLoginPort()); + return this.startLoginXmpp(info.getUsername(), + info.getPassword(), + info.getServer(), + info.getPort()); } /** @@ -237,9 +247,7 @@ public synchronized void sendComodityMessage(String text, String to) { xmppConnection.sendPacket(xmppMsg); } catch (Exception e) { e.printStackTrace(); - UdeskUtils.resetTime(); - UdeskConst.sdk_xmpp_statea = UdeskConst.CONNECTING; - reConnected(); + connection(); } } } @@ -263,27 +271,21 @@ public synchronized void sendActionMessage(String to) { } } - public synchronized void sendVCCallMessage(String type, String to, String text) { - if (TextUtils.isEmpty(to)) { - return; - } - if (xmppConnection != null) { - try { - xmppMsg = new Message(to, Message.Type.chat); - xmppMsg.setPacketID(" "); - ActionMsgXmpp actionMsgXmpp = new ActionMsgXmpp(); - actionMsgXmpp.setActionText(text); - actionMsgXmpp.setType(type); - xmppMsg.addExtension(actionMsgXmpp); - xmppConnection.sendPacket(xmppMsg); - } catch (Exception e) { - e.printStackTrace(); - } + public void sendPreMsg(final String type, final String text, final String to) { + //防止堵塞 导致anr 无须关注结果 + try { + UdeskSDKManager.getInstance().getSingleExecutor().submit(new Runnable() { + @Override + public void run() { + sendPre(type, text, to); + } + }); + } catch (Exception e) { + e.printStackTrace(); } } - - public synchronized void sendPreMessage(String type, String text, String to) { + private synchronized void sendPre(String type, String text, String to) { try { if (TextUtils.isEmpty(to)) { return; @@ -311,7 +313,22 @@ public synchronized void sendPreMessage(String type, String text, String to) { } - public synchronized void sendMessage(MessageInfo msg) { + public void sendMessage(final MessageInfo messageInfo) { + + try { + UdeskSDKManager.getInstance().getSingleExecutor().submit(new Runnable() { + @Override + public void run() { + send(messageInfo); + } + }); + } catch (Exception e) { + e.printStackTrace(); + } + + } + + private synchronized void send(MessageInfo msg) { try { String type = msg.getMsgtype(); String text = msg.getMsgContent(); @@ -330,7 +347,7 @@ public synchronized void sendMessage(MessageInfo msg) { if (System.currentTimeMillis() - heartSpaceTime > 30 * 1000 || !isConnection()) { heartSpaceTime = System.currentTimeMillis(); addQueue(msg); - reConnected(); + connection(); UdeskUtils.resetTime(); UdeskConst.sdk_xmpp_statea = UdeskConst.CONNECTING; InvokeEventContainer.getInstance().event_OnSendMessageFail.invoke(msg); @@ -415,11 +432,28 @@ private void processPresence(Presence pre) { } } + + public void messageReceived(final String msgId) { + + try { + UdeskSDKManager.getInstance().getSingleExecutor().submit(new Runnable() { + @Override + public void run() { + UdeskDBManager.getInstance().updateMsgSendFlag(msgId, UdeskConst.SendFlag.RESULT_SUCCESS); + InvokeEventContainer.getInstance().event_OnMessageReceived.invoke(msgId); + } + }); + } catch (Exception e) { + e.printStackTrace(); + } + } + private void processMessage(Message message) { // 收到回执消息 if (message.getExtension("received", "urn:xmpp:receipts") != null) { DeliveryReceipt received = message.getExtension("received", "urn:xmpp:receipts"); if (received != null && !TextUtils.isEmpty(received.getId())) { + messageReceived(received.getId()); InvokeEventContainer.getInstance().event_OnMessageReceived.invoke(received.getId()); } return; @@ -454,11 +488,13 @@ private void processMessage(Message message) { long duration = 0; String send_status = ""; String im_sub_session_id = ""; + String new_agent_name = ""; int seq_num = 0; String fileName = ""; String fileSize = ""; //离线消息设置服务端带过来的时间, 在线消息,以手机时间为准 long receiveMsgTime = 0; + InviterAgentInfo inviterAgentInfo = new InviterAgentInfo(); try { receiveMsgTime = delayInfo != null ? delayInfo.getStamp().getTime() : System.currentTimeMillis(); JSONObject json = new JSONObject(message.getBody()); @@ -494,19 +530,117 @@ private void processMessage(Message message) { if (json.has("im_sub_session_id")) { im_sub_session_id = json.getString("im_sub_session_id"); } - + if (json.has("new_agent_name")) { + new_agent_name = json.getString("new_agent_name"); + } + if (json.has("inviter")){ + JSONObject inviter = json.getJSONObject("inviter"); + inviterAgentInfo.setId(inviter.opt("id")); + inviterAgentInfo.setAvatar(inviter.opt("avatar")); + inviterAgentInfo.setJid(inviter.opt("jid")); + inviterAgentInfo.setNick_name(inviter.opt("nick_name")); + } } catch (JSONException e) { e.printStackTrace(); } if (!TextUtils.isEmpty(type) && !TextUtils.isEmpty(content)) { - UdeskMessageManager.getInstance().event_OnNewMessage.invoke(message, message.getFrom(), type, id, content, - duration, send_status, im_sub_session_id, seq_num, fileName, fileSize, receiveMsgTime); + newMessage(message, message.getFrom(), type, id, content, + duration, send_status, im_sub_session_id, seq_num, fileName, fileSize, receiveMsgTime,inviterAgentInfo,new_agent_name); } } } - public synchronized void sendReceivedMsg(Message message) { + private void newMessage(final Message message, String agentJid, final String type, final String msgId, final String content, + final Long duration, final String send_status, String imsessionId,Integer seqNum, + String fileName, String fileSize, Long receiveMsgTime,InviterAgentInfo inviterAgentInfo,String new_agent_name) { + try { + String inviterJid = inviterAgentInfo.getJid(); + String jid[] = agentJid.split("/"); + if (!TextUtils.isEmpty(inviterJid)){ + UdeskDBManager.getInstance().addInviterAgentInfo(inviterAgentInfo); + jid = inviterJid.split("/"); + } + MessageInfo msginfo = null; + //判断是否是撤回消息 + if (send_status.equals("rollback")) { + if (UdeskDBManager.getInstance().deleteMsgById(msgId)) { + String[] urlAndNick = UdeskDBManager.getInstance().getAgentUrlAndNick(jid[0]); + String agentName = ""; + if (urlAndNick != null) { + agentName = urlAndNick[1]; + } + String buildrollBackMsg = agentName; + msginfo = buildReceiveMessage(jid[0], UdeskConst.ChatMsgTypeString.TYPE_EVENT, msgId, buildrollBackMsg, + duration, send_status, imsessionId, seqNum, fileName, fileSize, receiveMsgTime,new_agent_name); + } + } else { + //消息在本地数据库存在,则结束后续流程 + if (UdeskDBManager.getInstance().hasReceviedMsg(msgId)) { + return; + } + msginfo = buildReceiveMessage(jid[0], type, msgId, content, duration, send_status, + imsessionId, seqNum, fileName, fileSize, receiveMsgTime,new_agent_name); + } + if (!TextUtils.isEmpty(inviterJid)){ + msginfo.setInviterAgentInfo(inviterAgentInfo); + } + + if (!type.equals(UdeskConst.ChatMsgTypeString.TYPE_REDIRECT)) { + boolean isSaveSuccess = UdeskDBManager.getInstance().addMessageInfo(msginfo); + if (isSaveSuccess) { + sendReceivedMsg(message); + } + } else { + sendReceivedMsg(message); + } + if (UdeskConst.isDebug && msginfo != null) { + Log.i("newMessage", msginfo.toString()); + } + InvokeEventContainer.getInstance().eventui_OnNewMessage.invoke(msginfo); + if (type.equals(UdeskConst.ChatMsgTypeString.TYPE_REDIRECT)) { + return; + } + if (UdeskBaseInfo.isNeedMsgNotice && UdeskSDKManager.getInstance().getNewMessage() != null) { + MsgNotice msgNotice = new MsgNotice(msgId, type, content); + UdeskSDKManager.getInstance().getNewMessage().onNewMessage(msgNotice); + } + } catch (Exception e) { + e.printStackTrace(); + } + + } + + private MessageInfo buildReceiveMessage(String agentJid, String msgType, String msgId, + String content, long duration, String send_status, + String imsessionId, Integer seqNum, String fileName, String fileSize, Long receiveMsgTime,String new_agent_name) { + MessageInfo msg = new MessageInfo(); + try { + msg.setMsgtype(msgType); + msg.setTime(receiveMsgTime); + msg.setMsgId(msgId); + msg.setDirection(UdeskConst.ChatMsgDirection.Recv); + msg.setSendFlag(UdeskConst.SendFlag.RESULT_SUCCESS); + msg.setReadFlag(UdeskConst.ChatMsgReadFlag.unread); + msg.setMsgContent(content); + msg.setPlayflag(UdeskConst.PlayFlag.NOPLAY); + msg.setLocalPath(""); + msg.setDuration(duration); + msg.setmAgentJid(agentJid); + msg.setSend_status(send_status); + msg.setSubsessionid(imsessionId); + msg.setSeqNum(seqNum); + msg.setFilename(fileName); + msg.setFilesize(fileSize); + msg.setReplyUser(new_agent_name); + msg.setSender(UdeskConst.Sender.agent); + } catch (Exception e) { + e.printStackTrace(); + } + return msg; + } + + private synchronized void sendReceivedMsg(Message message) { if (message.getExtension("request", "urn:xmpp:receipts") != null) { try { ReceivedXmpp newUserInfoXmpp = new ReceivedXmpp(); @@ -518,30 +652,11 @@ public synchronized void sendReceivedMsg(Message message) { } } catch (Exception e) { e.printStackTrace(); - UdeskUtils.resetTime(); - UdeskConst.sdk_xmpp_statea = UdeskConst.CONNECTING; - reConnected(); + connection(); } } } - private synchronized void reConnected() { - new Thread(new Runnable() { - - @Override - public void run() { - try { - cancel(); - startLoginXmpp(); - } catch (Exception e) { - e.printStackTrace(); - } - - - } - }).start(); - } - /** * 断开连接 @@ -635,4 +750,37 @@ public synchronized boolean isConnection() { } return false; } + + public synchronized void connection() { + try { + UdeskSDKManager.getInstance().getSingleExecutor().submit(new Runnable() { + @Override + public void run() { + UdeskUtils.resetTime(); + UdeskConst.sdk_xmpp_statea = UdeskConst.CONNECTING; + cancel(); + startLoginXmpp(); + } + }); + } catch (Exception e) { + e.printStackTrace(); + } + } + + + public void cancleXmpp() { + try { + UdeskUtils.resetTime(); + UdeskConst.sdk_xmpp_statea = UdeskConst.CONNECTION_FAILED; + UdeskSDKManager.getInstance().getSingleExecutor().submit(new Runnable() { + @Override + public void run() { + cancel(); + } + }); + } catch (Exception e) { + e.printStackTrace(); + } + } + } diff --git a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/model/AgentGroupNode.java b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/model/AgentGroupNode.java index 22508a4d..c99ac5a9 100644 --- a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/model/AgentGroupNode.java +++ b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/model/AgentGroupNode.java @@ -1,27 +1,22 @@ package cn.udesk.model; +import java.io.Serializable; + +import udesk.core.utils.UdeskUtils; + /** * Created by sks on 2016/3/15. */ -public class AgentGroupNode { +public class AgentGroupNode implements Serializable { - String id; - String parentId; + String id;//menu_id + String parentId;//父级菜单id String item_name; - String has_next; - String group_id; - String link; - - public String getGroup_id() { - return group_id; - } - - public void setGroup_id(String group_id) { - this.group_id = group_id; - } + String has_next;//是否有下一个 + String link;//弃用 - public String getHas_next() { - return has_next; + public boolean getHas_next() { + return UdeskUtils.objectToBoolean(has_next); } public void setHas_next(String has_next) { diff --git a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/model/OptionsModel.java b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/model/OptionsModel.java index 6ca5edfb..bdffbb72 100644 --- a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/model/OptionsModel.java +++ b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/model/OptionsModel.java @@ -3,7 +3,6 @@ import java.io.Serializable; import java.util.List; -import cn.udesk.UdeskUtil; import udesk.core.utils.UdeskUtils; public class OptionsModel implements Serializable { @@ -13,15 +12,26 @@ public class OptionsModel implements Serializable { */ private static final long serialVersionUID = 1L; private Object id; - private Object enabled; - private Object text; - private Object desc; - private Object remark_option; - private List tags; + private Object enabled; //是否启用 + private Object text; //名称 + private Object desc;//选项(文本 表情 五星 有区别) + private Object remark_option;//备注 + private List tags;//标签 // boolean isCheck = false; + public OptionsModel() { + } + + public OptionsModel(Object id, Object enabled, Object text, Object desc, Object remark_option) { + this.id = id; + this.enabled = enabled; + this.text = text; + this.desc = desc; + this.remark_option = remark_option; + } + public int getId() { return UdeskUtils.objectToInt(id); } diff --git a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/model/SDKIMSetting.java b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/model/SDKIMSetting.java deleted file mode 100644 index 91f954ae..00000000 --- a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/model/SDKIMSetting.java +++ /dev/null @@ -1,298 +0,0 @@ -package cn.udesk.model; - -import cn.udesk.UdeskUtil; -import udesk.core.utils.UdeskUtils; - -/** - * Created by user on 2016/12/27. - */ - -public class SDKIMSetting { - - private Object code; - private Object message; - - //是否配置了引导页 - private Object enable_im_group; - //会话是否关闭 - private Object in_session; - //是否在工作时间 - private Object is_worktime; - private Object has_robot; - private Object enable_robot; - private Object enable_sdk_robot; - private Object enable_agent; - private Object enable_web_im_feedback; - private Object no_reply_hint; - private Object robot; - private Object investigation_when_leave; - private Object enable_im_survey; - //'msg', 'form' - private Object leave_message_type; - private Object vcall; - private Object vc_app_id; - private Object sdk_vcall; - - private Object agora_app_id; - private Object server_url; - private Object vcall_token_url; - private Object im_survey_show_type; - private Object leave_message_guide; - private Object show_robot_times; - private Object robot_name; - -// "vcall":true, -// "vc_app_id":"fbcc5d3df6dfa25c418910a3611020eb", -// "sdk_vcall":false - - - public String getLeave_message_type() { - - return UdeskUtils.objectToString(leave_message_type); - } - - public void setLeave_message_type(Object leave_message_type) { - this.leave_message_type = leave_message_type; - } - - public boolean isInvestigation_when_leave() { - if (investigation_when_leave instanceof Boolean) { - return (boolean) investigation_when_leave; - } - return false; - } - - public void setInvestigation_when_leave(Object investigation_when_leave) { - this.investigation_when_leave = investigation_when_leave; - } - - public Object getCode() { - return code; - } - - public void setCode(Object code) { - this.code = code; - } - - public Object getMessage() { - return message; - } - - public void setMessage(Object message) { - this.message = message; - } - - public boolean getEnable_im_group() { - if (enable_im_group instanceof Boolean) { - return (boolean) enable_im_group; - } - return false; - } - - public void setEnable_im_group(Object enable_im_group) { - this.enable_im_group = enable_im_group; - } - - public boolean getIn_session() { - if (in_session instanceof Boolean) { - return (boolean) in_session; - } - return false; - - } - - public void setIn_session(Object in_session) { - this.in_session = in_session; - } - - public boolean getIs_worktime() { - if (is_worktime instanceof Boolean) { - return (boolean) is_worktime; - } - return false; - } - - public void setIs_worktime(Object is_worktime) { - this.is_worktime = is_worktime; - } - - public boolean getHas_robot() { - if (has_robot instanceof Boolean) { - return (boolean) has_robot; - } - return false; - - } - - public void setHas_robot(Object has_robot) { - this.has_robot = has_robot; - } - - public boolean getEnable_robot() { - if (enable_robot instanceof Boolean) { - return (boolean) enable_robot; - } - return false; - } - - public void setEnable_robot(Object enable_robot) { - this.enable_robot = enable_robot; - } - - public boolean getEnable_sdk_robot() { - if (enable_sdk_robot instanceof Boolean) { - return (boolean) enable_sdk_robot; - } - return false; - } - - public void setEnable_sdk_robot(Object enable_sdk_robot) { - this.enable_sdk_robot = enable_sdk_robot; - } - - public String getEnable_agent() { - if (enable_agent instanceof Boolean) { - boolean transfer = (boolean) enable_agent; - if (transfer) { - return "true"; - } else { - return "false"; - } - } - return "false"; - } - - public Boolean getVcall() { - if (vcall instanceof Boolean) { - return (boolean) vcall; - } - return false; - } - - public void setVcall(Object vcall) { - this.vcall = vcall; - } - - public String getVc_app_id() { - if (vc_app_id instanceof String) { - return (String) vc_app_id; - } - return ""; - } - - public void setVc_app_id(Object vc_app_id) { - this.vc_app_id = vc_app_id; - } - - public Boolean getSdk_vcall() { - if (sdk_vcall instanceof Boolean) { - return (boolean) sdk_vcall; - } - return false; - } - - public void setSdk_vcall(Object sdk_vcall) { - this.sdk_vcall = sdk_vcall; - } - - public String getAgora_app_id() { - - - return UdeskUtils.objectToString(agora_app_id); - } - - public void setAgora_app_id(Object agora_app_id) { - this.agora_app_id = agora_app_id; - } - - public String getServer_url() { - return UdeskUtils.objectToString(server_url); - } - - public void setServer_url(Object server_url) { - this.server_url = server_url; - } - - public void setEnable_agent(Object enable_agent) { - this.enable_agent = enable_agent; - } - - public boolean getEnable_web_im_feedback() { - if (enable_web_im_feedback instanceof Boolean) { - return (boolean) enable_web_im_feedback; - } - return false; - } - - public void setEnable_web_im_feedback(Object enable_web_im_feedback) { - this.enable_web_im_feedback = enable_web_im_feedback; - } - - public boolean getEnable_im_survey() { - if (enable_im_survey instanceof Boolean) { - return (boolean) enable_im_survey; - } - return false; - } - - public void setEnable_im_survey(Object enable_im_survey) { - this.enable_im_survey = enable_im_survey; - } - - public String getNo_reply_hint() { - return UdeskUtils.objectToString(no_reply_hint); - } - - public void setNo_reply_hint(Object no_reply_hint) { - this.no_reply_hint = no_reply_hint; - } - - public String getRobot() { - - return UdeskUtils.objectToString(robot); - } - - public void setRobot(Object robot) { - this.robot = robot; - } - - public String getVcall_token_url() { - return UdeskUtils.objectToString(vcall_token_url); - } - - public void setVcall_token_url(Object vcall_token_url) { - this.vcall_token_url = vcall_token_url; - } - - public String getIm_survey_show_type() { - return UdeskUtils.objectToString(im_survey_show_type); - } - - public void setIm_survey_show_type(Object im_survey_show_type) { - this.im_survey_show_type = im_survey_show_type; - } - - public String getLeave_message_guide() { - return UdeskUtils.objectToString(leave_message_guide); - } - - public void setLeave_message_guide(Object leave_message_guide) { - this.leave_message_guide = leave_message_guide; - } - - public Object getShow_robot_times() { - return show_robot_times; - } - - public void setShow_robot_times(Object show_robot_times) { - this.show_robot_times = show_robot_times; - } - - public Object getRobot_name() { - return robot_name; - } - - public void setRobot_name(Object robot_name) { - this.robot_name = robot_name; - } -} diff --git a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/model/SurveyOptionsModel.java b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/model/SurveyOptionsModel.java index 0c1bb6ab..76dd4705 100644 --- a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/model/SurveyOptionsModel.java +++ b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/model/SurveyOptionsModel.java @@ -3,7 +3,6 @@ import java.io.Serializable; import java.util.List; -import cn.udesk.UdeskUtil; import udesk.core.utils.UdeskUtils; public class SurveyOptionsModel implements Serializable { @@ -14,15 +13,17 @@ public class SurveyOptionsModel implements Serializable { */ private static final long serialVersionUID = 1L; - private Object enabled; - private Object remark_enabled; - private Object remark; - private Object name; - private Object title; - private Object desc; + private Object enabled; //满意度开关 + private Object remark_enabled; //备注开关 + private Object remark; //备注内容 + private Object name; //评价名称 + private Object title;//评价标题 + private Object desc;//评价引导语 // text|expression|star - private Object show_type; + private Object show_type; //模式 private Object default_option_id; + //是不是机器人评价 + private boolean isRobot; List options; @@ -97,4 +98,12 @@ public List getOptions() { public void setOptions(List options) { this.options = options; } + + public boolean isRobot() { + return isRobot; + } + + public void setRobot(boolean robot) { + isRobot = robot; + } } diff --git a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/permission/RequestCode.java b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/permission/RequestCode.java index 02271ef4..cb19d281 100644 --- a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/permission/RequestCode.java +++ b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/permission/RequestCode.java @@ -6,6 +6,7 @@ public interface RequestCode { int AUDIO = 0x01;//语音 int EXTERNAL = 0x02;//存储 int CallPhone = 0x04;//电话 + int ASR = 0x05;//电话 int LOCATION = 0x08;//位置 // int AUDIO = 0x04;//语音 // int EXTERNAL = 0x08;//存储 diff --git a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/permission/XPermissionUtils.java b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/permission/XPermissionUtils.java index 2e4a0604..11cbc823 100644 --- a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/permission/XPermissionUtils.java +++ b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/permission/XPermissionUtils.java @@ -48,7 +48,9 @@ public static void requestPermissions(Activity activity, int requestCode, if (deniedPermissions.length > 0 && Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { requestPermissionsAgain(activity, permissions, requestCode); } else { - if (mOnPermissionListener != null) mOnPermissionListener.onPermissionGranted(); + if (mOnPermissionListener != null) { + mOnPermissionListener.onPermissionGranted(); + } } } catch (Exception e) { e.printStackTrace(); @@ -102,11 +104,15 @@ private static String[] getDeniedPermissions(Activity activity, String[] permiss @TargetApi(Build.VERSION_CODES.M) private static boolean hasAlwaysDeniedPermission(Activity activity, String... deniedPermissions) { try { - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) return false; + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { + return false; + } boolean rationale; for (String permission : deniedPermissions) { rationale = activity.shouldShowRequestPermissionRationale(permission); - if (!rationale) return true; + if (!rationale) { + return true; + } } } catch (Exception e) { e.printStackTrace(); diff --git a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/photoselect/LocalMedialLoader.java b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/photoselect/LocalMedialLoader.java index 8d467124..0b7f38d1 100644 --- a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/photoselect/LocalMedialLoader.java +++ b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/photoselect/LocalMedialLoader.java @@ -52,7 +52,9 @@ public class LocalMedialLoader { private String getDurationCondition(long exMaxLimit, long exMinLimit) { try { long maxS = videoMaxS == 0 ? Long.MAX_VALUE : videoMaxS; - if (exMaxLimit != 0) maxS = Math.min(maxS, exMaxLimit); + if (exMaxLimit != 0) { + maxS = Math.min(maxS, exMaxLimit); + } return String.format(Locale.CHINA, "%d <%s duration and duration <= %d", Math.max(exMinLimit, videoMinS), @@ -121,7 +123,7 @@ public void onLoadFinished(Loader loader, Cursor data) { files.add(file); allfiles.add(file); final int mediaMimeType = UdeskUtil.isPictureType(pictureType); - if (mediaMimeType == UdeskUtil.TYPE_VIDEO){ + if (mediaMimeType == UdeskUtil.TYPE_SHORT_VIDEO){ allvideos.add(file); } } while (data.moveToNext()); diff --git a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/photoselect/adapter/FolderAdapter.java b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/photoselect/adapter/FolderAdapter.java index f67df0ae..f95ebd4d 100644 --- a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/photoselect/adapter/FolderAdapter.java +++ b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/photoselect/adapter/FolderAdapter.java @@ -64,7 +64,8 @@ public void onBindViewHolder(RecyclerView.ViewHolder holder, final int position) final LocalMediaFolder folder = floders.get(position); try { if (folder != null) { - UdeskUtil.loadViewBySize(context, contentHolder.iv_picture, Uri.fromFile(new File(folder.getFirstFilePath())), UdeskUtil.dip2px(context, 80), UdeskUtil.dip2px(context, 80)); + UdeskUtil.loadViewBySize(context, contentHolder.iv_picture, Uri.fromFile(new File(folder.getFirstFilePath())), + UdeskUtil.dip2px(context, 80), UdeskUtil.dip2px(context, 80),false); contentHolder.name.setText(folder.getName()); contentHolder.count.setText(String.valueOf(folder.getNum())); if (position == 1) { diff --git a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/photoselect/adapter/PhotosAdapter.java b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/photoselect/adapter/PhotosAdapter.java index 34e44755..fcc8b46a 100644 --- a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/photoselect/adapter/PhotosAdapter.java +++ b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/photoselect/adapter/PhotosAdapter.java @@ -92,13 +92,14 @@ public void onClick(View view) { final int mediaMimeType = UdeskUtil.isPictureType(pictureType); Drawable drawable = ContextCompat.getDrawable(context, R.drawable.udesk_video_icon); UdeskUtil.modifyTextViewDrawable(contentHolder.tv_duration, drawable, 0); - contentHolder.tv_duration.setVisibility(mediaMimeType == UdeskUtil.TYPE_VIDEO ? View.VISIBLE : View.GONE); + contentHolder.tv_duration.setVisibility(mediaMimeType == UdeskUtil.TYPE_SHORT_VIDEO ? View.VISIBLE : View.GONE); long duration = image.getDuration(); contentHolder.tv_duration.setText(UdeskUtil.timeParse(duration)); if (disPlayWidth > 0) { - UdeskUtil.loadViewBySize(context, contentHolder.iv_picture, Uri.fromFile(new File(path)), disPlayWidth / 4, UdeskUtil.dip2px(context, 100)); + UdeskUtil.loadViewBySize(context, contentHolder.iv_picture, Uri.fromFile(new File(path)), + disPlayWidth / 4, UdeskUtil.dip2px(context, 100),false); } else { - UdeskUtil.loadNoChangeView(context, contentHolder.iv_picture, Uri.fromFile(new File(path))); + UdeskUtil.loadNoChangeView(context, contentHolder.iv_picture, Uri.fromFile(new File(path)),false); } contentHolder.iv_picture.setOnClickListener(new View.OnClickListener() { @Override diff --git a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/photoselect/adapter/PreviewPhotosAdapter.java b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/photoselect/adapter/PreviewPhotosAdapter.java index e1e4caad..c253c22d 100644 --- a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/photoselect/adapter/PreviewPhotosAdapter.java +++ b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/photoselect/adapter/PreviewPhotosAdapter.java @@ -66,7 +66,7 @@ public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) { if (image != null) { final int mediaMimeType = UdeskUtil.isPictureType(image.getPictureType()); UdeskUtil.loadImage(context, contentHolder.iv_picture, Uri.fromFile(new File(image.getPath()))); - contentHolder.video_tip.setVisibility(mediaMimeType == UdeskUtil.TYPE_VIDEO ? View.VISIBLE : View.GONE); + contentHolder.video_tip.setVisibility(mediaMimeType == UdeskUtil.TYPE_SHORT_VIDEO ? View.VISIBLE : View.GONE); contentHolder.iv_picture.setOnPhotoTapListener(new OnPhotoTapListener() { @Override public void onPhotoTap(View view, float x, float y) { diff --git a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/photoselect/adapter/PreviewPhotosFragmentAdapter.java b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/photoselect/adapter/PreviewPhotosFragmentAdapter.java index 93d8d2af..904b4d20 100644 --- a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/photoselect/adapter/PreviewPhotosFragmentAdapter.java +++ b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/photoselect/adapter/PreviewPhotosFragmentAdapter.java @@ -50,7 +50,7 @@ public void onBindViewHolder(RecyclerView.ViewHolder holder, final int position) final int mediaMimeType = UdeskUtil.isPictureType(type); Drawable drawable = ContextCompat.getDrawable(context, R.drawable.udesk_video_icon); UdeskUtil.modifyTextViewDrawable(contentHolder.tv_duration, drawable, 0); - contentHolder.tv_duration.setVisibility(mediaMimeType == UdeskUtil.TYPE_VIDEO ? View.VISIBLE : View.GONE); + contentHolder.tv_duration.setVisibility(mediaMimeType == UdeskUtil.TYPE_SHORT_VIDEO ? View.VISIBLE : View.GONE); UdeskUtil.loadViewBySize(context, contentHolder.iv_picture, Uri.fromFile(new File(path)), UdeskUtil.dip2px(context, 60), UdeskUtil.dip2px(context, 60)); if (checkedPosition == position) { contentHolder.v_selector.setVisibility(View.VISIBLE); diff --git a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/presenter/ChatActivityPresenter.java b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/presenter/ChatActivityPresenter.java deleted file mode 100644 index cdd60610..00000000 --- a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/presenter/ChatActivityPresenter.java +++ /dev/null @@ -1,2143 +0,0 @@ -package cn.udesk.presenter; - -import android.content.Context; -import android.graphics.Bitmap; -import android.graphics.BitmapFactory; -import android.os.Bundle; -import android.os.Message; -import android.text.TextUtils; -import android.util.Log; - -import com.qiniu.android.http.ResponseInfo; -import com.qiniu.android.storage.Configuration; -import com.qiniu.android.storage.KeyGenerator; -import com.qiniu.android.storage.Recorder; -import com.qiniu.android.storage.UpCancellationSignal; -import com.qiniu.android.storage.UpCompletionHandler; -import com.qiniu.android.storage.UploadManager; -import com.qiniu.android.storage.UploadOptions; -import com.qiniu.android.storage.persistent.FileRecorder; - -import org.json.JSONArray; -import org.json.JSONException; -import org.json.JSONObject; - -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Date; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ExecutorService; - -import cn.udesk.JsonUtils; -import cn.udesk.R; -import cn.udesk.UdeskSDKManager; -import cn.udesk.UdeskUtil; -import cn.udesk.activity.UdeskChatActivity; -import cn.udesk.activity.UdeskChatActivity.MessageWhat; -import cn.udesk.config.UdeskConfig; -import cn.udesk.db.UdeskDBManager; -import cn.udesk.messagemanager.Concurrents; -import cn.udesk.messagemanager.UdeskMessageManager; -import cn.udesk.model.LogMessage; -import cn.udesk.model.SurveyOptionsModel; -import cn.udesk.model.TicketReplieMode; -import cn.udesk.model.UdeskCommodityItem; -import udesk.core.UdeskCallBack; -import udesk.core.UdeskConst; -import udesk.core.UdeskHttpFacade; -import udesk.core.event.InvokeEventContainer; -import udesk.core.http.UdeskHttpCallBack; -import udesk.core.model.AgentInfo; -import udesk.core.model.MessageInfo; -import udesk.core.model.Product; -import udesk.core.utils.UdeskIdBuild; -import udesk.core.utils.UdeskUtils; -import udesk.core.xmpp.XmppInfo; - -public class ChatActivityPresenter { - - private IChatActivityView mChatView; - - private String customerId; - - //处理七牛上传完成的回调 - MyUpCompletionHandler mMyUpCompletionHandler = null; - UploadManager uploadManager = null; - - private List cachePreMsg = new ArrayList<>(); - - private String leavMsgId = ""; - - //保存发送中的消息, 收到回执后移除,或者messagesav两次成功后移除, - // 之后再ui界面上展示发送成功,否则显示转圈 - // 会轮询重发 - private Map sendingMsgCache = Collections.synchronizedMap(new LinkedHashMap()); - - public interface IUdeskHasSurvyCallBack { - - void hasSurvy(boolean hasSurvy); - } - - public ChatActivityPresenter(IChatActivityView chatview) { - this.mChatView = chatview; - bindEevent(); - } - - public void clearMsg() { - try { - if (cachePreMsg != null) { - cachePreMsg.clear(); - } - if (sendingMsgCache != null) { - sendingMsgCache.clear(); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - // ---------------以下是注册方法,通过观察者模式通知处理的逻辑部分 ,注册的方法,必须是public,方法得参数必须是class------------------- - private void bindEevent() { - UdeskMessageManager.getInstance().eventui_OnNewPresence.bind(this, "onPrenseMessage"); - UdeskMessageManager.getInstance().eventui_OnMessageReceived.bind(this, "onMessageReceived"); - UdeskMessageManager.getInstance().eventui_OnNewMessage.bind(this, "onNewMessage"); - InvokeEventContainer.getInstance().event_OncreateCustomer.bind(this, "onCreateCustomer"); - InvokeEventContainer.getInstance().event_OnIsBolcked.bind(this, "onIsBolck"); - UdeskMessageManager.getInstance().event_OnTicketReplayNotice.bind(this, "onTicketReplay"); - InvokeEventContainer.getInstance().event_OnVideoEventReceived.bind(this, "onVideoEvent"); - InvokeEventContainer.getInstance().event_OnSendMessageFail.bind(this, "onSendMessageFail"); - } - - //独立开bindEevent 是为了满足满意度调查的弹出,在可见的的时候弹出,在后台或遮挡了不出理 - public void bindReqsurveyMsg() { - UdeskMessageManager.getInstance().eventui_OnReqsurveyMsg.bind(this, "onReqsurveyMsg"); - } - - //独立开unBind - public void unbindReqsurveyMsg() { - UdeskMessageManager.getInstance().eventui_OnReqsurveyMsg.unBind(this); - } - - public void unBind() { - UdeskMessageManager.getInstance().eventui_OnNewPresence.unBind(this); - UdeskMessageManager.getInstance().eventui_OnMessageReceived.unBind(this); - UdeskMessageManager.getInstance().eventui_OnNewMessage.unBind(this); - InvokeEventContainer.getInstance().event_OncreateCustomer.unBind(this); - InvokeEventContainer.getInstance().event_OnIsBolcked.unBind(this); - UdeskMessageManager.getInstance().event_OnTicketReplayNotice.unBind(this); - InvokeEventContainer.getInstance().event_OnVideoEventReceived.unBind(this); - InvokeEventContainer.getInstance().event_OnSendMessageFail.unBind(this); - } - - public synchronized void onSendMessageFail(final MessageInfo msg) { - -// xmpp发送失败后 再次调用messageSave 触发后端代发xmpp - try { - if (TextUtils.isEmpty(customerId) || msg == null) { - return; - } - - UdeskHttpFacade.getInstance().messageSave(UdeskSDKManager.getInstance().getDomain(mChatView.getContext()), - UdeskSDKManager.getInstance().getAppkey(mChatView.getContext()), - UdeskSDKManager.getInstance().getSdkToken(mChatView.getContext()), - UdeskSDKManager.getInstance().getAppId(mChatView.getContext()), - customerId, mChatView.getAgentInfo().getAgent_id(), - msg.getSubsessionid(), UdeskConst.UdeskSendStatus.sending, - msg.getMsgtype(), msg.getMsgContent(), msg.getMsgId(), - msg.getDuration(), msg.getSeqNum(), msg.getFilename(), - msg.getFilesize(), UdeskUtils.getSecondTimestamp(new Date()) - UdeskConst.active_time, - UdeskConst.sdk_page_status + UdeskConst.sdk_xmpp_statea, new UdeskCallBack() { - @Override - public void onSuccess(String message) { - try { - MessageInfo cacheMsg = sendingMsgCache.get(msg.getMsgId()); -// 发送2次也算成功,有服务端代发通知客服 - if (cacheMsg != null && (cacheMsg.getCount() + 1) >= 2) { - onMessageReceived(msg.getMsgId()); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - @Override - public void onFail(String message) { - - } - }); - } catch (Exception e) { - e.printStackTrace(); - } - } - - public void onVideoEvent(String event, String id, String message, Boolean isInvite) { - - try { - if (event.equals(UdeskConst.ReceiveType.StartMedio)) { - MessageInfo messageInfo = buildVideoEventMsg(id, isInvite, message); - saveMessage(messageInfo); - } else if (event.equals(UdeskConst.ReceiveType.Cancle)) { - //取消 - UdeskDBManager.getInstance().updateMsgContent(id, - message); - MessageInfo eventMsg = UdeskDBManager.getInstance().getMessage(id); - mChatView.addMessage(eventMsg); - - } else if (event.equals(UdeskConst.ReceiveType.Busy)) { - message = mChatView.getAgentInfo().getAgentNick() + message; - UdeskDBManager.getInstance().updateMsgContent(id, message); - MessageInfo eventMsg = UdeskDBManager.getInstance().getMessage(id); - mChatView.addMessage(eventMsg); - } else if (event.equals(UdeskConst.ReceiveType.Timeout)) { - message = mChatView.getAgentInfo().getAgentNick() + message; - UdeskDBManager.getInstance().updateMsgContent(id, - message); - MessageInfo eventMsg = UdeskDBManager.getInstance().getMessage(id); - mChatView.addMessage(eventMsg); - } else if (event.equals(UdeskConst.ReceiveType.Reject)) { - UdeskDBManager.getInstance().updateMsgContent(id, - message); - MessageInfo eventMsg = UdeskDBManager.getInstance().getMessage(id); - mChatView.addMessage(eventMsg); - } else if (event.equals(UdeskConst.ReceiveType.Over)) { - UdeskDBManager.getInstance().updateMsgContent(id, - message); - MessageInfo eventMsg = UdeskDBManager.getInstance().getMessage(id); - mChatView.addMessage(eventMsg); - } - } catch (Exception e) { - e.printStackTrace(); - } - - } - - public MessageInfo buildVideoEventMsg(String id, Boolean isInvite, String text) { - MessageInfo msg = new MessageInfo(); - try { - msg.setCustomerId(UdeskUtils.objectToString(customerId)); - msg.setMsgtype(UdeskConst.ChatMsgTypeString.TYPE_Video_Txt); - msg.setTime(System.currentTimeMillis()); - msg.setMsgId(id); - if (isInvite) { - msg.setDirection(UdeskConst.ChatMsgDirection.Send); - } else { - msg.setDirection(UdeskConst.ChatMsgDirection.Recv); - msg.setmAgentJid(mChatView.getAgentInfo().getAgentJid()); - } - msg.setSendFlag(UdeskConst.SendFlag.RESULT_SUCCESS); - msg.setReadFlag(UdeskConst.ChatMsgReadFlag.read); - if (isInvite) { - msg.setMsgContent(text); - } else { - msg.setMsgContent(mChatView.getAgentInfo().getAgentNick() + text); - } - msg.setPlayflag(UdeskConst.PlayFlag.NOPLAY); - msg.setLocalPath(""); - msg.setDuration(0); - msg.setSubsessionid(mChatView.getAgentInfo().getIm_sub_session_id()); - msg.setSeqNum(UdeskDBManager.getInstance().getSubSessionId(mChatView.getAgentInfo().getIm_sub_session_id())); - } catch (Exception e) { - e.printStackTrace(); - } - return msg; - } - - /** - * 收到消息回执 - */ - public void onMessageReceived(String msgId) { - try { - UdeskDBManager.getInstance().updateMsgSendFlag(msgId, UdeskConst.SendFlag.RESULT_SUCCESS); - sendingMsgCache.remove(msgId); - if (mChatView.getHandler() != null) { - Message message = mChatView.getHandler().obtainMessage( - MessageWhat.changeImState); - message.obj = msgId; - message.arg1 = UdeskConst.SendFlag.RESULT_SUCCESS; - mChatView.getHandler().sendMessage(message); - } - } catch (Exception e) { - e.printStackTrace(); - } - - } - - /** - * 收到新消息 - */ - public void onNewMessage(MessageInfo msgInfo) { - - try { - if (mChatView.getHandler() != null) { - Message messge = mChatView.getHandler().obtainMessage( - MessageWhat.onNewMessage); - messge.obj = msgInfo; - mChatView.getHandler().sendMessage(messge); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - - /** - * 收到客服在线下线的通知 - */ - public void onPrenseMessage(String jid, Integer onlineFlag) { - try { - if (mChatView.getHandler() != null) { - Message messge = mChatView.getHandler().obtainMessage( - MessageWhat.status_notify); - messge.arg1 = onlineFlag; - messge.obj = jid; - mChatView.getHandler().sendMessage(messge); - } - } catch (Exception e) { - e.printStackTrace(); - } - - } - - //收到满意度调查消息 - public void onReqsurveyMsg(Boolean isSurvey) { - try { - if (mChatView != null) { - mChatView.changgeiSSurvyOperate(); - getIMSurveyOptions(null); - } - } catch (Exception e) { - e.printStackTrace(); - } - - } - - //加入黑名单通知 - public void onIsBolck(String isBolcked, String notice) { - try { - if (isBolcked.equals("true")) { - if (mChatView.getHandler() != null) { - Message messge = mChatView.getHandler().obtainMessage( - MessageWhat.IM_BOLACKED); - messge.obj = notice; - mChatView.getHandler().sendMessage(messge); - } - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - public void onTicketReplay(Boolean isTicketRepaly) { - //拉取工单回复的消息 - try { - if (!TextUtils.isEmpty(customerId)) { - getTicketReplies(customerId, 1, UdeskConst.UDESK_HISTORY_COUNT, ""); - } - } catch (Exception e) { - e.printStackTrace(); - } - - } - - //创建客户成功回调 - //说明 创建失败 stirng 是错误提示 - public void onCreateCustomer(String result, Boolean isJsonStr, String string) { - try { - if (result.equals("failure")) { - mChatView.showFailToast(string); - } else if (result.equals("succes")) { - //创建用户成功连接xmpp服务器 - if (isJsonStr) { - JSONObject resultJson = new JSONObject(string); - customerId = JsonUtils.parserCustomers(resultJson); - if (UdeskSDKManager.getInstance().getImSetting() != null && !UdeskSDKManager.getInstance().getImSetting().getIn_session()) { - boolean isShowPression = false; - String preTitle = ""; - if (resultJson.has("pre_session")) { - JSONObject preJson = resultJson.getJSONObject("pre_session"); - isShowPression = UdeskUtils.objectToBoolean(preJson.opt("show_pre_session")); - preTitle = UdeskUtils.objectToString(preJson.opt("pre_session_title")); - } - //在无消息对话过滤状态下,并且没有创建会话的情况下,先不请求agent,请求无消息会话创建接口 - if (isShowPression) { - Message handlerMsg = mChatView.getHandler().obtainMessage( - MessageWhat.pre_session_status); - handlerMsg.obj = preTitle; - mChatView.getHandler().sendMessage(handlerMsg); - getPressionInfo(); - updateUserInfo(customerId, false); - } else { - updateUserInfo(customerId, true); - } - } else { - updateUserInfo(customerId, true); - } - } - if (!TextUtils.isEmpty(customerId)) { - //拉取工单回复的消息 - getTicketReplies(customerId, 1, UdeskConst.UDESK_HISTORY_COUNT, ""); - } - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - // ---------------以上是注册方法,通过观察者模式通知处理的逻辑部分 注册的方法,必须是public,方法得参数必须是class------------------- - - - // ---------------以下是http请求接口 及处理逻辑 ------------------- - //请求获取客户信息的入口, 请求处理完后 会通知到onCreateCustomer 方法 - public void createIMCustomerInfo() { - try { - Context mContext = mChatView.getContext(); - String sdkToken = UdeskSDKManager.getInstance().getSdkToken(mContext); - UdeskHttpFacade.getInstance().setUserInfo(mContext, UdeskSDKManager.getInstance().getDomain(mContext), - UdeskSDKManager.getInstance().getAppkey(mContext), sdkToken, - UdeskSDKManager.getInstance().getUdeskConfig().defualtUserInfo, - UdeskSDKManager.getInstance().getUdeskConfig().definedUserTextField, - UdeskSDKManager.getInstance().getUdeskConfig().definedUserRoplist, - UdeskSDKManager.getInstance().getAppId(mContext), UdeskSDKManager.getInstance().getUdeskConfig().channel, null); - } catch (Exception e) { - e.printStackTrace(); - } - } - - - //无消息会话创建 - private void getPressionInfo() { - try { - UdeskHttpFacade.getInstance().getPreSessionsInfo( - UdeskSDKManager.getInstance().getDomain(mChatView.getContext()), - UdeskSDKManager.getInstance().getAppkey(mChatView.getContext()), - UdeskSDKManager.getInstance().getSdkToken(mChatView.getContext()), - mChatView.getAgentId(), mChatView.getGroupId(), false, - UdeskSDKManager.getInstance().getAppId(mChatView.getContext()), - new UdeskCallBack() { - - @Override - public void onSuccess(String message) { - try { - if (!UdeskMessageManager.getInstance().isConnection()) { - UdeskMessageManager.getInstance().connection(); - } - JSONObject json = new JSONObject(message); - if (json.has("pre_session_id")) { - mChatView.updatePreSessionStatus(json.optString("pre_session_id")); - } - } catch (Exception e) { - e.printStackTrace(); - } - - } - - @Override - public void onFail(String message) { - // 失败给出错误提示 结束流程 - try { - mChatView.showFailToast(message); - } catch (Exception e) { - e.printStackTrace(); - } - } - }); - } catch (Exception e) { - e.printStackTrace(); - } - - } - - //请求分配客服信息 - public void getAgentInfo(String preSessionId, JSONObject preMessage) { - try { - UdeskHttpFacade.getInstance().getAgentInfo( - UdeskSDKManager.getInstance().getDomain(mChatView.getContext()), - UdeskSDKManager.getInstance().getAppkey(mChatView.getContext()), - UdeskSDKManager.getInstance().getSdkToken(mChatView.getContext()), - mChatView.getAgentId(), mChatView.getGroupId(), false, - UdeskSDKManager.getInstance().getAppId(mChatView.getContext()), preSessionId, - preMessage, new UdeskCallBack() { - - @Override - public void onSuccess(String message) { - try { - AgentInfo agentInfo = JsonUtils.parseAgentResult(message); - if (agentInfo.getAgentCode() == 2000) { - getIMStatus(agentInfo); - } else { - mChatView.dealAgentInfo(agentInfo); - mChatView.updatePreSessionStatus(""); - } - if (!UdeskMessageManager.getInstance().isConnection()) { - UdeskMessageManager.getInstance().connection(); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - @Override - public void onFail(String message) { - try { - // 失败给出错误提示 结束流程 - mChatView.showFailToast(message); - mChatView.updatePreSessionStatus(""); - } catch (Exception e) { - e.printStackTrace(); - } - } - }); - } catch (Exception e) { - e.printStackTrace(); - } - - } - - /** - * 获取客服的在线状态,在线连接会话,离线显示客服离线提醒 - */ - public void getIMStatus(final AgentInfo agentInfo) { - try { - if (agentInfo == null) { - if (mChatView.getHandler() != null) { - Message message = mChatView.getHandler().obtainMessage( - MessageWhat.IM_STATUS); - message.obj = "off"; - mChatView.getHandler().sendMessage(message); - mChatView.updatePreSessionStatus(""); - } - return; - } - UdeskHttpFacade.getInstance().getIMstatus( - UdeskSDKManager.getInstance().getDomain(mChatView.getContext()), - UdeskSDKManager.getInstance().getAppkey(mChatView.getContext()), - UdeskSDKManager.getInstance().getSdkToken(mChatView.getContext()), - agentInfo.getAgentJid(), UdeskSDKManager.getInstance().getAppId(mChatView.getContext()), - new UdeskCallBack() { - @Override - public void onSuccess(String string) { - String imStatus = "off"; - try { - try { - JSONObject resultJson = new JSONObject(string); - if (resultJson.has("status")) { - imStatus = resultJson.getString("status"); - } - } catch (Exception e) { - imStatus = "off"; - } - if (imStatus.equals("on")) { - mChatView.dealAgentInfo(agentInfo); - mChatView.updatePreSessionStatus(""); - return; - } - mChatView.setAgentInfo(agentInfo); - if (mChatView.getHandler() != null) { - Message message = mChatView.getHandler().obtainMessage( - MessageWhat.IM_STATUS); - message.obj = imStatus; - mChatView.getHandler().sendMessage(message); - } - mChatView.updatePreSessionStatus(""); - } catch (Exception e) { - e.printStackTrace(); - } - } - - @Override - public void onFail(String s) { - try { - if (mChatView.getHandler() != null) { - Message message = mChatView.getHandler().obtainMessage( - MessageWhat.IM_STATUS); - message.obj = "off"; - mChatView.getHandler().sendMessage(message); - mChatView.updatePreSessionStatus(""); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - } - ); - } catch (Exception e) { - e.printStackTrace(); - } - } - - //收到转移客服消息后,请求被转移后的客服信息 - public void getRedirectAgentInfo(String agent_id, String group_id) { - try { - UdeskHttpFacade.getInstance().getAgentInfo( - UdeskSDKManager.getInstance().getDomain(mChatView.getContext()), - UdeskSDKManager.getInstance().getAppkey(mChatView.getContext()), - UdeskSDKManager.getInstance().getSdkToken(mChatView.getContext()), - agent_id, group_id, true, UdeskSDKManager.getInstance().getAppId(mChatView.getContext()), null, - null, new UdeskCallBack() { - - @Override - public void onSuccess(String message) { - // 获取客户成功,显示在线客服的信息,连接xmpp,进行会话 - try { - AgentInfo agentInfo = JsonUtils.parseAgentResult(message); - mChatView.dealRedirectAgentInfo(agentInfo); - } catch (Exception e) { - e.printStackTrace(); - } - } - - @Override - public void onFail(String message) { - // 失败给出错误提示 结束流程 - try { - mChatView.showFailToast(message); - } catch (Exception e) { - e.printStackTrace(); - } - } - }); - } catch (Exception e) { - e.printStackTrace(); - } - } - - // 返回指定客户的当前工单回复列表 - public void getTicketReplies(String customerId, int page, int perPage, String createTime) { - try { - UdeskHttpFacade.getInstance().getTicketReplies(UdeskSDKManager.getInstance().getDomain(mChatView.getContext()), - UdeskSDKManager.getInstance().getAppkey(mChatView.getContext()), customerId, - UdeskSDKManager.getInstance().getAppId(mChatView.getContext()), page, perPage, createTime, - new UdeskCallBack() { - @Override - public void onSuccess(String message) { - try { - TicketReplieMode replieMode = JsonUtils.parserTicketReplie(message); - if (replieMode != null && replieMode.getContents() != null) { - List messageInfos = buildLeaveMsgByTicketReplies(replieMode.getContents()); - if (messageInfos != null && mChatView.getHandler() != null) { - Message msg = Message.obtain(); - msg.what = MessageWhat.loadHistoryDBMsg; - msg.arg1 = UdeskChatActivity.PullEventModel; - msg.obj = messageInfos; - mChatView.getHandler().sendMessage(msg); - } - } - } catch (Exception e) { - e.printStackTrace(); - } - - } - - @Override - public void onFail(String message) { - - } - } - ); - } catch (Exception e) { - e.printStackTrace(); - } - } - - //提交留言消息 - public void putLeavesMsg(String customerId, String msg, final String msgId) { - try { - UdeskHttpFacade.getInstance().putReplies( - UdeskSDKManager.getInstance().getDomain(mChatView.getContext()), - UdeskSDKManager.getInstance().getAppkey(mChatView.getContext()), customerId, - UdeskSDKManager.getInstance().getAppId(mChatView.getContext()), msg, - new UdeskCallBack() { - @Override - public void onSuccess(String message) { - //修改消息状态 - try { - UdeskDBManager.getInstance().updateMsgSendFlag(msgId, UdeskConst.SendFlag.RESULT_SUCCESS); - onMessageReceived(msgId); - } catch (Exception e) { - e.printStackTrace(); - } - } - - @Override - public void onFail(String msg) { - try { - UdeskDBManager.getInstance().updateMsgSendFlag(msgId, UdeskConst.SendFlag.RESULT_FAIL); - if (mChatView.getHandler() != null) { - Message message = mChatView.getHandler().obtainMessage( - MessageWhat.changeImState); - message.obj = msgId; - message.arg1 = UdeskConst.SendFlag.RESULT_FAIL; - mChatView.getHandler().sendMessage(message); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - } - ); - } catch (Exception e) { - e.printStackTrace(); - } - } - - //更新用户信息 - private void updateUserInfo(final String userId, final boolean isNeedGetAgent) { - try { - if (TextUtils.isEmpty(userId)) { - if (isNeedGetAgent) { - getAgentInfo(null, null); - } - return; - } - UdeskConfig config = UdeskSDKManager.getInstance().getUdeskConfig(); - if (config.updateDefualtUserInfo != null - || config.updatedefinedUserTextField != null - || config.updatedefinedUserRoplist != null) { - UdeskHttpFacade.getInstance().updateUserInfo(config.updateDefualtUserInfo, - config.updatedefinedUserTextField, - config.updatedefinedUserRoplist, userId, - UdeskSDKManager.getInstance().getDomain(mChatView.getContext()), - UdeskSDKManager.getInstance().getAppkey(mChatView.getContext()), - UdeskSDKManager.getInstance().getAppId(mChatView.getContext()), - new UdeskCallBack() { - @Override - public void onSuccess(String message) { - try { - if (isNeedGetAgent) { - getAgentInfo(null, null); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - @Override - public void onFail(String message) { - try { - if (isNeedGetAgent) { - getAgentInfo(null, null); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - }); - } else { - if (isNeedGetAgent) { - getAgentInfo(null, null); - } - } - } catch (Exception e) { - e.printStackTrace(); - if (isNeedGetAgent) { - getAgentInfo(null, null); - } - } - - } - - //客户主动发起满意度调查,先获取是否评价 - public void getHasSurvey(String agent_id, final IUdeskHasSurvyCallBack hasSurvyCallBack) { - try { - if (TextUtils.isEmpty(customerId)) { - mChatView.setIsPermmitSurvy(true); - return; - } - UdeskHttpFacade.getInstance().hasSurvey( - UdeskSDKManager.getInstance().getDomain(mChatView.getContext()), - UdeskSDKManager.getInstance().getAppkey(mChatView.getContext()), - UdeskSDKManager.getInstance().getSdkToken(mChatView.getContext()), - agent_id, customerId, - UdeskSDKManager.getInstance().getAppId(mChatView.getContext()), - new UdeskCallBack() { - - @Override - public void onSuccess(String message) { - try { - JSONObject result = new JSONObject(message); - if (result.has("code") && result.getInt("code") == 1000) { - if (result.has("has_survey")) { - if (TextUtils.equals(result.getString("has_survey"), "false")) { - //未评价,可以发起评价 - getIMSurveyOptions(hasSurvyCallBack); - } else { - //已评价,给出提示 - mChatView.setIsPermmitSurvy(true); - if (hasSurvyCallBack != null) { - hasSurvyCallBack.hasSurvy(true); - } else { - if (mChatView.getHandler() != null) { - Message messge = mChatView.getHandler().obtainMessage( - MessageWhat.Has_Survey); - mChatView.getHandler().sendMessage(messge); - } - } - - } - } - } else { - if (hasSurvyCallBack != null) { - hasSurvyCallBack.hasSurvy(true); - } else { - //出错给提示 - sendSurveyerror(); - } - - } - } catch (Exception e) { - if (hasSurvyCallBack != null) { - hasSurvyCallBack.hasSurvy(true); - } else { - //出错给提示 - sendSurveyerror(); - } - } - } - - @Override - public void onFail(String message) { - try { - if (hasSurvyCallBack != null) { - hasSurvyCallBack.hasSurvy(true); - } else { - //出错给提示 - sendSurveyerror(); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - } - ); - } catch (Exception e) { - e.printStackTrace(); - sendSurveyerror(); - } - } - - //请求满意度调查选项的内容 - private void getIMSurveyOptions(final IUdeskHasSurvyCallBack hasSurvyCallBack) { - try { - UdeskHttpFacade.getInstance().getIMSurveyOptionsNew( - UdeskSDKManager.getInstance().getDomain(mChatView.getContext()), - UdeskSDKManager.getInstance().getAppkey(mChatView.getContext()), - UdeskSDKManager.getInstance().getSdkToken(mChatView.getContext()), - UdeskSDKManager.getInstance().getAppId(mChatView.getContext()), new UdeskCallBack() { - - @Override - public void onSuccess(String message) { - try { - SurveyOptionsModel model = JsonUtils.parseSurveyOptions(message); - if (model != null && (model.getOptions() == null || model.getOptions().isEmpty()) && hasSurvyCallBack != null) { - hasSurvyCallBack.hasSurvy(true); - } else if (mChatView.getHandler() != null) { - Message messge = mChatView.getHandler().obtainMessage( - MessageWhat.surveyNotify); - messge.obj = model; - mChatView.getHandler().sendMessage(messge); - } else if (hasSurvyCallBack != null) { - hasSurvyCallBack.hasSurvy(true); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - @Override - public void onFail(String message) { - try { - if (hasSurvyCallBack != null) { - hasSurvyCallBack.hasSurvy(true); - } else { - sendSurveyerror(); - } - } catch (Exception e) { - e.printStackTrace(); - } - - } - }); - } catch (Exception e) { - e.printStackTrace(); - if (hasSurvyCallBack != null) { - hasSurvyCallBack.hasSurvy(true); - } else { - sendSurveyerror(); - } - } - } - - //提交调查选项内容 - public void putIMSurveyResult(String optionId, String show_type, String survey_remark, String tags) { - if (TextUtils.isEmpty(customerId)) { - try { - mChatView.setIsPermmitSurvy(true); - } catch (Exception e) { - e.printStackTrace(); - } - return; - } - try { - UdeskHttpFacade.getInstance().putSurveyVote( - UdeskSDKManager.getInstance().getDomain(mChatView.getContext()), - UdeskSDKManager.getInstance().getAppkey(mChatView.getContext()), - UdeskSDKManager.getInstance().getSdkToken(mChatView.getContext()), - mChatView.getAgentInfo().getAgent_id(), customerId, - optionId, UdeskSDKManager.getInstance().getAppId(mChatView.getContext()), - mChatView.getAgentInfo().getIm_sub_session_id(), show_type, - survey_remark, tags, new UdeskCallBack() { - - @Override - public void onSuccess(String string) { - try { - Message message = mChatView.getHandler().obtainMessage( - MessageWhat.Survey_Success); - mChatView.getHandler().sendMessage(message); - } catch (Exception e) { - e.printStackTrace(); - } - } - - @Override - public void onFail(String message) { - sendSurveyerror(); - } - }); - } catch (Exception e) { - e.printStackTrace(); - } - } - - //客户端返回会话界面,在排队中通知移除排队 - public void quitQuenu(String quitMode) { - try { - UdeskHttpFacade.getInstance().quitQueue( - UdeskSDKManager.getInstance().getDomain(mChatView.getContext()), - UdeskSDKManager.getInstance().getAppkey(mChatView.getContext()), - UdeskSDKManager.getInstance().getSdkToken(mChatView.getContext()), - UdeskSDKManager.getInstance().getAppId(mChatView.getContext()), - quitMode, new UdeskCallBack() { - - @Override - public void onSuccess(String message) { - - } - - @Override - public void onFail(String message) { - - } - }); - } catch (Exception e) { - e.printStackTrace(); - } - } - - // ---------------以上是http请求接口 及处理逻辑 ------------------- - - - // ---------------以下是发送消息的业务逻辑 ------------------- - - //发送文本消息 - public void sendTxtMessage() { - try { - if (!TextUtils.isEmpty(mChatView.getInputContent().toString().trim())) { - sendTxtMessage(mChatView.getInputContent().toString()); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - private boolean isNeedAddCachePre(MessageInfo msg) { - try { - if (mChatView.getPressionStatus(msg)) { - cachePreMsg.add(msg); - return true; - } - } catch (Exception e) { - e.printStackTrace(); - } - return false; - } - - //封装发送文本消息 - public void sendTxtMessage(String msgString) { - try { - MessageInfo msg = buildSendMessage( - UdeskConst.ChatMsgTypeString.TYPE_TEXT, - System.currentTimeMillis(), msgString, "", "", ""); - saveMessage(msg); - mChatView.clearInputContent(); - mChatView.addMessage(msg); - if (isNeedAddCachePre(msg)) { - return; - } - if (mChatView.isNeedQueueMessageSave()) { - queueMessageSave(msg); - return; - } - messageSave(msg); - } catch (Exception e) { - e.printStackTrace(); - } - } - - public void sendProductMessage(Product mProduct) { - - if (mProduct == null) { - return; - } - - JSONObject jsonObject = new JSONObject(); - try { - if (!TextUtils.isEmpty(mProduct.getName())) { - jsonObject.put("name", mProduct.getName()); - } - if (!TextUtils.isEmpty(mProduct.getUrl())) { - jsonObject.put("url", mProduct.getUrl()); - } - if (!TextUtils.isEmpty(mProduct.getImgUrl())) { - jsonObject.put("imgUrl", mProduct.getImgUrl()); - } - - List params = mProduct.getParams(); - if (params != null && params.size() > 0) { - JSONArray jsonsArray = new JSONArray(); - for (Product.ParamsBean paramsBean : params) { - JSONObject param = new JSONObject(); - param.put("text", paramsBean.getText()); - param.put("color", paramsBean.getColor()); - param.put("fold", paramsBean.isFold()); - param.put("break", paramsBean.isBreakX()); - param.put("size", paramsBean.getSize()); - jsonsArray.put(param); - } - - jsonObject.put("params", jsonsArray); - } - - MessageInfo msg = buildSendMessage( - UdeskConst.ChatMsgTypeString.TYPE_PRODUCT, - System.currentTimeMillis(), jsonObject.toString(), "", "", ""); - saveMessage(msg); - mChatView.addMessage(msg); - if (isNeedAddCachePre(msg)) { - return; - } - if (mChatView.isNeedQueueMessageSave()) { - queueMessageSave(msg); - return; - } - messageSave(msg); - } catch (Exception e) { - e.printStackTrace(); - } - } - - //发送原图图片消息 - public void sendBitmapMessage(Bitmap bitmap) { - if (bitmap == null) { - return; - } - try { - int width = bitmap.getWidth(); - int height = bitmap.getHeight(); - int max = Math.max(width, height); - - BitmapFactory.Options factoryOptions = new BitmapFactory.Options(); - factoryOptions.inJustDecodeBounds = false; - factoryOptions.inPurgeable = true; - // 获取原图数据 - ByteArrayOutputStream stream = new ByteArrayOutputStream(); - bitmap.compress(Bitmap.CompressFormat.JPEG, 100, stream); - byte[] data = stream.toByteArray(); - - String imageName = UdeskUtils.MD5(data); - File scaleImageFile = new File(UdeskUtils.getDirectoryPath(mChatView.getContext(), UdeskConst.FileImg) + File.separator + UdeskConst.ORIGINAL_SUFFIX); - if (scaleImageFile != null) { - if (max > UdeskSDKManager.getInstance().getUdeskConfig().ScaleMax) { - factoryOptions.inSampleSize = max / UdeskSDKManager.getInstance().getUdeskConfig().ScaleMax; - } else { - factoryOptions.inSampleSize = 1; - } - FileOutputStream fos; - try { - fos = new FileOutputStream(scaleImageFile); - bitmap = BitmapFactory.decodeByteArray(data, 0, data.length, - factoryOptions); - bitmap.compress(Bitmap.CompressFormat.JPEG, 80, fos); - fos.close(); - } catch (Exception e) { - e.printStackTrace(); - return; - } - bitmap.recycle(); - bitmap = null; - if (TextUtils.isEmpty(scaleImageFile.getPath())) { - UdeskUtils.showToast(mChatView.getContext(), mChatView.getContext().getString(R.string.udesk_upload_img_error)); - return; - } - MessageInfo msg = buildSendMessage( - UdeskConst.ChatMsgTypeString.TYPE_IMAGE, - System.currentTimeMillis(), "", scaleImageFile.getPath(), "", ""); - saveMessage(msg); - mChatView.addMessage(msg); - upLoadFile(msg.getLocalPath(), msg); - } - - } catch (Exception e) { - e.printStackTrace(); - } catch (OutOfMemoryError error) { - error.printStackTrace(); - } - - } - - //发送文件类的消息( 包含视频 文件 图片) - - /** - * @param filepath - * @param msgType 图片:UdeskConst.ChatMsgTypeString.TYPE_IMAGE - * 文件:UdeskConst.ChatMsgTypeString.TYPE_File - * MP4视频: UdeskConst.ChatMsgTypeString.TYPE_VIDEO - */ - public void sendFileMessage(String filepath, String msgType) { - try { - if (TextUtils.isEmpty(filepath)) { - return; - } - String fileName = (UdeskUtils.getFileName(filepath, msgType)); - String fileSzie = UdeskUtils.getFileSizeByLoaclPath(filepath); - MessageInfo msg = buildSendMessage( - msgType, - System.currentTimeMillis(), "", filepath, fileName, fileSzie); - saveMessage(msg); - mChatView.addMessage(msg); - upLoadFile(filepath, msg); - } catch (Exception e) { - e.printStackTrace(); - } catch (OutOfMemoryError error) { - error.printStackTrace(); - } - } - - /** - * 发送地理位置信息 - * - * @param lat - * @param longitude - * @param localvalue - * @param bitmapDir - */ - public void sendLocationMessage(double lat, double longitude, String localvalue, String bitmapDir) { - try { - StringBuilder builder = new StringBuilder(); - builder.append(lat).append(";").append(longitude).append(";").append("16;").append(localvalue); - MessageInfo msg = buildSendMessage( - UdeskConst.ChatMsgTypeString.TYPE_Location, - System.currentTimeMillis(), builder.toString(), bitmapDir, "", ""); - saveMessage(msg); - mChatView.addMessage(msg); - if (isNeedAddCachePre(msg)) { - return; - } - if (mChatView.isNeedQueueMessageSave()) { - queueMessageSave(msg); - return; - } - messageSave(msg); - } catch (Exception e) { - e.printStackTrace(); - } - } - - - // 发送录音信息 - public void sendRecordAudioMsg(String audiopath, long duration) { - try { - String fileName = (UdeskUtils.getFileName(audiopath, UdeskConst.FileAduio)); - MessageInfo msg = buildSendMessage( - UdeskConst.ChatMsgTypeString.TYPE_AUDIO, - System.currentTimeMillis(), "", audiopath, fileName, ""); - duration = duration / 1000 + 1; - msg.setDuration(duration); - saveMessage(msg); - mChatView.addMessage(msg); - upLoadFile(audiopath, msg); - } catch (Exception e) { - e.printStackTrace(); - } - } - - //发送商品链接广告 - public void sendCommodityMessage(UdeskCommodityItem commodityItem) { - try { - UdeskMessageManager.getInstance().sendComodityMessage(buildCommodityMessage(commodityItem), - mChatView.getAgentInfo().getAgentJid()); - } catch (Exception e) { - e.printStackTrace(); - } - } - - //构造广告消息的格式 - private String buildCommodityMessage(UdeskCommodityItem item) { - JSONObject root = new JSONObject(); - try { - JSONObject dataJson = new JSONObject(); - JSONObject paramsJson = new JSONObject(); - paramsJson.put("detail", item.getSubTitle()); - dataJson.put("url", item.getCommodityUrl()); - dataJson.put("image", item.getThumbHttpUrl()); - dataJson.put("title", item.getTitle()); - dataJson.put("product_params", paramsJson); - root.put("type", "product"); - root.put("platform", "android"); - root.put("data", dataJson); - } catch (Exception e) { - e.printStackTrace(); - } - return root.toString(); - } - - - //发送输入预支消息 - public void sendPreMessage() { - try { - UdeskMessageManager.getInstance().sendPreMsg(UdeskConst.ChatMsgTypeString.TYPE_TEXT, - mChatView.getInputContent().toString(), mChatView.getAgentInfo().getAgentJid()); - } catch (Exception e) { - e.printStackTrace(); - } - } - - - //发送留言消息 - public void sendLeaveMessage() { - try { - if (TextUtils.isEmpty(customerId)) { - return; - } - if (!TextUtils.isEmpty(mChatView.getInputContent().toString().trim())) { - String msgString = mChatView.getInputContent().toString(); - MessageInfo msg = buildSendMessage( - UdeskConst.ChatMsgTypeString.TYPE_LEAVEMSG, - System.currentTimeMillis(), msgString, "", "", ""); - saveMessage(msg); - mChatView.clearInputContent(); - mChatView.addMessage(msg); - putLeavesMsg(customerId, msgString, msg.getMsgId()); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - //发送留言消息 - public void sendLeaveMessage(String message) { - try { - if (TextUtils.isEmpty(customerId)) { - return; - } - MessageInfo msg = buildSendMessage( - UdeskConst.ChatMsgTypeString.TYPE_LEAVEMSG, - System.currentTimeMillis(), message, "", "", ""); - saveMessage(msg); - mChatView.addMessage(msg); - putLeavesMsg(customerId, message, msg.getMsgId()); - } catch (Exception e) { - e.printStackTrace(); - } - } - - //拉取消息 - public void pullMessages(final int seqNum, final String subSessionId) { - try { - if (TextUtils.isEmpty(customerId)) { - return; - } - UdeskHttpFacade.getInstance().getMessages(UdeskSDKManager.getInstance().getDomain(mChatView.getContext()), - UdeskSDKManager.getInstance().getAppkey(mChatView.getContext()), - UdeskSDKManager.getInstance().getSdkToken(mChatView.getContext()), - UdeskSDKManager.getInstance().getAppId(mChatView.getContext()), - customerId, subSessionId, seqNum, new UdeskCallBack() { - @Override - public void onSuccess(String message) { - try { - JSONObject root = new JSONObject(message); - String code = UdeskUtils.objectToString(root.opt("code")); - if (code.equals("1002")) { - int request_delay_time = UdeskUtils.objectToInt(root.opt("request_delay_time")); - mChatView.getHandler().postDelayed(new Runnable() { - @Override - public void run() { - pullMessages(seqNum, subSessionId); - } - }, request_delay_time * 1000); - } else { - List logMessages = JsonUtils.parseMessages(message); - if (logMessages != null && logMessages.size() > 0) { - List msgInfos = tranferLogMessage(logMessages); - if (msgInfos.size() > 0) { - UdeskDBManager.getInstance().addAllMessageInfo(msgInfos); - mChatView.initLoadData(); - } - } - } - } catch (Exception e) { - e.printStackTrace(); - } - - - } - - @Override - public void onFail(String message) { - - } - }); - } catch (Exception e) { - e.printStackTrace(); - } - } - - - //htpp 方式保存消息到后台 - public synchronized void messageSave(final MessageInfo msg) { - try { - if (TextUtils.isEmpty(customerId) || msg == null) { - return; - } - if (mChatView != null && mChatView.getAgentInfo() != null){ - if (!TextUtils.isEmpty(mChatView.getAgentInfo().getAgentJid())){ - msg.setmAgentJid(mChatView.getAgentInfo().getAgentJid()); - } - if (!TextUtils.isEmpty(mChatView.getAgentInfo().getIm_sub_session_id())){ - msg.setSubsessionid(mChatView.getAgentInfo().getIm_sub_session_id()); - } - } - sendingMsgCache.put(msg.getMsgId(), msg); - UdeskHttpFacade.getInstance().messageSave(UdeskSDKManager.getInstance().getDomain(mChatView.getContext()), - UdeskSDKManager.getInstance().getAppkey(mChatView.getContext()), - UdeskSDKManager.getInstance().getSdkToken(mChatView.getContext()), - UdeskSDKManager.getInstance().getAppId(mChatView.getContext()), - customerId, mChatView.getAgentInfo().getAgent_id(), - msg.getSubsessionid(), UdeskConst.UdeskSendStatus.sending, - msg.getMsgtype(), msg.getMsgContent(), msg.getMsgId(), - msg.getDuration(), msg.getSeqNum(), msg.getFilename(), msg.getFilesize(), - UdeskUtils.getSecondTimestamp(new Date()) - UdeskConst.active_time, - UdeskConst.sdk_page_status + UdeskConst.sdk_xmpp_statea, new UdeskCallBack() { - @Override - public void onSuccess(String message) { - try { - MessageInfo messageInfo = sendingMsgCache.get(msg.getMsgId()); - if (messageInfo != null) { - messageInfo.setCount(); - } - // 发给当前的客服 - msg.setNoNeedSave(true); - UdeskMessageManager.getInstance().sendMessage(msg); - - JSONObject jsonObject = new JSONObject(message); - if (jsonObject.has("agent_seq_num")) { - int agent_seq_num = jsonObject.optInt("agent_seq_num"); - //返回客服消息序列 大于本地存储的, 有丢失消息, 需要拉取消息 - if (agent_seq_num > mChatView.getAgentSeqNum()) { - pullMessages(0, msg.getSubsessionid()); - } - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - @Override - public void onFail(String message) { - // 发给当前的客服 - try { - if (TextUtils.equals("8002", message)) { - sendingMsgCache.remove(msg.getMsgId()); - updateFailureStatus(msg); - if (mChatView.getHandler() != null) { - mChatView.getHandler().sendEmptyMessage(MessageWhat.RECREATE_CUSTOMER_INFO); - } - return; - } - if (mChatView != null && mChatView.getAgentInfo() != null) { - msg.setmAgentJid(mChatView.getAgentInfo().getAgentJid()); - } - msg.setNoNeedSave(false); - UdeskMessageManager.getInstance().sendMessage(msg); - } catch (Exception e) { - e.printStackTrace(); - } - } - }); - } catch (Exception e) { - e.printStackTrace(); - } - } - - - //htpp 方式保存消息到后台 - public void queueMessageSave(final MessageInfo msg) { - try { - if (TextUtils.isEmpty(customerId)) { - return; - } - - UdeskHttpFacade.getInstance().queueMessageSave(UdeskSDKManager.getInstance().getDomain(mChatView.getContext()), - UdeskSDKManager.getInstance().getAppkey(mChatView.getContext()), - UdeskSDKManager.getInstance().getSdkToken(mChatView.getContext()), - UdeskSDKManager.getInstance().getAppId(mChatView.getContext()), - customerId, msg.getMsgtype(), msg.getMsgContent(), msg.getMsgId(), - msg.getDuration(), msg.getSeqNum(), msg.getFilename(), msg.getFilesize(), new UdeskCallBack() { - @Override - public void onSuccess(String message) { - - try { - JSONObject resultJson = new JSONObject(message); - if (resultJson.has("code")) { - int status = resultJson.getInt("code"); - if (status == 1000) { - //保存成功 - UdeskDBManager.getInstance().updateMsgSendFlag(msg.getMsgId(), UdeskConst.SendFlag.RESULT_SUCCESS); - onMessageReceived(msg.getMsgId()); - } else if (status == 9200) { - String tipMsg = resultJson.getString("message"); - mChatView.isMoreThan(true, tipMsg); - updateFailureStatus(msg); - } else { - updateFailureStatus(msg); - } - } - } catch (JSONException e) { - e.printStackTrace(); - } - - - } - - @Override - public void onFail(String error) { - - updateFailureStatus(msg); - } - }); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void updateFailureStatus(MessageInfo msg) { - try { - if (msg == null) { - return; - } - UdeskDBManager.getInstance().updateMsgSendFlag(msg.getMsgId(), UdeskConst.SendFlag.RESULT_FAIL); - if (mChatView.getHandler() != null) { - Message message = mChatView.getHandler().obtainMessage( - MessageWhat.changeImState); - message.obj = msg.getMsgId(); - message.arg1 = UdeskConst.SendFlag.RESULT_FAIL; - mChatView.getHandler().sendMessage(message); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - //构建消息模型 - public MessageInfo buildSendMessage(String msgType, long time, String text, - String location, String fileName, String fileSize) { - MessageInfo msg = new MessageInfo(); - try { - msg.setCustomerId(UdeskUtils.objectToString(customerId)); - msg.setMsgtype(msgType); - msg.setTime(time); - msg.setmAgentJid(mChatView.getAgentInfo().getAgentJid()); - msg.setMsgId(UdeskIdBuild.buildMsgId()); - msg.setDirection(UdeskConst.ChatMsgDirection.Send); - msg.setSendFlag(UdeskConst.SendFlag.RESULT_SEND); - msg.setReadFlag(UdeskConst.ChatMsgReadFlag.read); - msg.setMsgContent(text); - msg.setPlayflag(UdeskConst.PlayFlag.NOPLAY); - msg.setLocalPath(location); - msg.setDuration(0); - msg.setSubsessionid(mChatView.getAgentInfo().getIm_sub_session_id()); - msg.setSeqNum(UdeskDBManager.getInstance().getSubSessionId(mChatView.getAgentInfo().getIm_sub_session_id())); - msg.setFilename(fileName); - msg.setFilesize(fileSize); - } catch (Exception e) { - e.printStackTrace(); - } - return msg; - } - - //构建工单回复的消息转换消息模型 - public List buildLeaveMsgByTicketReplies(List contents) { - List msgInfos = new ArrayList(); - try { - if (contents != null && contents.size() > 0) { - MessageInfo eventMsg = new MessageInfo(); - eventMsg.setMsgtype(UdeskConst.ChatMsgTypeString.TYPE_EVENT); - eventMsg.setTime(System.currentTimeMillis()); - eventMsg.setMsgId(UdeskIdBuild.buildMsgId()); - eventMsg.setDirection(UdeskConst.ChatMsgDirection.Recv); - eventMsg.setSendFlag(UdeskConst.SendFlag.RESULT_SUCCESS); - eventMsg.setReadFlag(UdeskConst.ChatMsgReadFlag.read); - eventMsg.setMsgContent(mChatView.getContext().getString(R.string.udesk_offline_reply_msg)); - eventMsg.setCreatedTime(contents.get(0).getReply_created_at()); - Collections.reverse(contents); - boolean isAddEvent = false; - for (TicketReplieMode.ContentsBean contentsBean : contents) { - if (contentsBean != null && !UdeskDBManager.getInstance().hasReceviedMsg(String.valueOf(contentsBean.getReply_id()))) { - MessageInfo msg = new MessageInfo(); - msg.setMsgtype(UdeskConst.ChatMsgTypeString.TYPE_LEAVEMSG); - msg.setTime(System.currentTimeMillis()); - msg.setMsgId(String.valueOf(contentsBean.getReply_id())); - msg.setDirection(UdeskConst.ChatMsgDirection.Recv); - msg.setSendFlag(UdeskConst.SendFlag.RESULT_SUCCESS); - msg.setReadFlag(UdeskConst.ChatMsgReadFlag.read); - msg.setMsgContent(contentsBean.getReply_content()); - msg.setPlayflag(UdeskConst.PlayFlag.NOPLAY); - msg.setLocalPath(""); - msg.setDuration(0); - msg.setUser_avatar(contentsBean.getUser_avatar()); - msg.setCreatedTime(contentsBean.getReply_created_at()); - msg.setUpdateTime(contentsBean.getReply_updated_at()); - msg.setReplyUser(contentsBean.getReply_user()); - msgInfos.add(msg); - UdeskDBManager.getInstance().addMessageInfo(msg); - isAddEvent = true; - } - } - if (isAddEvent) { - msgInfos.add(0, eventMsg); - UdeskDBManager.getInstance().addMessageInfo(eventMsg); - } - } - } catch (Exception e) { - e.printStackTrace(); - } - return msgInfos; - } - - public List tranferLogMessage(List logMessages) { - List msgInfos = new ArrayList(); - try { - for (LogMessage logMessage : logMessages) { - if (UdeskUtils.objectToString(logMessage.getSend_status()).equals("rollback") || UdeskUtils.objectToString(logMessage.getStatus()).equals("system")) { - continue; - } - MessageInfo messageInfo = new MessageInfo(); - messageInfo.setMsgtype(UdeskUtils.objectToString(logMessage.getType())); - messageInfo.setTime(UdeskUtil.stringToLong(UdeskUtils.objectToString(logMessage.getCreated_at()))); - messageInfo.setMsgId(UdeskUtils.objectToString(logMessage.getMessage_id())); - if (UdeskUtils.objectToString(logMessage.getReply_user_type()).equals("agent")) { - messageInfo.setDirection(UdeskConst.ChatMsgDirection.Recv); - } else { - messageInfo.setDirection(UdeskConst.ChatMsgDirection.Send); - } - messageInfo.setSendFlag(UdeskConst.SendFlag.RESULT_SUCCESS); - messageInfo.setReadFlag(UdeskConst.ChatMsgReadFlag.read); - messageInfo.setMsgContent(UdeskUtils.objectToString(logMessage.getContent())); - messageInfo.setPlayflag(UdeskConst.PlayFlag.NOPLAY); - messageInfo.setLocalPath(""); - messageInfo.setDuration(UdeskUtils.objectToInt(logMessage.getDuration())); - messageInfo.setSeqNum(UdeskUtils.objectToInt(logMessage.getSeq_num())); - messageInfo.setSubsessionid(UdeskUtils.objectToString(logMessage.getIm_sub_session_id())); - messageInfo.setReplyUser(UdeskUtils.objectToString(logMessage.getAgent_nick_name())); - messageInfo.setUser_avatar(UdeskUtils.objectToString(logMessage.getAgent_avatar())); - messageInfo.setFilesize(UdeskUtils.objectToString(logMessage.getFileSize())); - messageInfo.setFilename(UdeskUtils.objectToString(logMessage.getFileName())); - msgInfos.add(messageInfo); - } - } catch (Exception e) { - e.printStackTrace(); - } - return msgInfos; - } - - //增加一条客户留言事件 - public void addCustomerLeavMsg() { - try { - MessageInfo msg = buildSendMessage( - UdeskConst.ChatMsgTypeString.TYPE_EVENT, - System.currentTimeMillis(), mChatView.getContext().getString(R.string.udesk_customer_leavemsg), "", "", ""); - msg.setSendFlag(UdeskConst.SendFlag.RESULT_SUCCESS); - saveMessage(msg); - addEventMsg(msg); - } catch (Exception e) { - e.printStackTrace(); - } - } - - public void addLeavMsgWeclome(String content) { - try { - if (TextUtils.isEmpty(content)) { - return; - } - MessageInfo msg = new MessageInfo(); - msg.setMsgtype(UdeskConst.ChatMsgTypeString.TYPE_RICH); - if (TextUtils.isEmpty(leavMsgId)) { - leavMsgId = UdeskIdBuild.buildMsgId(); - } else { - return; - } - msg.setTime(System.currentTimeMillis()); - msg.setMsgId(leavMsgId); - msg.setDirection(UdeskConst.ChatMsgDirection.Recv); - msg.setSendFlag(UdeskConst.SendFlag.RESULT_SUCCESS); - msg.setReadFlag(UdeskConst.ChatMsgReadFlag.read); - msg.setMsgContent(content); - msg.setPlayflag(UdeskConst.PlayFlag.NOPLAY); - //本地伪装成收到一条直接留言的欢迎语 - onNewMessage(msg); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void addEventMsg(MessageInfo msgInfo) { - try { - if (mChatView.getHandler() != null) { - Message messge = mChatView.getHandler().obtainMessage( - MessageWhat.Add_UdeskEvent); - messge.obj = msgInfo; - mChatView.getHandler().sendMessage(messge); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - //保存消息 - public void saveMessage(MessageInfo msg) { - try { - UdeskDBManager.getInstance().addMessageInfo(msg); - } catch (Exception e) { - e.printStackTrace(); - } - } - -// private void uploadFileByStrategy(String filePath, final MessageInfo message) { -// File file = new File(filePath); -// String fileName = file.getName(); -// UdeskUploadManager uploadManager = new UdeskUploadManager(); -// uploadManager.uploadFile(UdeskSDKManager.getInstance().getDomain(mChatView.getContext()), -// UdeskSDKManager.getInstance().getAppkey(mChatView.getContext()), -// UdeskSDKManager.getInstance().getSdkToken(mChatView.getContext()), -// UdeskSDKManager.getInstance().getAppId(mChatView.getContext()), fileName, filePath, message, -// new UdeskUploadCallBack() { -// -// @Override -// public void onSuccess(MessageInfo info, String url) { -// UdeskDBManager.getInstance().updateMsgContent(info.getMsgId(), -// url); -// info.setMsgContent(url); -// messageSave(info); -// } -// -// @Override -// public void progress(MessageInfo info, String key, float percent) { -// try { -// if (mChatView != null && mChatView.getHandler() != null) { -// Message message = mChatView.getHandler().obtainMessage( -// MessageWhat.ChangeFielProgress); -// message.obj = key; -// message.arg1 = new Float(percent * 100).intValue(); -// mChatView.getHandler().sendMessage(message); -// } -// } catch (Exception e) { -// e.printStackTrace(); -// } -// } -// -// @Override -// public void onFailure(MessageInfo info, String key) { -// if (mChatView.getHandler() != null) { -// Message message = mChatView.getHandler().obtainMessage( -// MessageWhat.changeImState); -// message.obj = info.getMsgId(); -// message.arg1 = UdeskConst.SendFlag.RESULT_FAIL; -// mChatView.getHandler().sendMessage(message); -// } -// UdeskDBManager.getInstance().updateMsgSendFlag(info.getMsgId(), -// UdeskConst.SendFlag.RESULT_FAIL); -// } -// }); -// } - - protected volatile ConcurrentHashMap isCancleUpLoad = new ConcurrentHashMap<>(); - - public void cancleUploadFile(MessageInfo message) { - try { -// if (UdeskConst.isLocal) { -// UdeskUploadManager.cancleRequest(message.getMsgId()); -// } else { - isCancleUpLoad.put(message.getMsgId(), true); -// } - } catch (Exception e) { - e.printStackTrace(); - } - } - - //上传文件 - private void upLoadFile(final String filePath, final MessageInfo message) { - -// if (UdeskConst.isLocal) { -// uploadFileByStrategy(filePath, message); -// } else { - try { - - if (isCancleUpLoad.containsKey(message.getMsgId())) { - isCancleUpLoad.put(message.getMsgId(), false); - return; - } - isCancleUpLoad.put(message.getMsgId(), false); - Recorder recorder = null; - try { - recorder = new FileRecorder(UdeskUtils.getDirectoryPath(mChatView.getContext(), UdeskConst.File_File)); - } catch (Exception e) { - } - KeyGenerator keyGenerator = new KeyGenerator() { - @Override - public String gen(String key, File file) { - String name = key + "_._" + new StringBuffer(file.getAbsolutePath()).reverse(); - return name; - } - }; - Configuration config = new Configuration.Builder() - .putThreshhold(512 * 1024) - .connectTimeout(10) - .recorder(recorder, keyGenerator) - .useHttps(true) - .build(); - - // 实例化一个上传的实例 - if (uploadManager == null) { - uploadManager = new UploadManager(config); - } - if (mMyUpCompletionHandler == null) { - mMyUpCompletionHandler = new MyUpCompletionHandler(); - } - String key = message.getMsgId(); -// if (message.getMsgtype().equals(UdeskConst.ChatMsgTypeString.TYPE_IMAGE) && !TextUtils.isEmpty(message.getFilename())) { -// key = key + "_" + message.getFilename(); -// } - key = key + "_" + message.getFilename(); - mMyUpCompletionHandler.putCacheMessage(key, message); - uploadManager.put(filePath, key, - XmppInfo.getInstance().getQiniuToken(), - mMyUpCompletionHandler, - new UploadOptions(null, null, false, - mUpProgressHandler, new UpCancellationSignal() { - @Override - public boolean isCancelled() { - return isCancleUpLoad.get(message.getMsgId()); - } - })); - } catch (Exception e) { - e.printStackTrace(); - } catch (OutOfMemoryError error) { - error.printStackTrace(); - } -// } - - } - - //提交满意度调查出错 - private void sendSurveyerror() { - try { - if (mChatView.getHandler() != null) { - Message message = mChatView.getHandler().obtainMessage( - MessageWhat.Survey_error); - mChatView.getHandler().sendMessage(message); - mChatView.setIsPermmitSurvy(true); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - /** - * 七牛上传进度 - */ - private final com.qiniu.android.storage.UpProgressHandler mUpProgressHandler = new com.qiniu.android.storage.UpProgressHandler() { - public void progress(String key, double percent) { - try { - if (mChatView != null && mChatView.getHandler() != null) { - Message message = mChatView.getHandler().obtainMessage( - MessageWhat.ChangeFielProgress); - message.obj = key; - message.arg1 = new Double(percent * 100).intValue(); - mChatView.getHandler().sendMessage(message); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - }; - - /** - * 七牛上传完成 - */ - class MyUpCompletionHandler implements UpCompletionHandler { - - private final Map mToMsgMap = new HashMap(); - - public MyUpCompletionHandler() { - - } - - public void putCacheMessage(String md5, MessageInfo message) { - mToMsgMap.put(md5, message); - } - - @Override - public void complete(String key, ResponseInfo info, JSONObject response) { - try { - MessageInfo msg = mToMsgMap.get(key); - isCancleUpLoad.remove(msg.getMsgId()); - if (key != null && null != response && (response.has("key") - || response.optString("error").contains("file exists")) - && msg != null) { - if (UdeskConst.isDebug) { - Log.i("DialogActivityPresenter", "UpCompletion : key=" - + key + "\ninfo=" + info.toString() + "\nresponse=" - + response.toString()); - } - String qiniuKey = response.optString("key"); - String qiniuUrl = UdeskConst.UD_QINIU_UPLOAD + qiniuKey; - UdeskDBManager.getInstance().updateMsgContent(msg.getMsgId(), - qiniuUrl); - msg.setMsgContent(qiniuUrl); - mToMsgMap.remove(key); - if (isNeedAddCachePre(msg)) { - return; - } - if (mChatView.isNeedQueueMessageSave()) { - queueMessageSave(msg); - return; - } - messageSave(msg); - - } else { - if (mChatView.getHandler() != null) { - Message message = mChatView.getHandler().obtainMessage( - MessageWhat.changeImState); - message.obj = msg.getMsgId(); - message.arg1 = UdeskConst.SendFlag.RESULT_FAIL; - mChatView.getHandler().sendMessage(message); - } - UdeskDBManager.getInstance().updateMsgSendFlag(msg.getMsgId(), - UdeskConst.SendFlag.RESULT_FAIL); - if (info != null && info.error != null && info.error.equals("file or data size is zero")) { - mChatView.showFailToast(info.error); - } - } - } catch (Exception e) { - e.printStackTrace(); - } catch (OutOfMemoryError error) { - error.printStackTrace(); - } - } - } - - //发送对话过滤消息 - public void sendPrefilterMsg(boolean isRetry) { - if (cachePreMsg.size() > 0) { - for (MessageInfo messageInfo : cachePreMsg) { - if (isRetry) { - startRetryMsg(messageInfo); - } else { - updateFailureStatus(messageInfo); - } - } - cachePreMsg.clear(); - } - - } - - //点击失败按钮 重试发送消息 - public void startRetryMsg(MessageInfo message) { - try { - if (isNeedAddCachePre(message)) { - return; - } - if (mChatView.isNeedQueueMessageSave()) { - queueMessageSave(message); - return; - } - if (message.getMsgtype().equals(UdeskConst.ChatMsgTypeString.TYPE_TEXT) || message.getMsgtype().equals(UdeskConst.ChatMsgTypeString.TYPE_Location)) { - messageSave(message); - } else if (message.getMsgtype().equals(UdeskConst.ChatMsgTypeString.TYPE_IMAGE) - || message.getMsgtype().equals(UdeskConst.ChatMsgTypeString.TYPE_AUDIO) - || message.getMsgtype().equals(UdeskConst.ChatMsgTypeString.TYPE_File) - || message.getMsgtype().equals(UdeskConst.ChatMsgTypeString.TYPE_VIDEO)) { - upLoadFile(message.getLocalPath(), message); - } else if (message.getMsgtype().equals(UdeskConst.ChatMsgTypeString.TYPE_LEAVEMSG)) { - if (TextUtils.isEmpty(customerId)) { - putLeavesMsg(customerId, message.getMsgContent(), message.getMsgId()); - } - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - //下载语言 - public void downAudio(final MessageInfo info) { - try { - final File file = new File(UdeskUtils.getDirectoryPath(mChatView.getContext(), UdeskConst.FileAduio), - UdeskUtils.getFileName(info.getMsgContent(), UdeskConst.FileAduio)); - - UdeskHttpFacade.getInstance().downloadFile(file.getAbsolutePath(), info.getMsgContent(), new UdeskHttpCallBack() { - - }); - } catch (Exception e) { - e.printStackTrace(); - } - } - - //下载视频 - public void downVideo(final MessageInfo info) { - try { - final File file = new File(UdeskUtils.getDirectoryPath(mChatView.getContext(), UdeskConst.FileVideo), - UdeskUtils.getFileName(info.getMsgContent(), UdeskConst.FileVideo)); - - UdeskHttpFacade.getInstance().downloadFile(file.getAbsolutePath(), info.getMsgContent(), new UdeskHttpCallBack() { - - }); - } catch (Exception e) { - e.printStackTrace(); - } - } - - //下载文件 - public void downFile(final MessageInfo info) { - try { - final File file = new File(UdeskUtils.getDirectoryPath(mChatView.getContext(), UdeskConst.File_File), - UdeskUtils.getFileName(info.getMsgContent(), UdeskConst.File_File)); - UdeskHttpFacade.getInstance().downloadFile(file.getAbsolutePath(), info.getMsgContent(), new UdeskHttpCallBack() { - - - @Override - public void onSuccess(byte[] t) { - try { - UdeskDBManager.getInstance().updateMsgLoaclUrl(info.getMsgId(), file.getAbsolutePath()); - } catch (Exception e) { - e.printStackTrace(); - } - } - - @Override - public void onFailure(int errorNo, String strMsg) { - if (mChatView != null && mChatView.getHandler() != null) { - Message message = mChatView.getHandler().obtainMessage( - MessageWhat.ChangeFielProgress); - message.obj = info.getMsgId(); - message.arg1 = 0; - Bundle bundle = new Bundle(); - bundle.putBoolean(UdeskConst.FileDownIsSuccess, false); - message.setData(bundle); - mChatView.getHandler().sendMessage(message); - } - } - - @Override - public void onLoading(long count, long current) { - - if (mChatView != null && mChatView.getHandler() != null) { - - double percent = current / (double) count; - Message message = mChatView.getHandler().obtainMessage( - MessageWhat.ChangeFielProgress); - message.obj = info.getMsgId(); - message.arg1 = new Double(percent * 100).intValue(); - Bundle bundle = new Bundle(); - bundle.putLong(UdeskConst.FileSize, count); - bundle.putBoolean(UdeskConst.FileDownIsSuccess, true); - message.setData(bundle); - mChatView.getHandler().sendMessage(message); - } - } - }); - } catch (Exception e) { - e.printStackTrace(); - } - - - } - - private ExecutorService scaleExecutor; - - private void ensureMessageExecutor() { - if (scaleExecutor == null) { - scaleExecutor = Concurrents - .newSingleThreadExecutor("scaleExecutor"); - } - } - - public void scaleBitmap(final String path) { - if (!TextUtils.isEmpty(path)) { - ensureMessageExecutor(); - scaleExecutor.submit(new Runnable() { - @Override - public void run() { - try { - Bitmap scaleImage = null; - byte[] data; - int max; - BitmapFactory.Options options = new BitmapFactory.Options(); - /** - * 在不分配空间状态下计算出图片的大小 - */ - options.inJustDecodeBounds = true; - BitmapFactory.decodeFile(path, options); - int width = options.outWidth; - int height = options.outHeight; - max = Math.max(width, height); - options.inTempStorage = new byte[100 * 1024]; - options.inJustDecodeBounds = false; - options.inPurgeable = true; - options.inPreferredConfig = Bitmap.Config.ARGB_8888; - InputStream inStream = new FileInputStream(path); - data = readStream(inStream); - if (data == null || data.length <= 0) { - sendFileMessage(path, UdeskConst.ChatMsgTypeString.TYPE_IMAGE); - return; - } - String imageName = UdeskUtils.MD5(data); - File scaleImageFile = new File(UdeskUtils.getDirectoryPath(mChatView.getContext(), UdeskConst.FileImg) + File.separator + imageName + UdeskConst.ORIGINAL_SUFFIX); - if (scaleImageFile != null && !scaleImageFile.exists()) { - // 缩略图不存在,生成上传图 - if (max > UdeskSDKManager.getInstance().getUdeskConfig().ScaleMax) { - options.inSampleSize = max / UdeskSDKManager.getInstance().getUdeskConfig().ScaleMax; - } else { - options.inSampleSize = 1; - } - FileOutputStream fos = new FileOutputStream(scaleImageFile); - scaleImage = BitmapFactory.decodeByteArray(data, 0, - data.length, options); - scaleImage.compress(Bitmap.CompressFormat.JPEG, 80, fos); - fos.close(); - } - - if (scaleImage != null) { - scaleImage.recycle(); - } - if (TextUtils.isEmpty(scaleImageFile.getPath())) { - sendFileMessage(path, UdeskConst.ChatMsgTypeString.TYPE_IMAGE); - } else { - sendFileMessage(scaleImageFile.getPath(), UdeskConst.ChatMsgTypeString.TYPE_IMAGE); - } - - } catch (Exception e) { - e.printStackTrace(); - } catch (OutOfMemoryError error) { - error.printStackTrace(); - } - } - }); - } - } - - - /** - * @param inStream - * @return byte[] - * @throws Exception - */ - private byte[] readStream(InputStream inStream) throws Exception { - byte[] data = new byte[0]; - try { - byte[] buffer = new byte[1024]; - int len; - ByteArrayOutputStream outStream = new ByteArrayOutputStream(); - while ((len = inStream.read(buffer)) != -1) { - outStream.write(buffer, 0, len); - } - data = outStream.toByteArray(); - outStream.close(); - inStream.close(); - } catch (Exception e) { - e.printStackTrace(); - } - return data; - - } - - //3秒检查下是否需要重发消息 - public void selfretrySendMsg() { - try { - if (mChatView.getHandler() != null) { - mChatView.getHandler().removeCallbacks(runnable); - mChatView.getHandler().postDelayed(runnable, 3000); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - public void removeCallBack() { - try { - if (mChatView != null && mChatView.getHandler() != null && runnable != null) { - mChatView.getHandler().removeCallbacks(runnable); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - Runnable runnable = new Runnable() { - @Override - public void run() { - try { - if (mChatView != null && mChatView.getHandler() != null) { - retrySendMsg(); - mChatView.getHandler().postDelayed(this, 5000); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - }; - - //自动重发消息 和 销毁界面会调用 - private void retrySendMsg() { - try { - Set retryMsgIds = sendingMsgCache.keySet(); - if (retryMsgIds.size() > 0) { - for (String msgID : retryMsgIds) { - MessageInfo msg = sendingMsgCache.get(msgID); - if (msg != null && !UdeskUtils.isNetworkConnected(mChatView.getContext())) { - updateFailureStatus(msg); - sendingMsgCache.remove(msgID); - } else if (msg != null) { - onSendMessageFail(msg); - } - } - } - - } catch (Exception e) { - e.printStackTrace(); - } - - } - - public Map getSendingMsgCache() { - return sendingMsgCache; - } -} diff --git a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/presenter/IChatActivityView.java b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/presenter/IChatActivityView.java deleted file mode 100644 index 00c2ff88..00000000 --- a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/presenter/IChatActivityView.java +++ /dev/null @@ -1,49 +0,0 @@ -package cn.udesk.presenter; - -import android.content.Context; -import android.os.Handler; - -import java.util.List; - -import udesk.core.model.AgentInfo; -import udesk.core.model.MessageInfo; - -public interface IChatActivityView { - - Context getContext(); - - CharSequence getInputContent(); - - void showFailToast(String failMsg); - - void updatePreSessionStatus(String pre_session_id); - - boolean getPressionStatus(MessageInfo msg); - - void dealAgentInfo(AgentInfo agentInfo); - - void clearInputContent(); - - void addMessage(MessageInfo message); - - AgentInfo getAgentInfo(); - void setAgentInfo(AgentInfo agentInfo); - - Handler getHandler(); - - void dealRedirectAgentInfo(AgentInfo agentInfo); - - String getGroupId(); - String getAgentId(); - void changgeiSSurvyOperate(); - void setIsPermmitSurvy(boolean isPermmitSurvy); - - void initLoadData(); - - int getAgentSeqNum(); - - boolean isNeedQueueMessageSave(); - - void isMoreThan(boolean isMore,String msg); - -} diff --git a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/presenter/MessageCache.java b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/presenter/MessageCache.java deleted file mode 100644 index 795ee267..00000000 --- a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/presenter/MessageCache.java +++ /dev/null @@ -1,159 +0,0 @@ -package cn.udesk.presenter; - -import android.content.Context; -import android.text.TextUtils; -import android.util.Log; - -import java.util.Map; -import java.util.concurrent.BlockingQueue; -import java.util.concurrent.LinkedBlockingQueue; -import java.util.concurrent.TimeUnit; - -import cn.udesk.UdeskSDKManager; -import cn.udesk.db.UdeskDBManager; -import udesk.core.UdeskCallBack; -import udesk.core.UdeskConst; -import udesk.core.UdeskHttpFacade; -import udesk.core.model.MessageInfo; - -public class MessageCache { - - private volatile boolean isRunning = true; - private BlockingQueue sendMsgQueue = null; - private static MessageCache instance = new MessageCache(); - - private MessageCache() { - //声明一个容量为30的缓存队列(不需要太大了), - // 在客户离开界面后启动个发送,直到全部发送成功 - sendMsgQueue = new LinkedBlockingQueue<>(30); - } - - public static MessageCache getInstance() { - return instance; - } - - //传入 getApplicationContext() - public void putAll(Map cache, Context mContext) { - try { - if (sendMsgQueue != null && cache.size() > 0) { - for (Map.Entry entry : cache.entrySet()) { - String key = entry.getKey(); - sendMsgQueue.offer(cache.get(key)); - } - isRunning = true; - doSendMessage(mContext); - } - } catch (Exception e) { - e.printStackTrace(); - } - - } - - public void doSendMessage(final Context mContext) { - - try { - new Thread(new Runnable() { - @Override - public void run() { - while (isRunning) { - try { - //有数据时直接从队列的队首取走,无数据时阻塞, - // 在5s内有数据,取走,超过5s还没数据,返回null; - MessageInfo info = sendMsgQueue.poll(5, TimeUnit.SECONDS); - if (info != null) { - //处理发送消息流程 - onSendMessageFail(info, mContext); - //保证发送顺序 避免请求密集导致服务端压力 - Thread.sleep(500); - } else { -// 没有数据,退出线程,等待系统销毁 - isRunning = false; - } - - } catch (Exception e) { - e.printStackTrace(); - } - } - } - }).start(); - - } catch (Exception e) { - e.printStackTrace(); - } - - } - - - private void onSendMessageFail(final MessageInfo msg, Context mContext) { -// xmpp发送失败后 再次调用messageSave 触发后端代发xmpp - try { - if (TextUtils.isEmpty(msg.getCustomerId())) { - return; - } - UdeskHttpFacade.getInstance().messageSave(UdeskSDKManager.getInstance().getDomain(mContext), - UdeskSDKManager.getInstance().getAppkey(mContext), - UdeskSDKManager.getInstance().getSdkToken(mContext), - UdeskSDKManager.getInstance().getAppId(mContext), - msg.getCustomerId(), msg.getmAgentJid(), - msg.getSubsessionid(), UdeskConst.UdeskSendStatus.sending, - msg.getMsgtype(), msg.getMsgContent(), msg.getMsgId(), - msg.getDuration(), msg.getSeqNum(), msg.getFilename(), - msg.getFilesize(), 0, "global_cache" + UdeskConst.sdk_page_status, new UdeskCallBack() { - @Override - public void onSuccess(String message) { - try { - msg.setCount(); -// messagesave发送2次成功,有服务端代发通知客服,消息发送成功,更新db状态 - if (msg.getCount() >= 2) { - UdeskDBManager.getInstance().updateMsgSendFlag(msg.getMsgId(), - UdeskConst.SendFlag.RESULT_SUCCESS); - } else { - //继续加入队列 - sendMsgQueue.put(msg); - - } - } catch (InterruptedException e) { - e.printStackTrace(); - } - } - - @Override - public void onFail(String message) { - - try { - //失败的次数会加1 - msg.setFailureCount(); - //messagesave 失败超过3次,计算服务异常,更新消息发送失败 - //小于3次 继续加入队列 - if (msg.getFailureCount() > 3) { - UdeskDBManager.getInstance().updateMsgSendFlag(msg.getMsgId(), - UdeskConst.SendFlag.RESULT_FAIL); - } else { - //继续加入队列 - - sendMsgQueue.put(msg); - - } - } catch (InterruptedException e) { - e.printStackTrace(); - } - - } - }); - } catch (Exception e) { - e.printStackTrace(); - } - } - - - public void clear() { - try { - if (sendMsgQueue != null) { - sendMsgQueue.clear(); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - -} diff --git a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/voice/AudioRecordButton.java b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/voice/AudioRecordButton.java index 6e1afeb1..a8b2cad8 100644 --- a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/voice/AudioRecordButton.java +++ b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/voice/AudioRecordButton.java @@ -61,7 +61,7 @@ public AudioRecordButton(Context context, AttributeSet attrs, int defStyleAttr) super(context, attrs, defStyleAttr); // 初始化按钮样式 try { - setBackgroundResource(R.drawable.udesk_record_button_normal); + setBackgroundResource(R.drawable.udesk_chat_edit_bg); setText(getResources().getString(R.string.press_record)); } catch (Exception e) { e.printStackTrace(); @@ -324,16 +324,16 @@ private void changeState(int state) { mCurrentState = state; if (state == STATE_NORMAL) { setText(getResources().getString(R.string.press_record)); - setBackgroundResource(R.drawable.udesk_record_button_normal); + setBackgroundResource(R.drawable.udesk_chat_edit_bg); } else if (state == STATE_RECORDING) { setText(getResources().getString(R.string.release_end)); - setBackgroundResource(R.drawable.udesk_record_button_recoding); + setBackgroundResource(R.drawable.udesk_chat_record_button_recording); if (isRecording) { mDialogManager.showRecording(); } } else if (state == STATE_WANT_CANCEL) { setText(getResources().getString(R.string.release_cancel)); - setBackgroundResource(R.drawable.udesk_record_button_recoding); + setBackgroundResource(R.drawable.udesk_chat_record_button_recording); if (isRecording) { mDialogManager.showDialogWantCancel(); } diff --git a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/voice/AudioRecordManager.java b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/voice/AudioRecordManager.java index cbb77ba6..861182cb 100644 --- a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/voice/AudioRecordManager.java +++ b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/voice/AudioRecordManager.java @@ -40,6 +40,7 @@ public class AudioRecordManager { private long startTime; private AudioRecord.OnRecordPositionUpdateListener updateListener = new AudioRecord.OnRecordPositionUpdateListener() { + @Override public void onPeriodicNotification(AudioRecord recorder) { try { audioRecorder.read(buffer, 0, buffer.length); // Fill buffer @@ -65,6 +66,7 @@ public void onPeriodicNotification(AudioRecord recorder) { } } + @Override public void onMarkerReached(AudioRecord recorder) { // NOT USED } diff --git a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/voice/RecordPlay.java b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/voice/RecordPlay.java index e01d906e..e6bb9bc4 100644 --- a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/voice/RecordPlay.java +++ b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/voice/RecordPlay.java @@ -1 +1 @@ -package cn.udesk.voice; import android.content.Context; import android.media.AudioManager; import android.media.MediaPlayer; import android.media.MediaPlayer.OnCompletionListener; import android.media.MediaPlayer.OnErrorListener; import android.media.MediaPlayer.OnPreparedListener; import android.text.TextUtils; import android.util.Log; import java.io.IOException; import cn.udesk.UdeskUtil; import udesk.core.UdeskConst; import udesk.core.model.MessageInfo; import udesk.core.utils.UdeskUtils; public class RecordPlay implements RecordFilePlay, OnCompletionListener, OnPreparedListener, OnErrorListener { private volatile boolean isPlaying = false; private Context mContent; int mPosition; String mMediaFilePath; RecordPlayCallback mCallbak; MediaPlayer mediaPlayer; MessageInfo mCurrentMessage; public RecordPlay(Context content) { this.mContent = content; } @Override public synchronized void click(MessageInfo message, RecordPlayCallback callback) { try { if (mediaPlayer == null) { init(); } if (!TextUtils.isEmpty(message.getLocalPath()) && UdeskUtils.isExitFileByPath(message.getLocalPath())) { mMediaFilePath = message.getLocalPath(); } else if (UdeskUtils.fileIsExitByUrl(mContent, UdeskConst.FileAduio, message.getMsgContent()) && UdeskUtils.getFileSize(UdeskUtils.getFileByUrl(mContent, UdeskConst.FileAduio, message.getMsgContent())) > 0) { mMediaFilePath = UdeskUtils.getPathByUrl(mContent, UdeskConst.FileAduio, message.getMsgContent()); } else { mMediaFilePath = message.getMsgContent(); } if (mCurrentMessage != message) { // 停止旧文件的播放 if (isPlaying) { recycleRes(); } // 对旧数据 进行回调 if (mCurrentMessage != null) { mCurrentMessage.isPlaying = false; if (mCallbak != null) { mCallbak.onPlayEnd(mCurrentMessage); mCurrentMessage = null; } } // 新旧数据更新 mCallbak = callback; mCurrentMessage = message; try { init(); startPlayer(mMediaFilePath); } catch (Exception e) { e.printStackTrace(); } } else { toggle(); } } catch (Exception e) { e.printStackTrace(); } } private void startPlayer(final String mediaFilePath) throws IOException { try { mPosition = 0; mediaPlayer.reset(); mediaPlayer.setDataSource(mediaFilePath); mediaPlayer.setLooping(false); mediaPlayer.prepareAsync();// player只有调用了onpraparre()方法后才会调用onstart() } catch (IOException e) { e.printStackTrace(); } catch (IllegalArgumentException e) { e.printStackTrace(); } catch (SecurityException e) { e.printStackTrace(); } catch (IllegalStateException e) { e.printStackTrace(); } } public String getMediaPath() { return mMediaFilePath; } @Override public void recycleRes() { try { if (mediaPlayer != null) { if (isPlaying) { try { mediaPlayer.stop(); } catch (Exception e) { e.printStackTrace(); } } try { mediaPlayer.release(); } catch (Exception e) { e.printStackTrace(); } } isPlaying = false; if (mCurrentMessage != null) { mCurrentMessage.isPlaying = false; } } catch (Exception e) { e.printStackTrace(); } } public void recycleCallback() { try { recycleRes(); mCurrentMessage = null; mCallbak = null; } catch (Exception e) { e.printStackTrace(); } } @Override public synchronized void toggle() { try { if (isPlaying) { isPlaying = false; try { mPosition = mediaPlayer.getCurrentPosition(); } catch (Exception e) { e.printStackTrace(); } try { mediaPlayer.pause(); } catch (Exception e) { e.printStackTrace(); } if (mCallbak != null) { mCallbak.onPlayPause(mCurrentMessage); mCallbak = null; } if (mCurrentMessage != null) { mCurrentMessage.isPlaying = false; } } else { init(); try { startPlayer(mMediaFilePath); } catch (Exception e) { e.printStackTrace(); } } } catch (Exception e) { e.printStackTrace(); } } @Override public synchronized void onCompletion(MediaPlayer mp) { mPosition = 0; try { mp.stop(); isPlaying = false; if (mCurrentMessage != null) { mCurrentMessage.isPlaying = false; } if (mCallbak != null) { mCallbak.endAnimation(); mCallbak.onPlayEnd(mCurrentMessage); mCurrentMessage = null; mCallbak = null; } } catch (Exception e) { e.printStackTrace(); } } @Override public synchronized void onPrepared(MediaPlayer arg0) { try { mediaPlayer.start(); isPlaying = true; if (mCallbak != null) { mCallbak.onPlayStart(mCurrentMessage); } if (mCurrentMessage != null) { mCurrentMessage.isPlaying = true; } } catch (IllegalStateException e) { e.printStackTrace(); } } private void init() { try { mediaPlayer = new MediaPlayer(); mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC); mediaPlayer.setOnCompletionListener(this); mediaPlayer.setOnPreparedListener(this); mediaPlayer.setOnErrorListener(this); } catch (Exception e) { e.printStackTrace(); } } @Override public synchronized boolean onError(MediaPlayer arg0, int arg1, int arg2) { try { arg0.reset(); isPlaying = false; if (mCurrentMessage != null) { mCurrentMessage.isPlaying = false; } } catch (Exception e) { e.printStackTrace(); } return true; } @Override public synchronized MessageInfo getPlayAduioMessage() { try { if (mCurrentMessage != null) { return mCurrentMessage; } } catch (Exception e) { e.printStackTrace(); } return null; } } \ No newline at end of file +package cn.udesk.voice; import android.content.Context; import android.media.AudioManager; import android.media.MediaPlayer; import android.media.MediaPlayer.OnCompletionListener; import android.media.MediaPlayer.OnErrorListener; import android.media.MediaPlayer.OnPreparedListener; import android.text.TextUtils; import android.util.Log; import java.io.IOException; import cn.udesk.UdeskUtil; import udesk.core.UdeskConst; import udesk.core.model.MessageInfo; import udesk.core.utils.UdeskUtils; public class RecordPlay implements RecordFilePlay, OnCompletionListener, OnPreparedListener, OnErrorListener { private volatile boolean isPlaying = false; private Context mContent; int mPosition; String mMediaFilePath; RecordPlayCallback mCallbak; MediaPlayer mediaPlayer; MessageInfo mCurrentMessage; public RecordPlay(Context content) { this.mContent = content; } @Override public synchronized void click(MessageInfo message, RecordPlayCallback callback) { try { if (mediaPlayer == null) { init(); } if (!TextUtils.isEmpty(message.getLocalPath()) && UdeskUtils.isExitFileByPath(message.getLocalPath())) { mMediaFilePath = message.getLocalPath(); } else if (UdeskUtils.fileIsExitByUrl(mContent, UdeskConst.FileAduio, message.getMsgContent()) && UdeskUtils.getFileSize(UdeskUtils.getFileByUrl(mContent, UdeskConst.FileAduio, message.getMsgContent())) > 0) { mMediaFilePath = UdeskUtils.getPathByUrl(mContent, UdeskConst.FileAduio, message.getMsgContent()); } else { mMediaFilePath = message.getMsgContent(); } if (mCurrentMessage != message) { // 停止旧文件的播放 if (isPlaying) { recycleRes(); } // 对旧数据 进行回调 if (mCurrentMessage != null) { mCurrentMessage.isPlaying = false; if (mCallbak != null) { mCallbak.onPlayEnd(mCurrentMessage); mCurrentMessage = null; } } // 新旧数据更新 mCallbak = callback; mCurrentMessage = message; try { init(); startPlayer(mMediaFilePath); } catch (Exception e) { e.printStackTrace(); } } else { toggle(); } } catch (Exception e) { e.printStackTrace(); } } private void startPlayer(final String mediaFilePath) throws IOException { try { mPosition = 0; mediaPlayer.reset(); mediaPlayer.setDataSource(mediaFilePath); mediaPlayer.setLooping(false); mediaPlayer.prepareAsync();// player只有调用了onpraparre()方法后才会调用onstart() } catch (IOException e) { e.printStackTrace(); } catch (IllegalArgumentException e) { e.printStackTrace(); } catch (SecurityException e) { e.printStackTrace(); } catch (IllegalStateException e) { e.printStackTrace(); } } @Override public String getMediaPath() { return mMediaFilePath; } @Override public void recycleRes() { try { if (mediaPlayer != null) { if (isPlaying) { try { mediaPlayer.stop(); } catch (Exception e) { e.printStackTrace(); } } try { mediaPlayer.release(); } catch (Exception e) { e.printStackTrace(); } } isPlaying = false; if (mCurrentMessage != null) { mCurrentMessage.isPlaying = false; } } catch (Exception e) { e.printStackTrace(); } } @Override public void recycleCallback() { try { recycleRes(); mCurrentMessage = null; mCallbak = null; } catch (Exception e) { e.printStackTrace(); } } @Override public synchronized void toggle() { try { if (isPlaying) { isPlaying = false; try { mPosition = mediaPlayer.getCurrentPosition(); } catch (Exception e) { e.printStackTrace(); } try { mediaPlayer.pause(); } catch (Exception e) { e.printStackTrace(); } if (mCallbak != null) { mCallbak.onPlayPause(mCurrentMessage); mCallbak = null; } if (mCurrentMessage != null) { mCurrentMessage.isPlaying = false; } } else { init(); try { startPlayer(mMediaFilePath); } catch (Exception e) { e.printStackTrace(); } } } catch (Exception e) { e.printStackTrace(); } } @Override public synchronized void onCompletion(MediaPlayer mp) { mPosition = 0; try { mp.stop(); isPlaying = false; if (mCurrentMessage != null) { mCurrentMessage.isPlaying = false; } if (mCallbak != null) { mCallbak.endAnimation(); mCallbak.onPlayEnd(mCurrentMessage); mCurrentMessage = null; mCallbak = null; } } catch (Exception e) { e.printStackTrace(); } } @Override public synchronized void onPrepared(MediaPlayer arg0) { try { mediaPlayer.start(); isPlaying = true; if (mCallbak != null) { mCallbak.onPlayStart(mCurrentMessage); } if (mCurrentMessage != null) { mCurrentMessage.isPlaying = true; } } catch (IllegalStateException e) { e.printStackTrace(); } } private void init() { try { mediaPlayer = new MediaPlayer(); mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC); mediaPlayer.setOnCompletionListener(this); mediaPlayer.setOnPreparedListener(this); mediaPlayer.setOnErrorListener(this); } catch (Exception e) { e.printStackTrace(); } } @Override public synchronized boolean onError(MediaPlayer arg0, int arg1, int arg2) { try { arg0.reset(); isPlaying = false; if (mCurrentMessage != null) { mCurrentMessage.isPlaying = false; } } catch (Exception e) { e.printStackTrace(); } return true; } @Override public synchronized MessageInfo getPlayAduioMessage() { try { if (mCurrentMessage != null) { return mCurrentMessage; } } catch (Exception e) { e.printStackTrace(); } return null; } } \ No newline at end of file diff --git a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/widget/UDPullGetMoreListView.java b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/widget/UDPullGetMoreListView.java index 2b647370..a4998a23 100644 --- a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/widget/UDPullGetMoreListView.java +++ b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/widget/UDPullGetMoreListView.java @@ -87,6 +87,7 @@ private void init(Context context) { } + @Override public void onScroll(AbsListView arg0, int firstVisiableItem, int arg2, int arg3) { firstItemIndex = firstVisiableItem; if(firstItemIndex == 1 && !isPush) { @@ -95,6 +96,7 @@ public void onScroll(AbsListView arg0, int firstVisiableItem, int arg2, int arg3 } + @Override public void onScrollStateChanged(AbsListView arg0, int arg1) { switch(arg1){ diff --git a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/widget/UdeskConfirmPopWindow.java b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/widget/UdeskConfirmPopWindow.java index d99d2d41..dc64c8bf 100644 --- a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/widget/UdeskConfirmPopWindow.java +++ b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/widget/UdeskConfirmPopWindow.java @@ -1 +1 @@ -package cn.udesk.widget; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.content.res.Resources; import android.graphics.drawable.ColorDrawable; import android.text.Html; import android.text.Spannable; import android.text.SpannableStringBuilder; import android.text.SpannedString; import android.text.method.LinkMovementMethod; import android.text.method.ScrollingMovementMethod; import android.text.style.ClickableSpan; import android.text.style.URLSpan; import android.text.util.Linkify; import android.view.Gravity; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.PopupWindow; import android.widget.TextView; import cn.udesk.R; import cn.udesk.UdeskSDKManager; import cn.udesk.activity.MessageAdatper; import cn.udesk.activity.UdeskChatActivity; import cn.udesk.activity.UdeskWebViewUrlAcivity; import udesk.core.UdeskConst; import static android.util.Patterns.PHONE; import static android.util.Patterns.WEB_URL; public class UdeskConfirmPopWindow extends PopupWindow implements View.OnClickListener { private Context context; public UdeskConfirmPopWindow(Context context) { super(context); this.context = context; try { setFocusable(true); setTouchable(true); setOutsideTouchable(true); setBackgroundDrawable(new ColorDrawable(context.getResources().getColor(android.R.color.transparent))); } catch (Resources.NotFoundException e) { e.printStackTrace(); } } public void show(Activity content, View locationView, String positiveLabel, String negativeLabel, String confirmContent, OnPopConfirmClick onPopMultiMenuClick) { try { LayoutInflater layoutInflater = LayoutInflater.from(content); mOnPopConfirmClick = onPopMultiMenuClick; ViewGroup rootView = (ViewGroup) layoutInflater.inflate(R.layout.udesk_confirm_pop_dialog, null); ViewGroup popupView = (ViewGroup) rootView.findViewById(R.id.udesk_confirm_pop_panel); TextView ngegativeTv = (TextView) popupView.findViewById(R.id.udesk_confirm_pop_negative); ngegativeTv.setText(negativeLabel); ngegativeTv.setOnClickListener(this); TextView potitiveTv = (TextView) popupView.findViewById(R.id.udesk_confirm_pop_positive); potitiveTv.setText(positiveLabel); potitiveTv.setOnClickListener(this); TextView popcontent = ((TextView) popupView.findViewById(R.id.udesk_confirm_pop_content)); dealhtml(confirmContent,popcontent); // 把菜单都添加进去 setContentView(rootView); setWindowLayoutMode(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); setWidth(ViewGroup.LayoutParams.WRAP_CONTENT); setHeight(ViewGroup.LayoutParams.WRAP_CONTENT); //显示出来 showAtLocation(locationView, Gravity.CENTER, 0, 0); } catch (Exception e) { e.printStackTrace(); } } public void cancle() { try { dismiss(); } catch (Exception e) { e.printStackTrace(); } } @Override public void onClick(View childView) { if (mOnPopConfirmClick != null) { int id = childView.getId(); if (id == R.id.udesk_confirm_pop_positive) { mOnPopConfirmClick.onPositiveClick(); } else if (id == R.id.udesk_confirm_pop_negative) { mOnPopConfirmClick.onNegativeClick(); } } dismiss(); } private OnPopConfirmClick mOnPopConfirmClick; public interface OnPopConfirmClick { void onPositiveClick(); void onNegativeClick(); void callTelPhone(String phone); void toWebViewAcivity(String mUrl); } private void dealhtml(String confirmContent, TextView rich_tvmsg) { try { CharSequence charSequence = Html.fromHtml(confirmContent); String msg = charSequence.toString(); if (msg.endsWith("\n\n")) { charSequence = charSequence.subSequence(0, charSequence.length() - 2); rich_tvmsg.setText(charSequence); } else { rich_tvmsg.setText(charSequence); } Linkify.addLinks(rich_tvmsg, WEB_URL, null); Linkify.addLinks(rich_tvmsg, PHONE, null); CharSequence text = rich_tvmsg.getText(); if (text instanceof Spannable) { int end = text.length(); Spannable sp = (Spannable) rich_tvmsg.getText(); URLSpan[] urls = sp.getSpans(0, end, URLSpan.class); SpannableStringBuilder style = new SpannableStringBuilder(text); style.clearSpans(); for (URLSpan url : urls) { MyURLSpan myURLSpan = new MyURLSpan(url.getURL()); style.setSpan(myURLSpan, sp.getSpanStart(url), sp.getSpanEnd(url), Spannable.SPAN_EXCLUSIVE_INCLUSIVE); } rich_tvmsg.setText(style); } else if (text instanceof SpannedString) { SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder(charSequence); URLSpan[] urls = spannableStringBuilder.getSpans(0, charSequence.length(), URLSpan.class); spannableStringBuilder.clearSpans(); SpannedString sp = (SpannedString) rich_tvmsg.getText(); for (URLSpan url : urls) { MyURLSpan myURLSpan = new MyURLSpan(url.getURL()); int statr = sp.getSpanStart(url); int end = sp.getSpanEnd(url); spannableStringBuilder.setSpan(myURLSpan, statr, end, Spannable.SPAN_EXCLUSIVE_INCLUSIVE); } rich_tvmsg.setText(spannableStringBuilder); rich_tvmsg.setMovementMethod(LinkMovementMethod.getInstance()); } } catch (Exception e) { e.printStackTrace(); } catch (OutOfMemoryError error) { error.printStackTrace(); } } private class MyURLSpan extends ClickableSpan { private final String mUrl; MyURLSpan(String url) { mUrl = url; } @Override public void onClick(View widget) { try { if (WEB_URL.matcher(mUrl).find()) { if (mOnPopConfirmClick != null) { mOnPopConfirmClick.toWebViewAcivity(mUrl); } } else if (PHONE.matcher(mUrl).find()) { String phone = mUrl.toLowerCase(); if (!phone.startsWith("tel:")) { phone = "tel:" + mUrl; } if (mOnPopConfirmClick != null) { mOnPopConfirmClick.callTelPhone(phone); } } } catch (Exception e) { e.printStackTrace(); } catch (OutOfMemoryError error) { error.printStackTrace(); } } } } \ No newline at end of file +package cn.udesk.widget; import android.app.Activity; import android.content.Context; import android.content.res.Resources; import android.graphics.drawable.ColorDrawable; import android.text.Html; import android.text.Spannable; import android.text.SpannableStringBuilder; import android.text.SpannedString; import android.text.method.LinkMovementMethod; import android.text.style.ClickableSpan; import android.text.style.URLSpan; import android.text.util.Linkify; import android.view.Gravity; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.PopupWindow; import android.widget.TextView; import cn.udesk.R; import static android.util.Patterns.PHONE; import static android.util.Patterns.WEB_URL; public class UdeskConfirmPopWindow extends PopupWindow implements View.OnClickListener { private Context context; public UdeskConfirmPopWindow(Context context) { super(context); this.context = context; try { setFocusable(true); setTouchable(true); setOutsideTouchable(true); setBackgroundDrawable(new ColorDrawable(context.getResources().getColor(android.R.color.transparent))); } catch (Resources.NotFoundException e) { e.printStackTrace(); } } public void show(Activity content, View locationView, String positiveLabel, String negativeLabel, String confirmContent, OnPopConfirmClick onPopMultiMenuClick) { try { LayoutInflater layoutInflater = LayoutInflater.from(content); mOnPopConfirmClick = onPopMultiMenuClick; ViewGroup rootView = (ViewGroup) layoutInflater.inflate(R.layout.udesk_confirm_pop_dialog, null); ViewGroup popupView = (ViewGroup) rootView.findViewById(R.id.udesk_confirm_pop_panel); TextView ngegativeTv = (TextView) popupView.findViewById(R.id.udesk_confirm_pop_negative); ngegativeTv.setText(negativeLabel); ngegativeTv.setOnClickListener(this); TextView potitiveTv = (TextView) popupView.findViewById(R.id.udesk_confirm_pop_positive); potitiveTv.setText(positiveLabel); potitiveTv.setOnClickListener(this); TextView popcontent = ((TextView) popupView.findViewById(R.id.udesk_confirm_pop_content)); dealhtml(confirmContent,popcontent); // 把菜单都添加进去 setContentView(rootView); setWindowLayoutMode(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); setWidth(ViewGroup.LayoutParams.WRAP_CONTENT); setHeight(ViewGroup.LayoutParams.WRAP_CONTENT); //显示出来 showAtLocation(locationView, Gravity.CENTER, 0, 0); } catch (Exception e) { e.printStackTrace(); } } public void cancle() { try { dismiss(); } catch (Exception e) { e.printStackTrace(); } } @Override public void onClick(View childView) { if (mOnPopConfirmClick != null) { int id = childView.getId(); if (id == R.id.udesk_confirm_pop_positive) { mOnPopConfirmClick.onPositiveClick(); } else if (id == R.id.udesk_confirm_pop_negative) { mOnPopConfirmClick.onNegativeClick(); } } dismiss(); } private OnPopConfirmClick mOnPopConfirmClick; public interface OnPopConfirmClick { void onPositiveClick(); void onNegativeClick(); void callTelPhone(String phone); void toWebViewAcivity(String mUrl); } private void dealhtml(String confirmContent, TextView rich_tvmsg) { try { CharSequence charSequence = Html.fromHtml(confirmContent); String msg = charSequence.toString(); if (msg.endsWith("\n\n")) { charSequence = charSequence.subSequence(0, charSequence.length() - 2); rich_tvmsg.setText(charSequence); } else { rich_tvmsg.setText(charSequence); } Linkify.addLinks(rich_tvmsg, WEB_URL, null); Linkify.addLinks(rich_tvmsg, PHONE, null); CharSequence text = rich_tvmsg.getText(); if (text instanceof Spannable) { int end = text.length(); Spannable sp = (Spannable) rich_tvmsg.getText(); URLSpan[] urls = sp.getSpans(0, end, URLSpan.class); SpannableStringBuilder style = new SpannableStringBuilder(text); style.clearSpans(); for (URLSpan url : urls) { MyURLSpan myURLSpan = new MyURLSpan(url.getURL()); style.setSpan(myURLSpan, sp.getSpanStart(url), sp.getSpanEnd(url), Spannable.SPAN_EXCLUSIVE_INCLUSIVE); } rich_tvmsg.setText(style); } else if (text instanceof SpannedString) { SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder(charSequence); URLSpan[] urls = spannableStringBuilder.getSpans(0, charSequence.length(), URLSpan.class); spannableStringBuilder.clearSpans(); SpannedString sp = (SpannedString) rich_tvmsg.getText(); for (URLSpan url : urls) { MyURLSpan myURLSpan = new MyURLSpan(url.getURL()); int statr = sp.getSpanStart(url); int end = sp.getSpanEnd(url); spannableStringBuilder.setSpan(myURLSpan, statr, end, Spannable.SPAN_EXCLUSIVE_INCLUSIVE); } rich_tvmsg.setText(spannableStringBuilder); rich_tvmsg.setMovementMethod(LinkMovementMethod.getInstance()); } } catch (Exception e) { e.printStackTrace(); } catch (OutOfMemoryError error) { error.printStackTrace(); } } private class MyURLSpan extends ClickableSpan { private final String mUrl; MyURLSpan(String url) { mUrl = url; } @Override public void onClick(View widget) { try { if (WEB_URL.matcher(mUrl).find()) { if (mOnPopConfirmClick != null) { mOnPopConfirmClick.toWebViewAcivity(mUrl); } } else if (PHONE.matcher(mUrl).find()) { String phone = mUrl.toLowerCase(); if (!phone.startsWith("tel:")) { phone = "tel:" + mUrl; } if (mOnPopConfirmClick != null) { mOnPopConfirmClick.callTelPhone(phone); } } } catch (Exception e) { e.printStackTrace(); } catch (OutOfMemoryError error) { error.printStackTrace(); } } } } \ No newline at end of file diff --git a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/widget/UdeskExpandableLayout.java b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/widget/UdeskExpandableLayout.java index a93384fa..74a4b808 100644 --- a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/widget/UdeskExpandableLayout.java +++ b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/widget/UdeskExpandableLayout.java @@ -84,8 +84,23 @@ public void run() { e.printStackTrace(); } } + public void startNetAnimation(){ + try { + clearAnimation(); + if (animationDown == null) { + animationDown = new DropDownAnim(mContentView,txt, + mContentHeight, true); + animationDown.setDuration(1000); + } + animationDown.setNetLine(); + startAnimation(animationDown); + } catch (Exception e) { + e.printStackTrace(); + } + } + - private void stopAnimation(){ + public void stopAnimation(){ try { clearAnimation(); @@ -118,6 +133,7 @@ public DropDownAnim(View targetview, TextView txtView,int vieweight, public void setLine(boolean isLine) { try { + txtView.setTextColor(mContext.getResources().getColor(R.color.udesk_color_bg_white)); if(isLine){ this.view.setBackgroundColor(Color.rgb(65, 207, 124)); txtView.setText(mContext.getString(R.string.udesk_service_line)); @@ -129,7 +145,17 @@ public void setLine(boolean isLine) { e.printStackTrace(); } } - + + public void setNetLine() { + try { + this.view.setBackgroundColor(mContext.getResources().getColor(R.color.udesk_color_FFDFDF)); + txtView.setText(mContext.getString(R.string.udesk_no_network)); + txtView.setTextColor(mContext.getResources().getColor(R.color.udesk_color_eb212121)); + } catch (Exception e) { + e.printStackTrace(); + } + } + @Override protected void applyTransformation(float interpolatedTime, Transformation t) { diff --git a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/widget/UdeskSurvyPopwindow.java b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/widget/UdeskSurvyPopwindow.java index 21bca9df..d05b11d4 100644 --- a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/widget/UdeskSurvyPopwindow.java +++ b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/widget/UdeskSurvyPopwindow.java @@ -6,11 +6,8 @@ import android.support.v7.widget.DefaultItemAnimator; import android.support.v7.widget.GridLayoutManager; import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.LinearSnapHelper; import android.support.v7.widget.RecyclerView; -import android.support.v7.widget.SnapHelper; import android.text.TextUtils; -import android.util.Log; import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; @@ -32,7 +29,8 @@ import cn.udesk.model.SurveyOptionsModel; import cn.udesk.model.Tag; import udesk.core.UdeskConst; -import udesk.core.utils.UdeskUtils; + +import static udesk.core.UdeskConst.REMARK_OPTION_HIDE; /** * Created by user on 2018/3/28. @@ -56,7 +54,7 @@ public class UdeskSurvyPopwindow extends PopupWindow { public interface SumbitSurvyCallBack { - void sumbitSurvyCallBack(String optionId, String show_type, String survey_remark, String tags); + void sumbitSurvyCallBack(boolean isRobot,String optionId, String show_type, String survey_remark, String tags); } @SuppressLint("WrongConstant") @@ -100,6 +98,7 @@ public void onClick(View view) { //mMenuView添加OnTouchListener监听判断获取触屏位置如果在选择框外面则销毁弹出框 mMenuView.setOnTouchListener(new View.OnTouchListener() { + @Override public boolean onTouch(View v, MotionEvent event) { int height = mMenuView.findViewById(R.id.udesk_root).getTop(); @@ -190,7 +189,7 @@ public void onClick(View view) { Toast.makeText(context.getApplicationContext(), context.getString(R.string.summit_must_remark), Toast.LENGTH_LONG).show(); return; } - callBack.sumbitSurvyCallBack(String.valueOf(choiceOptionsModel.getId()), surveyOptions.getType(), remarkEt.getText().toString(), listToString(choiceTags)); + callBack.sumbitSurvyCallBack(surveyOptions.isRobot(),String.valueOf(choiceOptionsModel.getId()), surveyOptions.getType(), remarkEt.getText().toString(), listToString(choiceTags)); dismiss(); } else { dismiss(); @@ -205,7 +204,7 @@ public void onClick(View view) { private void checkRemarkOption(OptionsModel model) { try { - if (model.getRemark_option().equals("hide")) { + if (model.getRemark_option().equals(REMARK_OPTION_HIDE)) { remarkView.setVisibility(View.GONE); remarkTips.setVisibility(View.GONE); } else { diff --git a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/widget/UdeskTitleBar.java b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/widget/UdeskTitleBar.java index d295ca19..61574662 100644 --- a/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/widget/UdeskTitleBar.java +++ b/udesksdk/UdeskSDKUI/src/main/java/cn/udesk/widget/UdeskTitleBar.java @@ -14,17 +14,21 @@ /** * udesk 标题栏 - * */ -public class UdeskTitleBar extends RelativeLayout{ +public class UdeskTitleBar extends RelativeLayout { - protected RelativeLayout udeskRootView; - protected LinearLayout udeskbackll; - protected ImageView udeskBackImg; - protected TextView udeskLeft; - protected TextView udeskRight; - protected ImageView udeskStateImg; - protected ImageView udeskTransferImg; + protected RelativeLayout udeskRootView;//根布局 + protected LinearLayout udeskbackll;//返回 + protected ImageView udeskBackImg;//返回图标 + // protected TextView udeskLeft; + protected TextView udeskRight;//右侧文字 转人工 + // protected ImageView udeskStateImg; + protected ImageView udeskTransferImg;//右侧图片 转人工图片 + protected ImageView udeskRobotImg;// 机器人头像 + protected LinearLayout udeskMiddlell;//中间布局 + protected TextView udeskTopText;//中部上边的文字 + protected TextView udeskBottomText;//中部底部的文字 + protected LinearLayout udeskRightll;//右侧布局 public UdeskTitleBar(Context context, AttributeSet attrs, int defStyle) { @@ -40,40 +44,58 @@ public UdeskTitleBar(Context context) { super(context); init(context); } - - private void init(Context context){ - LayoutInflater.from(context).inflate(R.layout.udesk_title_bar, this); + + private void init(Context context) { +// LayoutInflater.from(context).inflate(R.layout.udesk_title_bar, this); + LayoutInflater.from(context).inflate(R.layout.udesk_title_bar_new, this); udeskRootView = (RelativeLayout) findViewById(R.id.udesk_root); - udeskLeft = (TextView) findViewById(R.id.udesk_content); +// udeskLeft = (TextView) findViewById(R.id.udesk_content); udeskRight = (TextView) findViewById(R.id.udesk_titlebar_right); udeskbackll = (LinearLayout) findViewById(R.id.udesk_back_linear); udeskBackImg = (ImageView) findViewById(R.id.udesk_back_img); - udeskStateImg = (ImageView) findViewById(R.id.udesk_status); - udeskTransferImg =(ImageView)findViewById(R.id.udesk_transfer_agent); +// udeskStateImg = (ImageView) findViewById(R.id.udesk_status); + udeskTransferImg = (ImageView) findViewById(R.id.udesk_transfer_agent); + udeskRobotImg = (ImageView) findViewById(R.id.udesk_robot_img); + udeskMiddlell = (LinearLayout) findViewById(R.id.udesk_titlebar_middle_linear); + udeskTopText = (TextView) findViewById(R.id.udesk_titlebar_middle_top); + udeskBottomText = (TextView) findViewById(R.id.udesk_titlebar_middle_bottom); + udeskRightll = (LinearLayout) findViewById(R.id.udesk_titlebar_right_linear); + } - public RelativeLayout getRootView(){ - if (udeskRootView != null){ - return udeskRootView; + @Override + public RelativeLayout getRootView() { + if (udeskRootView != null) { + return udeskRootView; } return null; } - public TextView getLeftTextView(){ - if (udeskLeft != null){ - return udeskLeft; - } - return null; +// public TextView getLeftTextView(){ +// if (udeskLeft != null){ +// return udeskLeft; +// } +// return null; +// } + + public TextView getUdeskTopText() { + return udeskTopText; + } + + public TextView getUdeskBottomText() { + return udeskBottomText; } - public TextView getRightTextView(){ - if (udeskRight != null){ - return udeskRight; + public TextView getRightTextView() { + if (udeskRight != null) { + return udeskRight; } return null; } - + public ImageView getUdeskRobotImg() { + return udeskRobotImg; + } public ImageView getUdeskBackImg() { return udeskBackImg; @@ -81,73 +103,163 @@ public ImageView getUdeskBackImg() { /** * 设置titlebar 左边的点击事件 + * * @param listener */ - public void setLeftViewClick(OnClickListener listener){ - if(udeskbackll != null){ + public void setLeftViewClick(OnClickListener listener) { + if (udeskbackll != null) { udeskbackll.setOnClickListener(listener); - } + } } - + /** * 设置titlebar 右边TextView的点击事件 + * * @param listener */ - public void setRightViewClick(OnClickListener listener){ - if(udeskRight != null){ - udeskRight.setOnClickListener(listener); - } + public void setRightViewClick(OnClickListener listener) { + if (udeskRightll != null) { + udeskRightll.setOnClickListener(listener); + } } + /** * 设置titlebar 左边的显隐藏 - * @param vis View.VISIBLE View.GONE View.INVISIBLE + * + * @param vis View.VISIBLE View.GONE View.INVISIBLE */ - public void setLeftLinearVis(int vis){ - if(udeskbackll != null){ + public void setLeftLinearVis(int vis) { + if (udeskbackll != null) { udeskbackll.setVisibility(vis); - } + } + } + + /** + * 设置titlebar 机器人头像的显隐藏 + * + * @param vis View.VISIBLE View.GONE View.INVISIBLE + */ + public void setUdeskRobotImgVis(int vis) { + if (udeskRobotImg != null) { + udeskRobotImg.setVisibility(vis); + } + } + + /** + * 设置titlebar 中间人工布局的的显隐藏 + * + * @param vis View.VISIBLE View.GONE View.INVISIBLE + */ + public void setUdeskMiddlellVis(int vis) { + if (udeskMiddlell != null) { + udeskMiddlell.setVisibility(vis); + } + } + + /** + * 设置titlebar 中间顶部文字的的显隐藏 + * + * @param vis View.VISIBLE View.GONE View.INVISIBLE + */ + public void setUdeskTopTextVis(int vis) { + if (udeskTopText != null) { + udeskTopText.setVisibility(vis); + } + } + + /** + * 设置titlebar 中间底部文字的的显隐藏 + * + * @param vis View.VISIBLE View.GONE View.INVISIBLE + */ + public void setUdeskBottomTextVis(int vis) { + if (udeskBottomText != null) { + udeskBottomText.setVisibility(vis); + } + } + + /** + * 设置titlebar右边的布局显隐藏 + * + * @param vis View.VISIBLE View.GONE View.INVISIBLE + */ + public void setRightViewVis(int vis) { + if (udeskRightll != null) { + udeskRightll.setVisibility(vis); + } } - + /** * 设置titlebar右边的TextView显隐藏 - * @param vis View.VISIBLE View.GONE View.INVISIBLE + * + * @param vis View.VISIBLE View.GONE View.INVISIBLE */ - public void setRightTextVis(int vis){ - if(udeskRight != null){ - udeskRight.setVisibility(vis); - } + public void setRightTextVis(int vis) { + if (udeskRight != null) { + udeskRight.setVisibility(vis); + } } /** - * 设置titlebar左边的TextView 显示的内容 - * @param string + * 设置titlebar右边的ImageView显隐藏 + * + * @param vis View.VISIBLE View.GONE View.INVISIBLE */ - public void setLeftTextSequence(String string){ - if(udeskLeft != null){ - udeskLeft.setText(string); - } + public void setudeskTransferImgVis(int vis) { + if (udeskTransferImg != null) { + udeskTransferImg.setVisibility(vis); + } } - + /** - * 设置titlebar右边的TextView 显示的内容 + * 设置titlebar 中间底部文字显示的内容 + * * @param string */ - public void setRightTextSequence(String string){ - if(udeskRight != null){ - udeskRight.setText(string); - } + public void setTopTextSequence(String string) { + if (udeskTopText != null) { + udeskTopText.setText(string); + } } - - public void setudeskTransferImgVis(int vis){ - if(udeskTransferImg != null){ - udeskTransferImg.setVisibility(vis); + /** + * 设置titlebar 中间底部文字显示的内容 + * + * @param string + */ + public void setBottomTextSequence(String string) { + if (udeskBottomText != null) { + udeskBottomText.setText(string); } } - public ImageView getudeskStateImg(){ - udeskStateImg.setVisibility(VISIBLE); - return udeskStateImg; + + /** + * 设置titlebar右边的TextView 显示的内容 + * + * @param string + */ + public void setRightTextSequence(String string) { + if (udeskRight != null) { + udeskRight.setText(string); + } } - + + +// /** +// * 设置titlebar左边的TextView 显示的内容 +// * @param string +// */ +// public void setLeftTextSequence(String string){ +// if(udeskLeft != null){ +// udeskLeft.setText(string); +// } +// } + + +// public ImageView getudeskStateImg(){ +// udeskStateImg.setVisibility(VISIBLE); +// return udeskStateImg; +// } + } diff --git a/udesksdk/UdeskSDKUI/src/main/res/drawable-xhdpi/udesk_ic_cheat_add.png b/udesksdk/UdeskSDKUI/src/main/res/drawable-xhdpi/udesk_ic_cheat_add.png deleted file mode 100644 index cb192d605022016a0c837451c4c232d33d6313a8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2756 zcmV;#3On_QP)PxWZ>(bBrOMM@s>klk#2Y1n8`LWpaU8hltMqRg` z@7?peIWu#2=FaTQ?#|4;aOeEax##@O@AtXqo_p@UGmQ-kVA-)_$M^5tx${6{W8-Sf z(Yk7CYU&>1t;ns&3LA(|5KIuCK>ix}BI_ve(Nrq+>EXkNzal=bOXGahzH8U6_S?5_ zuLne0D>kewlO2}aNoB`dlXHV<+`1nQuZee{43oBjs6ky+H zJ=WINHgMp;0k!UmFO_zxp}V_#HHY&HK-`QscSm`I)8nL{VZA^;9loQK86%u%YHFHT zzI=HAKPSvTQmD$C$W92_S7J)9g$r_*PFMR_V)fSW5X;XWdrJ3NH;CyHEdeq+lBG(&=OzgaQo0t zpDUSe=Mn6B39uWo>b!{fREKP{n@uwrnUd1<&_qDgTzuD8%BYD9t*w->PHugLQ z?qzK;LxI}6e*OCAO6>wl0*Wz4{P{SH4Cj(!>xV{zSlGQ6pi9n z_<6%iizOBfblbLVOW2G5!iXPxH4GqcJ$m%$H7~7dMEQiV>bAnZ6(3LI?hz%4hj525~%zm1)_s zWdiq(-3}^9kqMnoE~1EjfGk?7M}0EeO<&Gyi0YI0W`{ zCfC(aO)o(GaP8W)x|#E+bM%ppj*d@&`dL25^PZG+1$6V~&5u#A)F~ODpV^d8VXbZB zM5UW4cJ{y8($ey9zALI3`%v{6x|~E=0F#!fapu;!28KiTv3~B>`{ufS`RsgG)l0=B zUw=9yP;P~F(}&o#xvqLP7c+cN?d4c-rVBmyYjtut)W+7~eAd0(;L1--#AYT1kwA3| z&fPV#a{K1%3J8dInGwEhX>$=e-}hNvVk1Tt_rpk_x}QlVT|H>IplkDKv3`FYgA0zp z62~Y9NDffW>bk`h-W+C#^ehA01%0C<$Eyk?hyh2)E>kT=Vr6j)bAYnpMc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4G(prw*F_s0OK zpp-@$>Q;Rf)Z&8NUst4oU!z(0mXzwBtL%k|{cohOf3Bj*>cQ0EC5MJK&={6SSRz~~od&0nbfA3S)R6HIuY#sB~S07*qo IM6N<$g42=F{Qv*} diff --git a/udesksdk/UdeskSDKUI/src/main/res/drawable-xhdpi/udesk_ic_cheat_keyboard.png b/udesksdk/UdeskSDKUI/src/main/res/drawable-xhdpi/udesk_ic_cheat_keyboard.png deleted file mode 100644 index ebb9febd3e2a23778678de0f71e8a34dcd8c28b0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3095 zcmV+y4CwQTP)Px=(Md!>RCodHoqcRpR~^Uuw51_SS}F~3)MXL>0OArMQVa%EY?mw=Vx|zLnM+`e zyp4p+O=g^P=-e{MCL!THL5*M(vMO8l$NpFg*&jMOm@u=9Vj_i@W`@l4MJE>8`uX0T zb2-m_?sK2#KF`ya=jlDkea`zizu)JcbM86!o_n8E)if|$wru(I=;-KusZ?qa;^k558?g@_Z5yF{5{px)$boZe7G0?l$z93)V_WD_U7BSZ?^%W zRR=QMTOv8G1G-B`ZEbDm{{8#=N>py%#Y`H|ojZ5d4-O8l1>hqbUq!-+u6qoyXE=^G zG&FSV*|SHjd&12`D^<01>()hd=cj=95Zc@orV&aH5`LcJGU?QPd&tv=JycUuGc<4B zJP*c=8#n4lMn>w1t0%4*dl7jxL@efLA#VeAnE9A=C&{z>(4j*;VF^kVHeoQqfvSJyHiw^H`~l)ah)YTQBy zAI1L)#|uY}9J%DimC9XmpgVT#_~gx-H(x@b?*@fLp-Y4xXMFqZ!Gi}s491tzzir#L zyBVh+rcMnpI=N|v@DsCV&wg^>zJ32pizw1lGN7h~Y^8<#9GT|0av}Wdw8ZD>Zg0Ec zljUaES%F+n19nZI&H?25F+Jo^u|33=TN0pLwHMsFb?f&C`~_REu{(hI+(dP+KwUY# z8itVZ84|8_6C-2ytXZ?Z&8*<68(xUJXrKuBErdKq<&BO2mpSu~F)!?L!lsQAnKfnG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We|evIUi*!Te@l%<@zdBPcG$(Idwrr;(avj5wEOX@k5#-o9Shm|2P1+v3t*U zpQF035g|IVnjUf^6P>AS>kNewCuc^dhJIyBdd8XIxpfr2cvu?J|=OJ(Qm}i9`0PaOf z1ym)??e?Nerucr7SNt%UfXE`#XcX>zd^LCvC)&1E*3a=(Q{~Z56V!vqHL9=MB7kaoyE`Vx11k(SfzTYuENZr|uHY z3wTvSLq1~sRhrwz-6_rO-kG^qX#aCU@@E{Jwg?azI{l*jM;g}vdPGZD_sZ?7$8c7W zaq#l$x~FM{yu}10_4Gh)?CEGq>;g@G83iw|s{IYx_HRuvUqi$GD}IpwJI+ViG73)T zeILlJsR@ckdN_x^ou=}Nmr?Mfq%<10ryz{IX&CVQzg!!DYt=c%+YCzdq2> z)Z&KY;%=9y(zv%CNR N002ovPDHLkV1izAMHK)5 diff --git a/udesksdk/UdeskSDKUI/src/main/res/drawable-xhdpi/udesk_im_record_left_play1.png b/udesksdk/UdeskSDKUI/src/main/res/drawable-xhdpi/udesk_im_record_left_play1.png index 02498282a86072611cbfc08f4f371ab15f9e3bf2..c67b93c173e9883bc64930ed28a215d704aaa6c5 100644 GIT binary patch literal 575 zcmV-F0>J%=P)2$fgis>&&*vT-JZD#OlAjh-?Sg-XR5lohiIO8{+EP+!>qm~iZ{9V`KEm+ z8m^0BB8Ca8kHxUws8BEBxEOX)DON|LQbC6+qWJz>O3ZgMT|LsM6sr%#@biz9`l~xc zdurP-kLa=ab5`H%bOwu+Qqk{CtAq(hT&hh-)IU$p30{iGQkm)Z`}@T3HL21Es;f$@ zc$9v<7`7|L4eJF?Txt<&x3R#AXQj<9>=F`L;^cq_^@p_x5fNn>TAZ|m4ezTsRy<9Z zPqhgV5sBhzTBTfld6!Vc&6H8qL$wKI8CvOhv-#~Z6Qf%y)Qh7NwFwasiQ>z2lJKCs zo~thxgxF8dOo(-Dvr(aP%S8QFnVD(Jf{d=Dn+3zkG9&6YW^$;r46Q=D%->aUGa38p zixFqbTxT#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wdc^#m1aByevDb=l1y671;ILtq{42kB~HU3Yh23KiAw!@wTesy z-l01-)m7`sR!GqqtYt=yQsHZ(9JR@nL4Hs#sR0wfGOC$xPY4$?FdsWuoyuHw4Clzi zxb|P-PRG0rA=zM>(S}fe#+j+3$a&Y0ByqPG_#_0^?{uDY5!7nc5RO29#js0Kxl=`15RDuM6;sKqe;5wb~nOz3jWDF+I7Ly2i zSe_}YB0u7yhp&?HT8lxHJnoKK%E7+JN_PQT)8-N(>KaG5z?-qsJrQ@z)&daqtf+HJ zcmB00965sJjpTDjxWIRWoX*sUT7vz7X+>V|27jHN&Ws@JdMtNi>aOT;pa{PmljoIC zx-U8se{ZFFu+JW0z&2}y%O}QeuIV-pbP!zs0gL)@8&>{pcmMzZ07*qoM6N<$f~QKt Af&c&j diff --git a/udesksdk/UdeskSDKUI/src/main/res/drawable-xhdpi/udesk_im_record_right_play1.png b/udesksdk/UdeskSDKUI/src/main/res/drawable-xhdpi/udesk_im_record_right_play1.png index 653bf51ba0a9f76b47219481d9e693999ef3da31..c02ced5eec509d80cd8d66d3169da625ceba747b 100644 GIT binary patch literal 422 zcmV;X0a^ZuP)+_~b8t%Q!$K`wikMJ00qv|9;1i$Z59%%d7h_~ z%&u5Z%(~->jVqywhdC7M4KtZP2-Wfw$}+N@JV%!0P>(2P)lA40%<|bk$gx>>Nnea5 z4>PB_WO^~`r(->Zt1IrrN=QGh4d3p8F5pUXCPJ>*irW2N3fBo7@cq!*{k#Efz^xEU zfN8UW8Knk*4Px%%t=H+RA>e5nZIjPK@i7thNSX>2$}>1I|VBhL^Womk4a=x?k*Kt5XQNn;~IjzKU;8oqR>s0JDVsjDY&C z-%L&y0jgUBpnE=H#rR6yd_~p)*~flWz&iIk26IJ#>J|ZL;OLb8Lfw4D)&cua0hZ8f zY?}r|T<-sOu`;g*6q?6Ur^#gvT4Ln5gGnoMpQq5N|K;>Q`!sO29t*bTho@lbN%>NP z9;y8}0GDYLUOnGZg@X8jU>;5%gbsfW;6dhReBWq%f?lqjv2(sn@cogZzU!4giHy%h ze9pBAzD@AGu1ZD!xx(+qx~#B9RlRBbsrCWozIrjNY}ckLl4CQdi&*Lhp+BtY z)(=7=22i)KRQtq&#T?=_&I!;?Om1mfllYOwMRIKf>bgQ*_C7tyK>|ICJ&nM37up>l z(7Q1IUn$*(_TY~Lzm9DkXb=7(;CbKjTrulS0aL&fFa=BjQ@|831)3}H4^dsXt)O)s Q4*&oF07*qoM6N<$g8h?j^Z)<= diff --git a/udesksdk/UdeskSDKUI/src/main/res/drawable-xhdpi/udesk_im_record_right_play2.png b/udesksdk/UdeskSDKUI/src/main/res/drawable-xhdpi/udesk_im_record_right_play2.png index d85e6b8375ee0ef310ab756eb3ccdaf62a850779..6b2c55950cd39c8a52b5afb123caa317d36b1ee3 100644 GIT binary patch literal 224 zcmeAS@N?(olHy`uVBq!ia0vp^Dj>|k1|%Oc%$NbBmV3H5hD5Z!y}Fv0$x)>B;ntRL z^Nv!EtOE}ha0tzE&^2vvNIamhg0Ye1l!ATJ>^BBXPb3TfaqYWf-M^~noaOU6wl9rr z7L3BCX$&zLyH`81@4KyKxS6Mz#meh~?m?Tzg+jsUmm^OYFh;4)m|kMVcuQqLyNK|D zWhNIkZJFA;$=P;#6H}@0^{_)zmbu#YG~P;IF<0se^SPyWcj#?+_W5GpRk`PLivL$J Y2P{{tPP`Fp2y`-or>mdKI;Vst0N_nl_W%F@ literal 372 zcmeAS@N?(olHy`uVBq!ia0vp^dO+;L!3HG%U1R44QjEnx?oJHr&dIz4vh_S&978f# z-%j=CYH|>1H(lX-(Q%RMZVoGl+2_LUE<02zyGZZi{L*j1BJS?ODl-K4H6A~+C-B+q z^UK*7d6^{+Ft8akF!CfYpfFz~DD*vE_-Mh5vK@Et>N4Hao>Uh2g*k4)>6RNAe;dR< z+-x}4UU#^=Xxij!U&Q_#h&7G2&R^>@F(R|#O5>l^m5#2a%T{Zit|>HgR~EdtY6|aX z5xbHjnYr30rcV;iUT9bNiSv){u|nH)&EHpYf=}(3bK=L|g(hddI8T1!`gJ+yinmX7 z9DjeY?5WG}Ijzid_;r8w9i5Xu?yTWVjxl=Mwk|dNU|9Xnf6nUZLO-HDp3M2qY*jDO vbWiga>)c3r&YFqxEpjNnf%);leztwSYwFm)^a<|<1|x%~tDnm{r-UW|NP3xp diff --git a/udesksdk/UdeskSDKUI/src/main/res/drawable-xhdpi/udesk_im_retry.png b/udesksdk/UdeskSDKUI/src/main/res/drawable-xhdpi/udesk_im_retry.png index af7343e4f2f2ea6c4f8b4678bc76f78fb000c73a..b403cb2e61155810f608783d590f81f373a8fdff 100644 GIT binary patch literal 463 zcmV;=0WkiFP)2_yTl9k~ ziY1(!Cx?4@^NgZc_VC;r;XXtD#glId>kr}n1~G@>%@S{HHZ@GRLS@W%>f0_ zJSC`<@d8RoP(H;A$VY<8HC{lu64XdaO#|2v)Ifwz2iVR6F!~V3yhtw8m4;Rm8k!~EA6(rNi0w8#DaZz>w7mMYPmHF!5Y2fpGDCWecAbdjJR+onnCM>DDvh}=*dXi zZvkkm4a@*C<`!@O8fz2%1vET{IKhkF=VOR#cW=}�`WWjdZ&OZwUYZ002ovPDHLk FV1lHw#{~cY literal 2069 zcmV+w25S|AZlWktOzdg57P}F7+(}4fj=~9RB-%3 z=wdW8^D#9Vjbv2u)5R!a=*S3vU|dHahQJm!9%B!v=ewSoZaug6^_|=H zu3vIfQnq`zzx%z;cfNCQ#p7|v3yrw*2=XxVFr6-i+3=6}$F*<)`|z^M$1V@QP-+D~ z-p8&>{ED(GhM!C0L(xn>hbvP7hyko;AN3qy6~Qe>*cD+{7(W@@n4@7bfCw(YA(lxV zu7_Ri3~IZhU^0jZFhrz*W;C`HF9!Bf&ce(vMBAZCfyp3x`9Hii3xh5~4azWoa+nMx zYU1u3$Yju`1}Fm+8B7Mz!z1ac97+vGIM8s`B<(y(M{^7$@QmUhx2DW%CJ!=u9Wa6E zU>X|87)%F&OrBl&%tm{69^^DZHx=R2TYF$S6l5~cR$I)R2b*qiz8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Rq?*jN+Ongnx&PUIY?JQ5Mm|UT9?P@ zM>{Eo=`k_`icpM*ns>FcIW161lh(D}oippJv z8@G5M!VI6JvjhDjc6aD$u0rrwnaAWG``1$dK2QTicdpjmu5F?@E1fi`ZCurY83MxX z&K8?ZP1gyA{Q;^~(Ln~%W29=7EUgqdXL2%+-D+wNS zP{M9C)EXJ0^fIyg<2ZyesI|dLbGHR=mx+O-%~TkLOM@X{a&I^lW4`vv=Pgv}&rDgH zyb@^&CI=b-$s12GietHK&ico6gH;L^e;tGIqetNSq3@;5sCWd|>de{y{ycEruG%QZ46mNEJdD8f!0g(Dnh@QaQFSk<@i!BgWgt7G?ds*p zYSSzMi3^KCLwU5BGdh^bI>BkA53d00000NkvXXu0mjfr2Ou- diff --git a/udesksdk/UdeskSDKUI/src/main/res/drawable-xhdpi/udesk_titlebar_back.png b/udesksdk/UdeskSDKUI/src/main/res/drawable-xhdpi/udesk_titlebar_back.png index 96c5d89f6a444a6fb3502de5e3f3ea0da791ee44..4b84393f394fa2d397deba4c7377d9e3a4ae3b82 100644 GIT binary patch literal 561 zcmV-10?z%3P);piK%vEK*o(r9uR`Z1&E3_s+*%Q&?QA5(%m76^ylD z3N0)wEEMb%u@MAC1X00_;75|RTAfX2gmHerc^(dD-Z_)f)~jKRc@wNE=ZpVv&fizF z+1zGKH%-ttL0<)5!r%aQRDwGLxC#2oxDox2!U6E858_;3HMYr8w-Ie6D!k(yY`0w_JqJq z=&FxaW8AIlnVlhUW$Fy&x?s7k>+K=%lu|Oq8wbDMPpJ_GPbnqWZfjc7nNWC2DVY?v z{)7$v5TWy-0%ck5Ri?-89jr^4OQ?j|g;5jS8|nnXe5gd0Wh0efc~eK+sHdjlIwGai zP%f6dgfOiz^R7sVWP;0^Qt{E;-0Z$s38srfbAjnObL&8`1g0y&S3j1!oz9U^iL#`V zCiKZkeCRTcg-Te_npB~;PNEm~FC3I=e$W^%{m)p-_PJn*Y)l1yH&{1887g6Bqb9ij zUskh0Wmz_2Ot+mx+;Zxwp+XDF)HB7ktse3V#Q<%FqO<@T^ZB!6Y7f>ulw-Q@utR=Ek`7Cq<3Tr$OF{E?pVHpP isJUZp_EA3Jugry#((k^`oE!l36oaR$pUXO@geCwAUm1h| diff --git a/udesksdk/UdeskSDKUI/src/main/res/drawable/udesk_navigation_bg.xml b/udesksdk/UdeskSDKUI/src/main/res/drawable/udesk_navigation_bg.xml index 0f8f1088..96c6a746 100644 --- a/udesksdk/UdeskSDKUI/src/main/res/drawable/udesk_navigation_bg.xml +++ b/udesksdk/UdeskSDKUI/src/main/res/drawable/udesk_navigation_bg.xml @@ -3,9 +3,9 @@ - + - + + + \ No newline at end of file diff --git a/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_activity_im.xml b/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_activity_im.xml index 381cbc60..86a291af 100644 --- a/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_activity_im.xml +++ b/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_activity_im.xml @@ -3,7 +3,7 @@ android:id="@+id/udesk_im_content" android:layout_width="fill_parent" android:layout_height="fill_parent" - android:background="@color/udesk_color_fof2f2" + android:background="@color/udesk_color_f0f2f2" android:layoutDirection="ltr" android:orientation="vertical"> @@ -30,166 +30,54 @@ layout="@layout/udesk_im_commodity_item" android:layout_width="fill_parent" android:layout_height="wrap_content" /> - - - - - - - - - - - - + android:layout_weight="1"> + - - - + android:id="@+id/udesk_robot_ll_associate" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical" + android:background="@color/udesk_color_f0f2f2" + android:visibility="gone" + > - - - - - - - - - - - - - - - - + - - + - - - - - - - - - - - - + android:layout_height="wrap_content" + android:layout_marginLeft="@dimen/udesk_16" + /> + + - - - - + android:layout_height="wrap_content"> + \ No newline at end of file diff --git a/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_activity_preview.xml b/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_activity_preview.xml index b6c16868..ebff622d 100644 --- a/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_activity_preview.xml +++ b/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_activity_preview.xml @@ -22,7 +22,7 @@ android:id="@+id/m_top_bar_layout" android:layout_width="match_parent" android:layout_height="wrap_content" - android:background="@color/udesk_color_f2212123"> + android:background="@color/udesk_color_f2242526"> diff --git a/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_activity_select.xml b/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_activity_select.xml index 1e058b52..db0bb33c 100644 --- a/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_activity_select.xml +++ b/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_activity_select.xml @@ -9,7 +9,7 @@ android:id="@+id/udesk_title_root" android:layout_width="fill_parent" android:layout_height="@dimen/udesk_titlebar_height" - android:background="@color/udesk_color_f2212123"> + android:background="@color/udesk_color_f2242526"> diff --git a/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_event_item.xml b/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_event_item.xml deleted file mode 100644 index 86f51fe7..00000000 --- a/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_event_item.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_in_line_item.xml b/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_in_line_item.xml deleted file mode 100644 index 6d5588f8..00000000 --- a/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_in_line_item.xml +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_leavemsg_item_txt_l.xml b/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_leavemsg_item_txt_l.xml deleted file mode 100644 index b6345b46..00000000 --- a/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_leavemsg_item_txt_l.xml +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_leavemsg_item_txt_r.xml b/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_leavemsg_item_txt_r.xml deleted file mode 100644 index 1da551c3..00000000 --- a/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_leavemsg_item_txt_r.xml +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_item_audiot_l.xml b/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_item_audiot_l.xml deleted file mode 100644 index 4ec18bd0..00000000 --- a/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_item_audiot_l.xml +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_item_audiot_r.xml b/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_item_audiot_r.xml deleted file mode 100644 index e1da24ed..00000000 --- a/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_item_audiot_r.xml +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_item_file_l.xml b/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_item_file_l.xml deleted file mode 100644 index a16bb564..00000000 --- a/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_item_file_l.xml +++ /dev/null @@ -1,142 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_item_file_r.xml b/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_item_file_r.xml deleted file mode 100644 index 1cb07ec7..00000000 --- a/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_item_file_r.xml +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_item_imgt_l.xml b/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_item_imgt_l.xml deleted file mode 100644 index 430761c4..00000000 --- a/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_item_imgt_l.xml +++ /dev/null @@ -1,118 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_item_imgt_r.xml b/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_item_imgt_r.xml deleted file mode 100644 index bd310628..00000000 --- a/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_item_imgt_r.xml +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_item_location_r.xml b/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_item_location_r.xml deleted file mode 100644 index 697f9059..00000000 --- a/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_item_location_r.xml +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_item_product_r.xml b/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_item_product_r.xml deleted file mode 100644 index 7b25d597..00000000 --- a/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_item_product_r.xml +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_item_redirect.xml b/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_item_redirect.xml deleted file mode 100644 index b21793d0..00000000 --- a/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_item_redirect.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_item_smallvideo_l.xml b/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_item_smallvideo_l.xml deleted file mode 100644 index 4eb111b3..00000000 --- a/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_item_smallvideo_l.xml +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_item_smallvideo_r.xml b/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_item_smallvideo_r.xml deleted file mode 100644 index 6cca24aa..00000000 --- a/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_item_smallvideo_r.xml +++ /dev/null @@ -1,116 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_item_txt_l.xml b/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_item_txt_l.xml deleted file mode 100644 index 8a29d04a..00000000 --- a/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_item_txt_l.xml +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_item_txt_r.xml b/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_item_txt_r.xml deleted file mode 100644 index af12fa27..00000000 --- a/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_item_txt_r.xml +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_item_video_l.xml b/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_item_video_l.xml deleted file mode 100644 index 34662181..00000000 --- a/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_item_video_l.xml +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_item_video_r.xml b/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_item_video_r.xml deleted file mode 100644 index 6857ef6c..00000000 --- a/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_item_video_r.xml +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_itemstruct_l.xml b/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_itemstruct_l.xml deleted file mode 100644 index d6ff0350..00000000 --- a/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_msg_itemstruct_l.xml +++ /dev/null @@ -1,153 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_rich_item_txt.xml b/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_rich_item_txt.xml deleted file mode 100644 index a77749b9..00000000 --- a/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_chat_rich_item_txt.xml +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_expandlayout_xml.xml b/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_expandlayout_xml.xml index 995b4668..ae5c2993 100644 --- a/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_expandlayout_xml.xml +++ b/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_expandlayout_xml.xml @@ -8,11 +8,11 @@ diff --git a/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_include_func_layout.xml b/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_include_func_layout.xml index cffd62bb..f7319417 100644 --- a/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_include_func_layout.xml +++ b/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_include_func_layout.xml @@ -2,7 +2,7 @@ diff --git a/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_options_agentgroup_view.xml b/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_options_agentgroup_view.xml index 18cbf3a9..acdf7699 100644 --- a/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_options_agentgroup_view.xml +++ b/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_options_agentgroup_view.xml @@ -27,6 +27,7 @@ android:layout_width="fill_parent" android:layout_height="fill_parent" android:cacheColorHint="@android:color/transparent" + android:layout_marginTop="@dimen/udesk_1" android:divider="@color/udesk_view_line" android:dividerHeight="@dimen/udesk_1" android:fadingEdge="none" diff --git a/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_text_view.xml b/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_text_view.xml index 5de2ff15..c975f4bf 100644 --- a/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_text_view.xml +++ b/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_text_view.xml @@ -2,7 +2,7 @@ @@ -17,11 +17,12 @@ android:gravity="center" android:maxWidth="@dimen/udesk_80" android:minWidth="@dimen/udesk_45" - android:padding="@dimen/udesk_5" - android:paddingLeft="@dimen/udesk_10" - android:paddingRight="@dimen/udesk_10" + android:paddingTop="@dimen/udesk_6" + android:paddingBottom="@dimen/udesk_6" + android:paddingLeft="@dimen/udesk_13" + android:paddingRight="@dimen/udesk_13" android:singleLine="true" - android:textColor="@color/udesk_color_666666" + android:textColor="@color/udesk_color_212121" android:textSize="@dimen/udesk_sp14" /> diff --git a/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_zoom_imageview.xml b/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_zoom_imageview.xml index 70178833..70bcf819 100644 --- a/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_zoom_imageview.xml +++ b/udesksdk/UdeskSDKUI/src/main/res/layout/udesk_zoom_imageview.xml @@ -11,8 +11,8 @@ android:id="@+id/udesk_zoom_save" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_alignParentBottom="true" android:layout_alignParentLeft="true" + android:layout_alignParentBottom="true" android:background="@null" android:padding="@dimen/udesk_20" android:text="@string/udesk_save" @@ -20,6 +20,18 @@ android:textSize="@dimen/udesk_sp16" /> +