From 3ed51c39473287c93dea731dc025b8274f2b00d9 Mon Sep 17 00:00:00 2001 From: tongchenfei Date: Thu, 30 Jul 2020 15:26:46 +0800 Subject: [PATCH 1/4] bug fix --- .../module/extensions/utils/TopViewAnimHelper.java | 14 ++++++++++++++ .../module/extensions/utils/TopViewManager.java | 12 ++++++++++++ 2 files changed, 26 insertions(+) diff --git a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/utils/TopViewAnimHelper.java b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/utils/TopViewAnimHelper.java index 177aa0c2a8..bdda5bb436 100644 --- a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/utils/TopViewAnimHelper.java +++ b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/utils/TopViewAnimHelper.java @@ -662,4 +662,18 @@ public class TopViewAnimHelper { tvTurnInfo.setVisibility(visibility); } + + public void removeAllView(){ + isTopViewOut = true; + int lastCount = topContainer.getChildCount(); + for (int i = 0; i < lastCount; i++) { + View child = topContainer.getChildAt(i); + viewCaches.remove(child); + IMogoTopViewStatusListener listener = statusListenerMap.remove(child); + if (listener != null) { + listener.onViewRemoved(child); + } + } + topContainer.removeAllViews(); + } } diff --git a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/utils/TopViewManager.java b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/utils/TopViewManager.java index 29a161821c..c5f4d77e80 100644 --- a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/utils/TopViewManager.java +++ b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/utils/TopViewManager.java @@ -6,8 +6,12 @@ import android.view.ViewGroup; import android.view.ViewGroup.LayoutParams; import com.alibaba.android.arouter.facade.annotation.Route; +import com.alibaba.android.arouter.launcher.ARouter; import com.mogo.module.extensions.R; +import com.mogo.service.IMogoServiceApis; import com.mogo.service.MogoServicePaths; +import com.mogo.service.statusmanager.IMogoStatusChangedListener; +import com.mogo.service.statusmanager.StatusDescriptor; import com.mogo.service.windowview.IMogoTopViewManager; import com.mogo.service.windowview.IMogoTopViewStatusListener; @@ -21,10 +25,18 @@ public class TopViewManager implements IMogoTopViewManager { private Context context; private LayoutParams parentParams; + private IMogoServiceApis serviceApis; @Override public void init(Context context) { this.context = context; + serviceApis = + (IMogoServiceApis) ARouter.getInstance().build(MogoServicePaths.PATH_SERVICE_APIS).navigation(context); + serviceApis.getStatusManagerApi().registerStatusChangedListener(MogoServicePaths.PATH_EXTENSIONS_TOP_VIEW_MANAGER, StatusDescriptor.MAIN_PAGE_RESUME, (descriptor, isTrue) -> { + if (!isTrue) { + TopViewAnimHelper.getInstance().removeAllView(); + } + }); } @Override From aef7a4aa82e4f6bec7b881a9f7330b329d6c796b Mon Sep 17 00:00:00 2001 From: lixiaopeng Date: Thu, 30 Jul 2020 15:35:37 +0800 Subject: [PATCH 2/4] opt --- .idea/misc.xml | 2 +- gradle.properties | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index 21e99e2dc0..cd77a1f062 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -4,7 +4,7 @@ - + \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 45c439c828..46675692e3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -63,7 +63,7 @@ MOGO_BASE_SERVICES_SDK_VERSION = 1.2.1.22 ## 工程外部模块 # 探路 -MOGO_MODULE_TANLU_VERSION=1.3.1.16 +MOGO_MODULE_TANLU_VERSION=1.3.1.19 # 车聊聊 CARCHATTING_VERSION=1.4.8 # 车聊聊接口 @@ -81,7 +81,7 @@ MOGO_MODULE_PUSH_NOOP_VERSION=1.1.5.6 # 广告资源位 MOGO_MODULE_AD_CARD_VERSION=1.0.1 # 探路上报和分享模块 -TANLULIB_VERSION=1.3.1.16 +TANLULIB_VERSION=1.3.1.19 MOGO_MODULE_EVENT_PANEL_VERSION = 1.0.0-SNAPSHOT MOGO_MODULE_EVENT_PANEL_NOOP_VERSION = 1.0.0-SNAPSHOT #左侧面板模块 From 68443c043fdbe4db94d7dcd0c1af7ee91bfc8152 Mon Sep 17 00:00:00 2001 From: tongchenfei Date: Thu, 30 Jul 2020 15:48:58 +0800 Subject: [PATCH 3/4] bug fix --- .../com/mogo/module/extensions/utils/TopViewAnimHelper.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/utils/TopViewAnimHelper.java b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/utils/TopViewAnimHelper.java index bdda5bb436..9359557453 100644 --- a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/utils/TopViewAnimHelper.java +++ b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/utils/TopViewAnimHelper.java @@ -664,6 +664,7 @@ public class TopViewAnimHelper { } public void removeAllView(){ + Logger.d(TAG, "remove all view"); isTopViewOut = true; int lastCount = topContainer.getChildCount(); for (int i = 0; i < lastCount; i++) { @@ -675,5 +676,7 @@ public class TopViewAnimHelper { } } topContainer.removeAllViews(); + hideNaviView(); + MapCenterPointStrategy.setMapCenterPointByScene(mogoMapUIController, Scene.AIMLESS); } } From 6fd41b9958a21bf09430088d981600446897e0d3 Mon Sep 17 00:00:00 2001 From: lixiaopeng Date: Thu, 30 Jul 2020 15:50:49 +0800 Subject: [PATCH 4/4] opt --- gradle.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index 46675692e3..5f9477869a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -63,7 +63,7 @@ MOGO_BASE_SERVICES_SDK_VERSION = 1.2.1.22 ## 工程外部模块 # 探路 -MOGO_MODULE_TANLU_VERSION=1.3.1.19 +MOGO_MODULE_TANLU_VERSION=1.3.1.20 # 车聊聊 CARCHATTING_VERSION=1.4.8 # 车聊聊接口 @@ -81,7 +81,7 @@ MOGO_MODULE_PUSH_NOOP_VERSION=1.1.5.6 # 广告资源位 MOGO_MODULE_AD_CARD_VERSION=1.0.1 # 探路上报和分享模块 -TANLULIB_VERSION=1.3.1.19 +TANLULIB_VERSION=1.3.1.20 MOGO_MODULE_EVENT_PANEL_VERSION = 1.0.0-SNAPSHOT MOGO_MODULE_EVENT_PANEL_NOOP_VERSION = 1.0.0-SNAPSHOT #左侧面板模块