From 06a06e47b7d77b3e12e5f7752074f0d0f12519cb Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 14 Aug 2020 11:27:50 +0800 Subject: [PATCH 01/14] fix bug of UI and update callchat to 1.5.1 --- gradle.properties | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 620f4a0289..954f602451 100644 --- a/gradle.properties +++ b/gradle.properties @@ -65,12 +65,13 @@ MOGO_BASE_SERVICES_SDK_VERSION = 1.2.1.22 # 探路 MOGO_MODULE_TANLU_VERSION=1.3.1.24 # 车聊聊 -CARCHATTING_VERSION=1.4.9 +CARCHATTING_VERSION=1.5.1 # 车聊聊接口 CARCHATTINGPROVIDER_VERSION=1.3.4 # 视频引导 MOGO_MODULE_GUIDESHOW_VERSION=1.0.2-SNAPSHOT # 视频引导接口 + MOGO_MODULE_GUIDESHOW_PROVIDER_VERSION=1.0.2-SNAPSHOT # 在线车辆F MOGO_MODULE_ONLINECAR_VERSION=1.0.3.2 From 3390ff00355e2a6b3eea728b41bae81c3d33fd2c Mon Sep 17 00:00:00 2001 From: liujing Date: Fri, 14 Aug 2020 11:37:01 +0800 Subject: [PATCH 02/14] =?UTF-8?q?=E6=96=87=E6=A1=88=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/mogo/module/v2x/network/V2XShareNetworkModel.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/network/V2XShareNetworkModel.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/network/V2XShareNetworkModel.java index 877136cec3..c706acbe91 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/network/V2XShareNetworkModel.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/network/V2XShareNetworkModel.java @@ -136,7 +136,7 @@ public class V2XShareNetworkModel { public void onError(Throwable e) { super.onError(e); if (callback != null){ - callback.onFail("当前服务不可以, 请稍后重试"); + callback.onFail("网络异常,点击刷新重试"); } } }); @@ -180,7 +180,7 @@ public class V2XShareNetworkModel { public void onError(Throwable e) { super.onError(e); if (callback != null){ - callback.onFail("当前服务不可以, 请稍后重试"); + callback.onFail("网络异常,点击刷新重试"); } } }); From 72c0cb27aed547dc55bdb17418537f59aeba303f Mon Sep 17 00:00:00 2001 From: liujing Date: Fri, 14 Aug 2020 11:37:01 +0800 Subject: [PATCH 03/14] =?UTF-8?q?=E6=96=87=E6=A1=88=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/mogo/module/v2x/network/V2XShareNetworkModel.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/network/V2XShareNetworkModel.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/network/V2XShareNetworkModel.java index 877136cec3..c706acbe91 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/network/V2XShareNetworkModel.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/network/V2XShareNetworkModel.java @@ -136,7 +136,7 @@ public class V2XShareNetworkModel { public void onError(Throwable e) { super.onError(e); if (callback != null){ - callback.onFail("当前服务不可以, 请稍后重试"); + callback.onFail("网络异常,点击刷新重试"); } } }); @@ -180,7 +180,7 @@ public class V2XShareNetworkModel { public void onError(Throwable e) { super.onError(e); if (callback != null){ - callback.onFail("当前服务不可以, 请稍后重试"); + callback.onFail("网络异常,点击刷新重试"); } } }); From 54e288f7b6f4147c7999ff680f1d5151a8aa1354 Mon Sep 17 00:00:00 2001 From: liujing Date: Fri, 14 Aug 2020 12:03:12 +0800 Subject: [PATCH 04/14] =?UTF-8?q?=E9=80=BB=E8=BE=91=E6=8B=86=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mogo/module/v2x/adapter/V2XShareEventAdapter.java | 4 ++-- .../module/v2x/fragment/V2XShareEventsFragment.java | 11 +++++------ .../com/mogo/module/v2x/listener/AdapterCallback.java | 4 +++- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/V2XShareEventAdapter.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/V2XShareEventAdapter.java index 686d49e351..ee61fb7aa8 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/V2XShareEventAdapter.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/V2XShareEventAdapter.java @@ -223,7 +223,7 @@ public class V2XShareEventAdapter extends RecyclerView.Adapter Date: Fri, 14 Aug 2020 12:03:12 +0800 Subject: [PATCH 05/14] =?UTF-8?q?=E9=80=BB=E8=BE=91=E6=8B=86=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mogo/module/v2x/adapter/V2XShareEventAdapter.java | 4 ++-- .../module/v2x/fragment/V2XShareEventsFragment.java | 11 +++++------ .../com/mogo/module/v2x/listener/AdapterCallback.java | 4 +++- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/V2XShareEventAdapter.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/V2XShareEventAdapter.java index 686d49e351..ee61fb7aa8 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/V2XShareEventAdapter.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/V2XShareEventAdapter.java @@ -223,7 +223,7 @@ public class V2XShareEventAdapter extends RecyclerView.Adapter Date: Fri, 14 Aug 2020 12:12:32 +0800 Subject: [PATCH 06/14] =?UTF-8?q?=E7=BD=91=E7=BB=9C=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/mogo/module/v2x/fragment/V2XShareEventsFragment.java | 4 ++-- .../java/com/mogo/module/v2x/view/V2XNetworkLoadingView.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/fragment/V2XShareEventsFragment.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/fragment/V2XShareEventsFragment.java index 29f91fa0a0..c473c778ad 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/fragment/V2XShareEventsFragment.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/fragment/V2XShareEventsFragment.java @@ -97,7 +97,7 @@ public class V2XShareEventsFragment extends MvpFragment implements AdapterCallba @Override public void onFail(String msg) { - loadingView.stopWithError(msg); + loadingView.stopWithError(msg,View.VISIBLE); loadingView.refresButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { @@ -183,7 +183,7 @@ public class V2XShareEventsFragment extends MvpFragment implements AdapterCallba @Override public void onFail(String msg) { - + loadingView.stopWithError(msg,View.INVISIBLE); } }); } diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/view/V2XNetworkLoadingView.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/view/V2XNetworkLoadingView.java index b8c1e9beea..a73c2c4ccc 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/view/V2XNetworkLoadingView.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/view/V2XNetworkLoadingView.java @@ -76,7 +76,7 @@ public class V2XNetworkLoadingView extends RelativeLayout { } } - public void stopWithError(String errormsg) { + public void stopWithError(String errormsg, int showRefreshButton) { if (v2XAnimationManager != null) { v2XAnimationManager.soptWithError(); } @@ -84,7 +84,7 @@ public class V2XNetworkLoadingView extends RelativeLayout { textView.setText(errormsg); } if (refresButton != null) { - refresButton.setVisibility(VISIBLE); + refresButton.setVisibility(showRefreshButton); } } From 2f5a0a3ae023b8c93db571f3226aca0344ccca91 Mon Sep 17 00:00:00 2001 From: liujing Date: Fri, 14 Aug 2020 12:12:32 +0800 Subject: [PATCH 07/14] =?UTF-8?q?=E7=BD=91=E7=BB=9C=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/mogo/module/v2x/fragment/V2XShareEventsFragment.java | 4 ++-- .../java/com/mogo/module/v2x/view/V2XNetworkLoadingView.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/fragment/V2XShareEventsFragment.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/fragment/V2XShareEventsFragment.java index 29f91fa0a0..c473c778ad 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/fragment/V2XShareEventsFragment.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/fragment/V2XShareEventsFragment.java @@ -97,7 +97,7 @@ public class V2XShareEventsFragment extends MvpFragment implements AdapterCallba @Override public void onFail(String msg) { - loadingView.stopWithError(msg); + loadingView.stopWithError(msg,View.VISIBLE); loadingView.refresButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { @@ -183,7 +183,7 @@ public class V2XShareEventsFragment extends MvpFragment implements AdapterCallba @Override public void onFail(String msg) { - + loadingView.stopWithError(msg,View.INVISIBLE); } }); } diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/view/V2XNetworkLoadingView.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/view/V2XNetworkLoadingView.java index b8c1e9beea..a73c2c4ccc 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/view/V2XNetworkLoadingView.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/view/V2XNetworkLoadingView.java @@ -76,7 +76,7 @@ public class V2XNetworkLoadingView extends RelativeLayout { } } - public void stopWithError(String errormsg) { + public void stopWithError(String errormsg, int showRefreshButton) { if (v2XAnimationManager != null) { v2XAnimationManager.soptWithError(); } @@ -84,7 +84,7 @@ public class V2XNetworkLoadingView extends RelativeLayout { textView.setText(errormsg); } if (refresButton != null) { - refresButton.setVisibility(VISIBLE); + refresButton.setVisibility(showRefreshButton); } } From 1f0790e0e7bdae26e9a895a0528c9a62da6d7dda Mon Sep 17 00:00:00 2001 From: liujing Date: Fri, 14 Aug 2020 12:25:12 +0800 Subject: [PATCH 08/14] =?UTF-8?q?=E6=8C=87=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../v2x/adapter/V2XShareEventAdapter.java | 27 +------------------ 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/V2XShareEventAdapter.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/V2XShareEventAdapter.java index ee61fb7aa8..1768ed13bf 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/V2XShareEventAdapter.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/V2XShareEventAdapter.java @@ -73,31 +73,6 @@ public class V2XShareEventAdapter extends RecyclerView.Adapter Date: Fri, 14 Aug 2020 12:25:12 +0800 Subject: [PATCH 09/14] =?UTF-8?q?=E6=8C=87=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../v2x/adapter/V2XShareEventAdapter.java | 27 +------------------ 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/V2XShareEventAdapter.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/V2XShareEventAdapter.java index ee61fb7aa8..1768ed13bf 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/V2XShareEventAdapter.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/V2XShareEventAdapter.java @@ -73,31 +73,6 @@ public class V2XShareEventAdapter extends RecyclerView.Adapter Date: Fri, 14 Aug 2020 12:40:26 +0800 Subject: [PATCH 10/14] =?UTF-8?q?=E5=B0=86=E5=8E=86=E5=8F=B2=E5=87=BA?= =?UTF-8?q?=E8=A1=8C=E5=8A=A8=E6=80=81=E6=9F=A5=E8=AF=A2=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E5=AD=90=E7=BA=BF=E7=A8=8B=E6=9F=A5=E8=AF=A2=EF=BC=8C=E9=98=B2?= =?UTF-8?q?=E6=AD=A2ANR=20http://jira.zhidaohulian.com/browse/E85XJD-150?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../v2x/fragment/V2XEventPanelFragment.kt | 82 +++++++++---------- .../fragment/V2XScenarioHistoryFragment.java | 26 +++--- .../presenter/ScenarioHistoryPresenter.java | 8 +- ...e_v2x_event_panel_fragment_event_panel.xml | 2 +- 4 files changed, 64 insertions(+), 54 deletions(-) diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/fragment/V2XEventPanelFragment.kt b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/fragment/V2XEventPanelFragment.kt index 3542bee411..0627defe4c 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/fragment/V2XEventPanelFragment.kt +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/fragment/V2XEventPanelFragment.kt @@ -12,7 +12,6 @@ import com.mogo.module.v2x.V2XServiceManager import com.mogo.module.v2x.adapter.V2XEventPagerAdapter import com.mogo.module.v2x.presenter.EventPanelPresenter import com.mogo.module.v2x.utils.TrackUtils -import com.mogo.module.v2x.utils.V2XSQLiteUtils import com.mogo.module.v2x.view.V2XEventPanelHistoryCountView import com.mogo.utils.logger.Logger import kotlinx.android.synthetic.main.module_v2x_event_panel_fragment_event_panel.* @@ -46,51 +45,52 @@ class V2XEventPanelFragment : MvpFragment(R.id.rgTabSelect) as RadioGroup? - radioGroup!!.setOnCheckedChangeListener { group, checkedId -> - when (checkedId) { - R.id.rbScenarioHistory -> { - TrackUtils.trackV2xHistoryEvent(2) - vpEventPanel.setCurrentItem(0, false) - } - R.id.rbSurroundingEvent -> { - TrackUtils.trackV2xHistoryEvent(3) - vpEventPanel.setCurrentItem(1, false) - } - R.id.rbShareEvents -> { - TrackUtils.trackV2xHistoryEvent(4) - vpEventPanel.setCurrentItem(2, false) + val radioGroup = findViewById(R.id.rgTabSelect) as RadioGroup? + radioGroup!!.setOnCheckedChangeListener { group, checkedId -> + when (checkedId) { + R.id.rbScenarioHistory -> { + TrackUtils.trackV2xHistoryEvent(2) + vpEventPanel.setCurrentItem(0, false) + } + R.id.rbSurroundingEvent -> { + TrackUtils.trackV2xHistoryEvent(3) + vpEventPanel.setCurrentItem(1, false) + } + R.id.rbShareEvents -> { + TrackUtils.trackV2xHistoryEvent(4) + vpEventPanel.setCurrentItem(2, false) + } } } - } - btnHidePanels.setOnClickListener { - TrackUtils.trackV2xHistoryEvent(5) - hidePanel() - } - - mV2XEventPanelHistoryCountView = V2XEventPanelHistoryCountView(context) - mV2XEventPanelHistoryCountView!!.setOnClickListener { - TrackUtils.trackV2xHistoryEvent(1) - if (!isPanelShow()) { - showPanel() - } else { + btnHidePanels.setOnClickListener { + TrackUtils.trackV2xHistoryEvent(5) hidePanel() } - } - V2XServiceManager.getMogoEntranceButtonController().addBottomLayerView(mV2XEventPanelHistoryCountView) - changeEventCount() + mV2XEventPanelHistoryCountView = V2XEventPanelHistoryCountView(context) + mV2XEventPanelHistoryCountView!!.setOnClickListener { + if (!isPanelShow()) { + TrackUtils.trackV2xHistoryEvent(1) + showPanel() + } + } + V2XServiceManager.getMogoEntranceButtonController().addBottomLayerView(mV2XEventPanelHistoryCountView) + changeEventCount() + } catch (e: Exception) { + e.printStackTrace() + } } override fun onDestroyView() { @@ -105,13 +105,13 @@ class V2XEventPanelFragment : MvpFragment v2XHistoryScenarioData) { Logger.d(TAG, "查询到历史消息:" + GsonUtil.jsonFromObject(v2XHistoryScenarioData)); - mV2XHistoryScenarioData.clear(); - if (v2XHistoryScenarioData.size() > 0) { - mEmptyView.setVisibility(View.GONE); - mClHistoryList.setVisibility(View.VISIBLE); - mV2XHistoryScenarioData.addAll(v2XHistoryScenarioData); - } else { - mEmptyView.setVisibility(View.VISIBLE); - mClHistoryList.setVisibility(View.GONE); - } - mV2XScenarioHistoryAdapter.notifyDataSetChanged(); + ThreadUtils.runOnUiThread(new Runnable() { + @Override + public void run() { + mV2XHistoryScenarioData.clear(); + if (v2XHistoryScenarioData.size() > 0) { + mEmptyView.setVisibility(View.GONE); + mClHistoryList.setVisibility(View.VISIBLE); + mV2XHistoryScenarioData.addAll(v2XHistoryScenarioData); + } else { + mEmptyView.setVisibility(View.VISIBLE); + mClHistoryList.setVisibility(View.GONE); + } + mV2XScenarioHistoryAdapter.notifyDataSetChanged(); + } + }); } @Override diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/presenter/ScenarioHistoryPresenter.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/presenter/ScenarioHistoryPresenter.java index d3379857c7..95b3b4ea05 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/presenter/ScenarioHistoryPresenter.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/presenter/ScenarioHistoryPresenter.java @@ -4,7 +4,9 @@ package com.mogo.module.v2x.presenter; import com.mogo.commons.mvp.Presenter; import com.mogo.module.common.entity.V2XHistoryScenarioData; import com.mogo.module.v2x.fragment.V2XScenarioHistoryFragment; +import com.mogo.module.v2x.utils.ThreadUtils; import com.mogo.module.v2x.utils.V2XSQLiteUtils; +import com.mogo.utils.WorkThreadHandler; import java.util.List; @@ -18,7 +20,9 @@ public class ScenarioHistoryPresenter extends Presenter v2XHistoryScenarioData = V2XSQLiteUtils.getScenarioHistoryData(); - mView.loadHistory(v2XHistoryScenarioData); + WorkThreadHandler.getInstance().post(() -> { + List v2XHistoryScenarioData = V2XSQLiteUtils.getScenarioHistoryData(); + mView.loadHistory(v2XHistoryScenarioData); + }); } } diff --git a/modules/mogo-module-v2x/src/main/res/layout/module_v2x_event_panel_fragment_event_panel.xml b/modules/mogo-module-v2x/src/main/res/layout/module_v2x_event_panel_fragment_event_panel.xml index 051d0557f0..fc8f9f24ca 100644 --- a/modules/mogo-module-v2x/src/main/res/layout/module_v2x_event_panel_fragment_event_panel.xml +++ b/modules/mogo-module-v2x/src/main/res/layout/module_v2x_event_panel_fragment_event_panel.xml @@ -20,7 +20,7 @@ From bd1c318f79af2086e450475dfbe3e29398b0965f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=91=A3=E5=AE=8F=E5=AE=87?= Date: Fri, 14 Aug 2020 14:15:03 +0800 Subject: [PATCH 11/14] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BA=86=E9=9D=A2?= =?UTF-8?q?=E5=94=A4=E9=86=92=E8=AF=AD=E5=8F=A5=E6=93=8D=E6=8E=A7=20http:/?= =?UTF-8?q?/jira.zhidaohulian.com/browse/E85XJD-151?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../v2x/fragment/V2XEventPanelFragment.kt | 57 ++++++++++++++++++- .../module/v2x/voice/V2XVoiceConstants.java | 24 +++++++- 2 files changed, 77 insertions(+), 4 deletions(-) diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/fragment/V2XEventPanelFragment.kt b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/fragment/V2XEventPanelFragment.kt index 0627defe4c..ff0cfbf53c 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/fragment/V2XEventPanelFragment.kt +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/fragment/V2XEventPanelFragment.kt @@ -1,7 +1,7 @@ package com.mogo.module.v2x.fragment +import android.content.Intent import android.view.View -import android.widget.RadioGroup import androidx.fragment.app.Fragment import androidx.viewpager2.widget.ViewPager2 import com.google.android.material.tabs.TabLayoutMediator @@ -13,6 +13,9 @@ import com.mogo.module.v2x.adapter.V2XEventPagerAdapter import com.mogo.module.v2x.presenter.EventPanelPresenter import com.mogo.module.v2x.utils.TrackUtils import com.mogo.module.v2x.view.V2XEventPanelHistoryCountView +import com.mogo.module.v2x.voice.V2XVoiceCallbackListener +import com.mogo.module.v2x.voice.V2XVoiceConstants +import com.mogo.module.v2x.voice.V2XVoiceManager import com.mogo.utils.logger.Logger import kotlinx.android.synthetic.main.module_v2x_event_panel_fragment_event_panel.* @@ -39,6 +42,42 @@ class V2XEventPanelFragment : MvpFragment + try { + rgTabSelect?.check(R.id.rbScenarioHistory) + } catch (e: java.lang.Exception) { + e.printStackTrace() + } + } + + // 打开周边事件TAB + private val mCheckSurroundingCb = V2XVoiceCallbackListener { command: String?, intent: Intent? -> + try { + rgTabSelect?.check(R.id.rbSurroundingEvent) + } catch (e: java.lang.Exception) { + e.printStackTrace() + } + } + + // 打开我的分享TAB + private val mCheckShearEventCb = V2XVoiceCallbackListener { command: String?, intent: Intent? -> + try { + rgTabSelect?.check(R.id.rbShareEvents) + } catch (e: java.lang.Exception) { + e.printStackTrace() + } + } + + // 打关闭事件面板 + private val mCloeEventCb = V2XVoiceCallbackListener { command: String?, intent: Intent? -> + try { + hidePanel() + } catch (e: java.lang.Exception) { + e.printStackTrace() + } + } + override fun getLayoutId(): Int { return R.layout.module_v2x_event_panel_fragment_event_panel } @@ -56,8 +95,7 @@ class V2XEventPanelFragment : MvpFragment(R.id.rgTabSelect) as RadioGroup? - radioGroup!!.setOnCheckedChangeListener { group, checkedId -> + rgTabSelect?.setOnCheckedChangeListener { group, checkedId -> when (checkedId) { R.id.rbScenarioHistory -> { TrackUtils.trackV2xHistoryEvent(2) @@ -106,12 +144,25 @@ class V2XEventPanelFragment : MvpFragment Date: Fri, 14 Aug 2020 14:21:20 +0800 Subject: [PATCH 12/14] =?UTF-8?q?=E3=80=90=E6=99=BA=E6=85=A7=E9=A9=BE?= =?UTF-8?q?=E9=A9=B61.1.2=E3=80=91=E5=87=BA=E8=A1=8C=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E7=BB=8F=E8=BF=87=E4=BA=8B=E4=BB=B6=20?= =?UTF-8?q?=E6=96=87=E6=A1=88=E6=98=BE=E7=A4=BA=E9=94=99=E8=AF=AF=EF=BC=8C?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E5=8F=96=E5=80=BC=E9=94=99=E8=AF=AF=20http:/?= =?UTF-8?q?/jira.zhidaohulian.com/browse/E85XJD-157?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../v2x/adapter/holder/V2XScenarioHistoryRoadEventVH.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XScenarioHistoryRoadEventVH.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XScenarioHistoryRoadEventVH.java index 4970ba17bc..4062ef5d86 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XScenarioHistoryRoadEventVH.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XScenarioHistoryRoadEventVH.java @@ -64,7 +64,7 @@ public class V2XScenarioHistoryRoadEventVH extends V2XBaseViewHolder Date: Fri, 14 Aug 2020 14:22:51 +0800 Subject: [PATCH 13/14] add roadtrafic upload --- .../zhidao/roadcondition/constant/Const.kt | 10 +- .../roadcondition/model/InformationBody.kt | 3 +- .../service/CarCorderController.kt | 213 +++++++++--------- .../service/CosCallbackMapController.kt | 1 - .../service/CosStatusController.kt | 83 +++---- .../roadcondition/service/MainService.kt | 27 +-- .../service/MainServiceController.kt | 12 +- .../com/zhidao/roadcondition/util/PdUtil.kt | 6 +- 8 files changed, 177 insertions(+), 178 deletions(-) diff --git a/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/constant/Const.kt b/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/constant/Const.kt index b7628fd94b..889aedacc7 100644 --- a/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/constant/Const.kt +++ b/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/constant/Const.kt @@ -50,23 +50,23 @@ const val TANLU_ROAD_CURRENT = "10015" //实时路况 /** * 用户手点上报 */ -const val UPLOAD_FROM_USER = 1 +const val UPLOAD_FROM_USER = "1" /** * 用户语音上报 */ -const val UPLOAD_FROM_VOICE = 2 +const val UPLOAD_FROM_VOICE = "2" /** * 数据策略:拥堵自动上报 */ -const val UPLOAD_FROM_STRATEGY_BLOCK_AUTO = 3 +const val UPLOAD_FROM_STRATEGY_BLOCK_AUTO = "3" /** * 数据策略:已有事件云端校验 */ -const val UPLOAD_FROM_STRATEGY_CLOUD_CHECK = 4 +const val UPLOAD_FROM_STRATEGY_CLOUD_CHECK = "4" /** * 数据策略:交通事故上报 */ -const val UPLOAD_FROM_STRATEGY_ACCIDENT_AUTO = 5 +const val UPLOAD_FROM_STRATEGY_ACCIDENT_AUTO = "5" /** * 默认视频抓取时长,单位是秒 diff --git a/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/model/InformationBody.kt b/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/model/InformationBody.kt index a57e134a26..1d4c23725f 100644 --- a/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/model/InformationBody.kt +++ b/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/model/InformationBody.kt @@ -20,5 +20,6 @@ data class InformationBody( val trafficInfoType:String, // 上报情报类型 val isShare: Boolean, // 是否分享给附近车机 val direction: Float, - val poiType: String //类型分类 + val poiType: String, //类型分类 + val mainInfoId: Long //事件id ) \ No newline at end of file diff --git a/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/service/CarCorderController.kt b/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/service/CarCorderController.kt index bf664f0cf5..24002c1042 100644 --- a/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/service/CarCorderController.kt +++ b/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/service/CarCorderController.kt @@ -1,13 +1,11 @@ package com.zhidao.roadcondition.service -import android.content.Intent import android.text.TextUtils import android.util.Log import com.hw.videoprocessor.VideoProcessor import com.mogo.commons.AbsMogoApplication import com.mogo.commons.debug.DebugConfig import com.mogo.utils.NetworkUtils -import com.mogo.utils.TipToast import com.zhidao.auto.carcorder.callback.TakePhotoCallback import com.zhidao.auto.carcorder.callback.TakeVideoCallback import com.zhidao.auto.carcorder.controller.ZdCarCoderController @@ -34,6 +32,8 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback { val TAG: String = this.javaClass.simpleName var outputVideoPath: String = "" var mType: String = "" //1 上报拥堵, 2 封路和查车 + var mainInfoId: Long = 0 + var mFromType: String = "" private var getVideoFailed: (() -> Unit)? = null private var interceptors: ArrayList = ArrayList(1) @@ -56,24 +56,28 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback { fun initCarCorderController() { zdCarCoderController = - ZdCarCoderController.getInstance(AbsMogoApplication.getApp().applicationContext) + ZdCarCoderController.getInstance(AbsMogoApplication.getApp().applicationContext) zdCarCoderController.addCallback(this) zdCarCoderController.addVideoCallback(this) zdCarCoderController.init() } fun takePhoto( - photoType: Int, - cameraId: Int, - haveVoice: Boolean, - isCustom: Boolean = false, - type: String + photoType: Int, + cameraId: Int, + haveVoice: Boolean, + isCustom: Boolean = false, + type: String, + mainInfoId: Long, + fromType: String ) { - Log.d(TAG, "takePhoto ---------- type = $type" + " >>>mType =" + mType) + Log.d(TAG, "takePhoto ---------- type = $type --- mType = $mType ---fromType = $fromType") + this.mType = type + this.mainInfoId = mainInfoId + this.mFromType = fromType CustomStatusHandler.offerPhotoStatus(isCustom) zdCarCoderController.takePhoto(photoType, cameraId, haveVoice) trackGetPhoto(1) - this.mType = type } /** @@ -81,15 +85,19 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback { * @param id: 标志是哪一个上传 */ fun takeVideo( - cameraId: Int, - duration: Int, - isCustom: Boolean = false, - id: Long = 0L, - type: String + cameraId: Int, + duration: Int, + isCustom: Boolean = false, + id: Long = 0L, + type: String, + mainInfoId: Long, + fromType: String ) { Log.d(TAG, "takeVideo -------- type = $type") - Log.d(TAG, "takeVideo -------- isCustom = $isCustom") + Log.d(TAG, "takeVideo -------- isCustom = $isCustom ---mFromType = $mFromType") this.mType = type + this.mainInfoId = mainInfoId + this.mFromType = fromType if (DebugConfig.getCarMachineType() == 0) { //自研车机 outputVideoPath = getCompressVideoPath() CustomStatusHandler.offerVideoStatus(TakeEntity(isCustom, id)) @@ -100,27 +108,28 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback { // if (!NetworkUtils.isConnected(AbsMogoApplication.getApp().applicationContext)) { // TipToast.shortTip("分享失败,请检查网络") // } else { - //失败了,传空地址,发起请求 - val entity = TakeEntity(isCustom, id) - videoAndThumbMap["video"] = "" - videoAndThumbMap["thumb"] = "" + //失败了,传空地址,发起请求 + val entity = TakeEntity(isCustom, id) + videoAndThumbMap["video"] = "" + videoAndThumbMap["thumb"] = "" - CosStatusController().sendInformationDirectly( + CosStatusController().sendInformationDirectly( INFO_TYPE_VIDEO, videoAndThumbMap, mType, - entity - ) + entity, + mainInfoId + ) - //地图上打点 - taskAsync(3_000) { - try { - LatLngStickyEventBus.getInstance() + //地图上打点 + taskAsync(3_000) { + try { + LatLngStickyEventBus.getInstance() .postSticky(GetImageSuccessEvent("", mType)) - } catch (e: java.lang.Exception) { - e.printStackTrace() - } + } catch (e: java.lang.Exception) { + e.printStackTrace() } + } // } } } @@ -138,18 +147,17 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback { } val isCustom = CustomStatusHandler.pollPhotoStatus() val entity = TakeEntity(isCustom, 0L) - Log.e(TAG, "onTakePhotoFail -----mType = $mType ") - Log.e(TAG, "onTakePhotoFail -----isCustom = $isCustom ") + Log.e(TAG, "onTakePhotoFail -----mType = $mType --- isCustom = $isCustom") //语音播报 1:上报路况,2:交通检查,3:封路 默认 mType 应该为null if (mType.equals(TANLU_ROAD_CONGESTION) || mType.equals(TANLU_TRAFFIC_CHECK) || mType.equals( - TANLU_ROAD_CLOSURE - ) - || mType.equals(TANLU_ROAD_CURRENT) || mType.equals(TANLU_ROAD_PONDING) || mType.equals( - TANLU_ROAD_ICING - ) - || mType.equals(TANLU_ROAD_HEAVY_FOG) || mType.equals(TANLU_ROAD_ACCIDENT) || mType.equals( - TANLU_ROAD_WORK - ) + TANLU_ROAD_CLOSURE + ) + || mType.equals(TANLU_ROAD_CURRENT) || mType.equals(TANLU_ROAD_PONDING) || mType.equals( + TANLU_ROAD_ICING + ) + || mType.equals(TANLU_ROAD_HEAVY_FOG) || mType.equals(TANLU_ROAD_ACCIDENT) || mType.equals( + TANLU_ROAD_WORK + ) ) { taskAsync(1_500) { try { @@ -165,28 +173,20 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback { //获取图片失败也上报,图片不打点 if (isCustom) { CosStatusController().sendInformationDirectly( - INFO_TYPE_IMG, - mutableMapOf("pic" to "" as String), - mType, - entity + INFO_TYPE_IMG, + mutableMapOf("pic" to "" as String), + mType, + entity, + mainInfoId ); } } } - private fun sendGetInfoFailedReceiver(type: String) { - Log.e(TAG, "sendGetInfoFailedReceiver ------>") - var intent = Intent() - intent.action = "com.zhidao.roadcondition.getinfo.failed" - intent.putExtra("type", type) - AbsMogoApplication.getApp().applicationContext.sendBroadcast(intent) - } - - //拍照成功回调返回图片本地路径 override fun onTakePhotoSuccess(photoType: Int, camera: Int, photoPath: String?) { trackGetPhoto(2) - Log.d(TAG, "onTakePhotoSuccess -----mType = $mType") + Log.d(TAG, "onTakePhotoSuccess -----mType = $mType --- mainInfoId = $mainInfoId") val isCustom = CustomStatusHandler.pollPhotoStatus() val entity = TakeEntity(isCustom, 0L) @@ -204,35 +204,37 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback { } var minSpeedPic = - getStrategyMinSpeed( - AbsMogoApplication.getApp().applicationContext, - "pic", - getStrategyType("pic") - ) + getStrategyMinSpeed( + AbsMogoApplication.getApp().applicationContext, + "pic", + getStrategyType("pic") + ) var maxSpeedPic = - getStrategyMaxSpeed( - AbsMogoApplication.getApp().applicationContext, - "pic", - getStrategyType("pic") - ) + getStrategyMaxSpeed( + AbsMogoApplication.getApp().applicationContext, + "pic", + getStrategyType("pic") + ) var speed = LocationUtil.getInstance().getSpeed() if (!TextUtils.isEmpty(mType)) { Log.d(TAG, "onTakePhotoSuccess mType != null") - CosStatusController().uploadFile(mutableListOf(photoPath as String), entity, mType) + CosStatusController().uploadFile(mutableListOf(photoPath as String), entity, mType, mainInfoId, mFromType) } else { Log.d(TAG, "onTakePhotoSuccess mType == null") Log.d( - TAG, - "onTakePhotoSuccess maxSpeedPic = $maxSpeedPic ---> speed = $speed ---->minSpeedPic= $minSpeedPic" + TAG, + "onTakePhotoSuccess maxSpeedPic = $maxSpeedPic ---> speed = $speed ---->minSpeedPic= $minSpeedPic" ) if (maxSpeedPic == -1) { if (speed >= (Math.abs(minSpeedPic) / 3.6f)) { Log.d(TAG, "onTakePhotoSuccess abs =" + (Math.abs(minSpeedPic) / 3.6f)) CosStatusController().uploadFile( - mutableListOf(photoPath as String), - entity, - mType + mutableListOf(photoPath as String), + entity, + mType, + mainInfoId, + mFromType ) } } @@ -241,9 +243,11 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback { Log.d(TAG, "onTakePhotoSuccess minSpeedPic > 0 -- speed = $speed") if ((speed >= (minSpeedPic / 3.6f)) && speed <= (maxSpeedPic / 3.6f)) { CosStatusController().uploadFile( - mutableListOf(photoPath as String), - entity, - mType + mutableListOf(photoPath as String), + entity, + mType, + mainInfoId, + mFromType ) } } @@ -253,11 +257,11 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback { //获取视频成功 override fun onTakeVideoSuccess(camera: Int, videoPath: String?) { var thumbnailPath = - AbsMogoApplication.getApp().applicationContext.filesDir.parent + File.separator + "Thumbnail${System.currentTimeMillis()}.jpg" + AbsMogoApplication.getApp().applicationContext.filesDir.parent + File.separator + "Thumbnail${System.currentTimeMillis()}.jpg" var isSuccess = getVideoThumbnail(videoPath!!, thumbnailPath) Log.d( - TAG, - "getVideo onTakeVideoSuccess===$videoPath -----> isSuccess= $isSuccess ----> mType = $mType " + TAG, + "getVideo onTakeVideoSuccess===$videoPath -----> isSuccess= $isSuccess ----> mType = $mType --- mainInfoId = $mainInfoId" ) val entity = CustomStatusHandler.pollVideoStatus() @@ -267,12 +271,12 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback { if (isSuccess) { var minSpeedVideo = getStrategyMinSpeed( - AbsMogoApplication.getApp().applicationContext, "video", - getStrategyType("video") + AbsMogoApplication.getApp().applicationContext, "video", + getStrategyType("video") ) var maxSpeedVideo = getStrategyMaxSpeed( - AbsMogoApplication.getApp().applicationContext, "video", - getStrategyType("video") + AbsMogoApplication.getApp().applicationContext, "video", + getStrategyType("video") ) var speed = LocationUtil.getInstance().getSpeed() //TODO @@ -286,8 +290,8 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback { compressVideo(videoPath, thumbnailPath, entity) } else { Log.d( - TAG, - "onTakeVideoSuccess maxSpeedVideo = $maxSpeedVideo --->speed= $speed + minSpeedVideo = $minSpeedVideo" + TAG, + "onTakeVideoSuccess maxSpeedVideo = $maxSpeedVideo --->speed= $speed + minSpeedVideo = $minSpeedVideo" ) if (maxSpeedVideo == -1) { Log.d(TAG, "onTakeVideoSuccess 111 abs =" + (Math.abs(minSpeedVideo) / 3.6f)) @@ -328,10 +332,11 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback { videoAndThumbMap["thumb"] = "" CosStatusController().sendInformationDirectly( - INFO_TYPE_VIDEO, - videoAndThumbMap, - mType, - entity + INFO_TYPE_VIDEO, + videoAndThumbMap, + mType, + entity, + mainInfoId ) //地图上打点 @@ -349,26 +354,28 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback { */ fun compressVideo(videoPath: String, thumbnailPath: String, entity: TakeEntity) { Log.d( - TAG, - "outputVideoPath = " + outputVideoPath + ">> videoPath=" + videoPath + " isCustom = ${entity?.isCustom}" + TAG, + "outputVideoPath = " + outputVideoPath + ">> videoPath=" + videoPath + " isCustom = ${entity?.isCustom}" ) var startTime = System.currentTimeMillis() Thread(Runnable { try { VideoProcessor.processor(AbsMogoApplication.getApp().applicationContext) - .input(videoPath) - .output(outputVideoPath) - .removeAudio(true) - .outWidth(1920) - .outHeight(1080) - .bitrate(2000 * 1024) - .frameRate(25) - .process() + .input(videoPath) + .output(outputVideoPath) + .removeAudio(true) + .outWidth(1920) + .outHeight(1080) + .bitrate(2000 * 1024) + .frameRate(25) + .process() Log.d(TAG, "compress cost time =" + (System.currentTimeMillis() - startTime)) CosStatusController().uploadFile( - mutableListOf(outputVideoPath, thumbnailPath), - entity, - mType + mutableListOf(outputVideoPath, thumbnailPath), + entity, + mType, + mainInfoId, + mFromType ) //删除压缩前的视频 deletePicFile(videoPath) @@ -392,16 +399,16 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback { //获取图片 private fun trackGetPhoto(type: Int) { trackNormalEvent( - CarNet_Get_Picture, mutableMapOf("type" to type), - AbsMogoApplication.getApp().applicationContext + CarNet_Get_Picture, mutableMapOf("type" to type), + AbsMogoApplication.getApp().applicationContext ) } //获取视频 private fun trackGetVideo(type: Int) { trackNormalEvent( - CarNet_Get_Video, mutableMapOf("type" to type), - AbsMogoApplication.getApp().applicationContext + CarNet_Get_Video, mutableMapOf("type" to type), + AbsMogoApplication.getApp().applicationContext ) } diff --git a/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/service/CosCallbackMapController.kt b/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/service/CosCallbackMapController.kt index 4ea6399cdf..a7f80df795 100644 --- a/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/service/CosCallbackMapController.kt +++ b/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/service/CosCallbackMapController.kt @@ -41,7 +41,6 @@ object CosCallbackMapController : CosStatusCallback { path?.let { map.remove(path) } - Log.d(TAG, "size: ${map.size}") } fun unregisterCallbacks(paths: Map?) { diff --git a/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/service/CosStatusController.kt b/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/service/CosStatusController.kt index cddc661ccd..464744387b 100644 --- a/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/service/CosStatusController.kt +++ b/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/service/CosStatusController.kt @@ -36,22 +36,26 @@ class CosStatusController : CosStatusCallback { private lateinit var entity: TakeEntity private var mType: String = "" + private var mainInfoId: Long = 0 + private var mFromType: String = "" //上传文件 - fun uploadFile(picPath: MutableList, entity: TakeEntity, type: String) { + fun uploadFile(picPath: MutableList, entity: TakeEntity, type: String, mainInfoId: Long, fromType: String) { CosCallbackMapController.registerCallback(picPath, this) // CosLogger.setLogStatus(true) this.entity = entity this.mType = type - Log.d(TAG, "uploadFile type===$type ---- picPath = $picPath ") + this.mainInfoId = mainInfoId + this.mFromType = fromType; + Log.d(TAG, "uploadFile type===$type ---- mainInfoId =$mainInfoId ----mFromType = $mFromType ---- picPath = $picPath ") trackUploadCos(3) if (picPath.contains("backPic")) return //参数说明: paths:本地文件路径;(注:上传的本地路径不要重复);config:文件上传的优先级 mPicEventId = - CosUploadManagerImpl.getInstance(AbsMogoApplication.getApp().applicationContext).eventId + CosUploadManagerImpl.getInstance(AbsMogoApplication.getApp().applicationContext).eventId CosUploadManagerImpl.getInstance(AbsMogoApplication.getApp().applicationContext) - .upload(picPath, mPicEventId, DbPriorityConfig.PRIORITY_HIGH) + .upload(picPath, mPicEventId, DbPriorityConfig.PRIORITY_HIGH) } @@ -68,22 +72,21 @@ class CosStatusController : CosStatusCallback { override fun uploadCosFailed(cosPath: String?, eventId: String?, localPath: String?) { Log.d(TAG, "uploadCosFailed = $localPath") - Log.d(TAG, "uploadCosFailed CarCorderController.mType = " + CarCorderController.mType) trackUploadCos(2) //语音播报 1:上报路况,2:交通检查,3:封路 默认 mType 应该为null if (CarCorderController.mType.equals(TANLU_ROAD_CONGESTION) || CarCorderController.mType.equals( - TANLU_TRAFFIC_CHECK - ) || CarCorderController.mType.equals(TANLU_ROAD_CLOSURE) - || CarCorderController.mType.equals(TANLU_ROAD_CURRENT) || CarCorderController.mType.equals( - TANLU_ROAD_PONDING - ) || CarCorderController.mType.equals(TANLU_ROAD_ICING) - || CarCorderController.mType.equals(TANLU_ROAD_HEAVY_FOG) || CarCorderController.mType.equals( - TANLU_ROAD_ACCIDENT - ) || CarCorderController.mType.equals(TANLU_ROAD_WORK) + TANLU_TRAFFIC_CHECK + ) || CarCorderController.mType.equals(TANLU_ROAD_CLOSURE) + || CarCorderController.mType.equals(TANLU_ROAD_CURRENT) || CarCorderController.mType.equals( + TANLU_ROAD_PONDING + ) || CarCorderController.mType.equals(TANLU_ROAD_ICING) + || CarCorderController.mType.equals(TANLU_ROAD_HEAVY_FOG) || CarCorderController.mType.equals( + TANLU_ROAD_ACCIDENT + ) || CarCorderController.mType.equals(TANLU_ROAD_WORK) ) { // VoiceController.speakVoice("cos上报失败") Log.d(TAG, "uploadCosFailed mType = $mType") - if (entity?.isCustom) { + if (entity?.isCustom && mFromType != UPLOAD_FROM_STRATEGY_ACCIDENT_AUTO) { sendGetInfoFailedReceiver("100") } } @@ -108,10 +111,10 @@ class CosStatusController : CosStatusCallback { } override fun uploadCosCompleted( - cosPath: String?, - eventId: String?, - downloadUrl: String?, - localPath: String? + cosPath: String?, + eventId: String?, + downloadUrl: String?, + localPath: String? ) { Log.d(TAG, "uploadFile mType= $mType") Log.d(TAG, "uploadCosCompleted localPath = $localPath") @@ -130,22 +133,21 @@ class CosStatusController : CosStatusCallback { Log.d(TAG, "videoAndThumbMap ${videoAndThumbMap}") if (videoAndThumbMap.size == 2) { Log.d(TAG, "videoAndThumbMap.size == 2 ") - var locationInfo = LocationUtil.getInstance().getLocationInfo() val locationStr: String = Gson().toJson(locationInfo) Log.d(TAG, "locationStr = " + locationStr) //如果失败,需要提示失败弹框 if (locationInfo.address.isNullOrEmpty() || locationInfo.cityName.isNullOrEmpty() || locationInfo.cityCode.isNullOrEmpty() - || locationInfo.latitude == 0.0 || locationInfo.areaName.isNullOrEmpty() || locationInfo.street.isNullOrEmpty() - || locationInfo.areaCode.isNullOrEmpty() || locationInfo.provinceName.isNullOrEmpty() + || locationInfo.latitude == 0.0 || locationInfo.areaName.isNullOrEmpty() || locationInfo.street.isNullOrEmpty() + || locationInfo.areaCode.isNullOrEmpty() || locationInfo.provinceName.isNullOrEmpty() ) { - if (entity?.isCustom) { + if (entity?.isCustom && mFromType != UPLOAD_FROM_STRATEGY_ACCIDENT_AUTO) { sendGetInfoFailedReceiver("100") } } else { //分享成功,并打点,如果是上报拥堵,需要takeVideo LatLngStickyEventBus.getInstance() - .postSticky(GetImageSuccessEvent(downloadUrl, mType)) + .postSticky(GetImageSuccessEvent(downloadUrl, mType)) //上传录像以及缩略图成功 sendInformation(INFO_TYPE_VIDEO, videoAndThumbMap) } @@ -155,10 +157,11 @@ class CosStatusController : CosStatusCallback { Log.d(TAG, "uploadCosCompleted 分享成功 ----mType = $mType") // if (mType.equals("1") || mType.equals("-1")) { sendInformationDirectly( - INFO_TYPE_IMG, - mutableMapOf("pic" to downloadUrl as String), - mType, - entity + INFO_TYPE_IMG, + mutableMapOf("pic" to downloadUrl as String), + mType, + entity, + mainInfoId ) // } } @@ -174,7 +177,7 @@ class CosStatusController : CosStatusCallback { // CosCallbackMapController.mainService?.sendCustomResult(it) // } // } else { - sendInformationDirectly(type, map, mType, entity) + sendInformationDirectly(type, map, mType, entity, mainInfoId) // } } @@ -182,18 +185,20 @@ class CosStatusController : CosStatusCallback { * 被动上报时直接上报,不用等待、选择情报类型 */ fun sendInformationDirectly( - type: Int, - map: Map, - poiType: String, - entity: TakeEntity + type: Int, + map: Map, + poiType: String, + entity: TakeEntity, + mainInfoId: Long ) { Log.d(TAG, "sendInformationDirectly isCustomSend = ${entity?.isCustom}") - Log.d(TAG, "sendInformationDirectly poiType= $poiType") + Log.d(TAG, "sendInformationDirectly poiType= $poiType ---- mainInfoId= $mainInfoId") mainServiceHttpModel.sendInformationMessage( - type = type, - url = map, - isCustom = entity?.isCustom, - poiType = poiType + type = type, + url = map, + isCustom = entity?.isCustom, + poiType = poiType, + mainInfoId = mainInfoId ) { success -> CosCallbackMapController.unregisterCallbacks(map) CosCallbackMapController.mainService?.let { @@ -208,8 +213,8 @@ class CosStatusController : CosStatusCallback { //上传COS private fun trackUploadCos(type: Int) { trackNormalEvent( - CarNet_Cos_Upload, mutableMapOf("type" to type), - AbsMogoApplication.getApp().applicationContext + CarNet_Cos_Upload, mutableMapOf("type" to type), + AbsMogoApplication.getApp().applicationContext ) } diff --git a/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/service/MainService.kt b/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/service/MainService.kt index 6b1d364db3..91700ea1cc 100644 --- a/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/service/MainService.kt +++ b/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/service/MainService.kt @@ -61,7 +61,7 @@ class MainService : Service() { var isCustom: Boolean = false var params: UploadParams? = null - + var mainInfoId: Long = 0 //发送主动上报结果广播给外部 fun sendCustomResult(result: Boolean) { @@ -73,12 +73,9 @@ class MainService : Service() { override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int { Log.d(TAG, "onStartCommand -----------> ") //清理多媒体资源和sp策略数据 -// DelayService.launchService(this) clearStrategyType(this) //初始化埋点 Analytics.getInstance().start(this) - //初始化定位 -// LocationUtil.getInstance().initLocation() //参数说明:appKey: app唯一标识(比如:包名) CosUploadManagerImpl.getInstance(AbsMogoApplication.getApp().applicationContext) .init(BuildConfig.APPLICATION_ID, 2) @@ -90,13 +87,14 @@ class MainService : Service() { params?.let { shareType = it.eventType fromType = it.fromType + mainInfoId = 0 //TODO Log.d(TAG, "onStartCommand shareType = $shareType") if (shareType == TANLU_ROAD_CONGESTION || shareType == TANLU_TRAFFIC_CHECK || shareType == TANLU_ROAD_CLOSURE || shareType == TANLU_ROAD_CURRENT || shareType == TANLU_ROAD_PONDING || shareType == TANLU_ROAD_ICING || shareType == TANLU_ROAD_HEAVY_FOG || shareType == TANLU_ROAD_ACCIDENT || shareType == TANLU_ROAD_WORK ) { // takePhoto(1, false, true) - if (!fromType.equals("5")) { // 是策略触发,不提示 + if (!fromType.equals(UPLOAD_FROM_STRATEGY_ACCIDENT_AUTO)) { // 是策略触发,不提示 takeVideo(it.duration, isCustom = true, id = id) } else { takeVideo(it.duration) @@ -124,12 +122,6 @@ class MainService : Service() { var duration = p1.getIntExtra("duration", 3) takeVideo(duration, true) } - } else if (p1.action == "com.zhidao.takevideo.test") { - //视频 - takeVideo(p1.getIntExtra("duration", 10)) - } else if (p1.action == "com.zhidao.takepic.test") { - //视频 - takePhoto(1) } } } @@ -144,14 +136,6 @@ class MainService : Service() { } } - /** - * 发送获取图片 - */ - fun startUploadInformation() { - var customIntent = Intent(sendInformationAction) - sendBroadcast(customIntent) - } - override fun onBind(intent: Intent?): IBinder? { return null } @@ -159,7 +143,6 @@ class MainService : Service() { override fun onCreate() { super.onCreate() - Log.d(TAG, "onCreate ------> 1") init() //初始化定位 LocationUtil.getInstance().initLocation() @@ -295,7 +278,7 @@ class MainService : Service() { Observable.intervalRange(0, 1, 0, 2_000, TimeUnit.MILLISECONDS) .observeOn(AndroidSchedulers.mainThread()) .subscribe(Consumer { - CarCorderController.takePhoto(1, 1, false, isCustom, TANLU_ROAD_CURRENT) + CarCorderController.takePhoto(1, 1, false, isCustom, TANLU_ROAD_CURRENT, mainInfoId, fromType) }) // } @@ -314,7 +297,7 @@ class MainService : Service() { Log.d("MainService", "takeVideo --------1---->") // if (isAuthorization(BaseApplication.getAppContext())) { // log(TAG, "takeVideo --------2---->") - CarCorderController.takeVideo(1, duration, isCustom, id, if (isCustom) shareType else TANLU_ROAD_CURRENT) + CarCorderController.takeVideo(1, duration, isCustom, id, if (isCustom) shareType else TANLU_ROAD_CURRENT, mainInfoId, fromType) // } postVideoAlarmTask(isInterval) diff --git a/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/service/MainServiceController.kt b/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/service/MainServiceController.kt index a2dcfde83e..9fb7e4ee51 100644 --- a/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/service/MainServiceController.kt +++ b/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/service/MainServiceController.kt @@ -226,16 +226,17 @@ class MainServiceController { trafficInfoType:String = "", isShare:Boolean = false, poiType:String, + mainInfoId:Long, customSend: ((Boolean) -> Unit)? = null ) { Log.d(TAG, " sendInformationMessage poiType = $poiType"); //删除测试数据 var locationInfo = LocationUtil.getInstance().getLocationInfo(); if (locationInfo.address.isNullOrEmpty()) { - geoLocation(type, url, locationInfo, isCustom,trafficInfoType, isShare, customSend,poiType) + geoLocation(type, url, locationInfo, isCustom,trafficInfoType, isShare, customSend,poiType,mainInfoId) } else { postInformationMessage( - getInformationBody(type, url, locationInfo, isCustom, trafficInfoType, isShare,poiType), + getInformationBody(type, url, locationInfo, isCustom, trafficInfoType, isShare,poiType,mainInfoId), customSend ) } @@ -251,19 +252,20 @@ class MainServiceController { trafficInfoType:String, isShare: Boolean, customSend: ((Boolean) -> Unit)? = null, - poiType: String + poiType: String, + mainInfoId: Long ) { Log.d(TAG, " geoLocation -- poiType = $poiType"); LocationUtil.getInstance() .geoCodeLocation(locationInfo.toLatLngPoint(), { locInfo: LocationInfo -> postInformationMessage( - getInformationBody(type, url, locationInfo, isCustom, trafficInfoType, isShare, poiType), + getInformationBody(type, url, locationInfo, isCustom, trafficInfoType, isShare, poiType,mainInfoId), customSend ) }, { //转换失败的情况下再重试一次 geoRetryed = if (!geoRetryed) { - geoLocation(type, url, locationInfo, isCustom, trafficInfoType, isShare, customSend, poiType) + geoLocation(type, url, locationInfo, isCustom, trafficInfoType, isShare, customSend, poiType,mainInfoId) true } else { false diff --git a/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/util/PdUtil.kt b/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/util/PdUtil.kt index 951c4aceec..60d97f3871 100644 --- a/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/util/PdUtil.kt +++ b/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/util/PdUtil.kt @@ -28,7 +28,8 @@ fun getInformationBody( isCustom: Boolean, trafficInfoType:String = "", isShare:Boolean, - poiType: String + poiType: String, + mainInfoId: Long ): InformationBody { var jsonArray = JsonArray() var type: Int @@ -65,7 +66,8 @@ fun getInformationBody( trafficInfoType, isShare, locationInfo.direction, - poiType + poiType, + mainInfoId ) } From 92503c4b8538c44a6bc46f6b77fc595d454b4bb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=91=A3=E5=AE=8F=E5=AE=87?= Date: Fri, 14 Aug 2020 14:36:29 +0800 Subject: [PATCH 14/14] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BA=86=E5=88=86?= =?UTF-8?q?=E4=BA=AB=E9=9D=A2=E6=9D=BF=E5=85=B3=E9=97=AD=E5=BD=93=E5=89=8D?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E9=9D=A2=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/mogo/module/v2x/fragment/V2XScenarioHistoryFragment.java | 1 + .../com/mogo/module/v2x/fragment/V2XShareEventsFragment.java | 1 + 2 files changed, 2 insertions(+) diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/fragment/V2XScenarioHistoryFragment.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/fragment/V2XScenarioHistoryFragment.java index 09cfa19bf7..f1ca65c970 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/fragment/V2XScenarioHistoryFragment.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/fragment/V2XScenarioHistoryFragment.java @@ -73,6 +73,7 @@ public class V2XScenarioHistoryFragment @Override public void onShearClick() { V2XServiceManager.getMogoShareManager().showShareDialog(); + V2XEventPanelFragment.Companion.getInstance().hidePanel(); } @Override diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/fragment/V2XShareEventsFragment.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/fragment/V2XShareEventsFragment.java index c473c778ad..3c876c725e 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/fragment/V2XShareEventsFragment.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/fragment/V2XShareEventsFragment.java @@ -77,6 +77,7 @@ public class V2XShareEventsFragment extends MvpFragment implements AdapterCallba /* * 获取热心指数,分享列表等分享内容 * */ + @Override public void getShareEventResponse() { animatioonAcction(View.VISIBLE); v2XShareNetworkModel.getShareEventResponse(pageNum, 10, new V2XRefreshCallback() {