diff --git a/OCH/mogo-och-bus-passenger/src/jinlvvan/res/layout/bus_p_base_fragment.xml b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/layout/bus_p_base_fragment.xml index 1c6818a53e..9f21d94c8a 100644 --- a/OCH/mogo-och-bus-passenger/src/jinlvvan/res/layout/bus_p_base_fragment.xml +++ b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/layout/bus_p_base_fragment.xml @@ -52,7 +52,7 @@ app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" /> - - isReset = $isReset ") + if (!hasObuLightStatus) { + if(isReset){ + hide() + } + } + } + private fun hide(){ + CallerLogger.d("${SceneConstant.M_OBU}${TAG}", "hide() -------> ") CallerTrafficLightListenerManager.disableTrafficLight() if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) { CallerTelematicManager.sendMsgToAllClients(TelematicConstant.HIDE_TRAFFIC_LIGHT, "0".toByteArray()) @@ -172,7 +184,7 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight lightSource: DataSourceType ) { super.onTrafficLightPlusSource(light, remain, lightSource) - CallerLogger.d("${SceneConstant.M_OBU}${TAG}", "onTrafficLightPlusSource ----- light = $light ---remain = $remain ---lightSource = $lightSource") +// CallerLogger.d("${SceneConstant.M_OBU}${TAG}", "onTrafficLightPlusSource ----- light = $light ---remain = $remain ---lightSource = $lightSource") if (lightSource == DataSourceType.OBU) { hasObuLightStatus = true } @@ -213,9 +225,9 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight } onTrafficLightPlusSource(it.convert(), remain, DataSourceType.AICLOUD) } - } + fun destroy() { //取消注册监听AI云.OBU,路侧获取红绿灯状态 CallerTrafficLightListenerManager.removeListener(TAG) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SingleTrafficLightView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SingleTrafficLightView.kt index 97944c844e..4cad9b61a0 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SingleTrafficLightView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SingleTrafficLightView.kt @@ -14,12 +14,16 @@ import com.mogo.eagle.core.data.enums.TrafficLightEnum import com.mogo.eagle.core.function.api.datacenter.union.IMoGoTrafficLightListener import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.TrafficLightView_TAG +import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager +import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager import com.mogo.eagle.core.function.hmi.R import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI +import com.mogo.eagle.core.utilcode.util.ThreadUtils import com.mogo.eagle.core.utilcode.util.UiThreadHandler +import kotlinx.android.synthetic.main.hmi_view_traffic_light.view.* /** * 新版红绿灯view @@ -28,7 +32,8 @@ class SingleTrafficLightView @JvmOverloads constructor( context: Context?, attrs: AttributeSet? = null, defStyleAttr: Int = 0 -) : LinearLayout(context, attrs, defStyleAttr), IViewControlListener, IMoGoTrafficLightListener { +) : LinearLayout(context, attrs, defStyleAttr), IViewControlListener, IMoGoTrafficLightListener, + IMoGoSkinModeChangeListener { companion object { private const val TAG = "SingleTrafficLightView" @@ -50,6 +55,7 @@ class SingleTrafficLightView @JvmOverloads constructor( mLightSourceTV = findViewById(R.id.hmi_traffic_light_source) mLightSourceDivider = findViewById(R.id.hmi_traffic_light_divider) + CallerSkinModeListenerManager.addListener(TAG, this) CallerTrafficLightListenerManager.addListener(TAG, this) CallerHmiViewControlListenerManager.addListener(TrafficLightView_TAG, this) } @@ -61,10 +67,28 @@ class SingleTrafficLightView @JvmOverloads constructor( override fun onDetachedFromWindow() { super.onDetachedFromWindow() + CallerSkinModeListenerManager.removeListener(TAG) CallerTrafficLightListenerManager.removeListener(TAG) CallerHmiViewControlListenerManager.removeListener(TrafficLightView_TAG) } + override fun onSkinModeChange(skinMode: Int) { + ThreadUtils.runOnUiThread { + when (skinMode) { + 0 -> { + hmi_traffic_light_bg.setBackgroundResource(R.drawable.traffic_light_bg) + hmi_traffic_light_source.setTextColor(resources.getColor(R.color.color_FFFFFF)) + hmi_traffic_light_divider.setBackgroundColor(resources.getColor(R.color.color_FFFFFF)) + } + 1 -> { + hmi_traffic_light_bg.setBackgroundResource(R.drawable.traffic_light_bg_day_light) + hmi_traffic_light_source.setTextColor(resources.getColor(R.color.color_2D3E5F)) + hmi_traffic_light_divider.setBackgroundColor(resources.getColor(R.color.color_2D3E5F)) + } + } + } + } + /** * 展示红绿灯预警 * diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java index 26370c9ed6..22ffa6de73 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java @@ -48,12 +48,6 @@ public abstract class MainMoGoApplication extends AbsMogoApplication { CallerDevaToolsManager.INSTANCE.updateUpgradeProgress(); } - @Override - protected boolean shouldInit() { - CallerLogger.INSTANCE.w(M_HMI + TAG, "evaluate shouldInit() with: " + ProcessUtils.getProcessName(Process.myPid())); - return true; - } - /** * 初始化异常采集配置 */ diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/traffic_light_bg_day_light.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/traffic_light_bg_day_light.xml new file mode 100644 index 0000000000..574797906a --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/traffic_light_bg_day_light.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/hmi_view_traffic_light.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/hmi_view_traffic_light.xml index f49e4c473d..cd31442233 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/hmi_view_traffic_light.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/hmi_view_traffic_light.xml @@ -12,7 +12,6 @@ android:layout_height="@dimen/hmi_traffic_light_bg_height" android:layout_marginStart="@dimen/hmi_traffic_light_bg_margin_left" android:layout_marginTop="@dimen/hmi_traffic_light_bg_margin_top" - android:background="@drawable/traffic_light_bg" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintTop_toTopOf="parent" /> @@ -41,7 +40,6 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" tools:text="自车感知" - android:textColor="@color/color_FFFFFF" android:textSize="@dimen/hmi_traffic_light_source_size" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" @@ -53,7 +51,6 @@ android:id="@+id/hmi_traffic_light_divider" android:layout_width="@dimen/dp_1" android:layout_height="@dimen/dp_47" - android:background="@color/color_FFFFFF" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintRight_toLeftOf="@id/hmi_traffic_light_source" diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/values/color.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/values/color.xml index ff8c61e6bf..72ea2d92b5 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/values/color.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/values/color.xml @@ -21,6 +21,7 @@ #0099dd #FFFFFF #2C2E30 + #2D3E5F #D4D8DC #27FFFFFF #1E111111 diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/values/dimens.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/values/dimens.xml index c8e191641e..036c0ac988 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/values/dimens.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/values/dimens.xml @@ -64,7 +64,7 @@ 15dp 17dp 154dp - 71dp + 110dp 60dp 32dp diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/datacenter/union/IMoGoTrafficLightListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/datacenter/union/IMoGoTrafficLightListener.kt index a103cce6a6..13491090cd 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/datacenter/union/IMoGoTrafficLightListener.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/datacenter/union/IMoGoTrafficLightListener.kt @@ -18,6 +18,11 @@ interface IMoGoTrafficLightListener { } + /** + * 是否重置 + */ + fun resetTrafficLight(isReset: Boolean) {} + /** * 云端红绿灯接口请求失败 */ diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/v2x/CallerTrafficLightListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/v2x/CallerTrafficLightListenerManager.kt index 2d7e13ef71..b795e482a8 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/v2x/CallerTrafficLightListenerManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/v2x/CallerTrafficLightListenerManager.kt @@ -17,7 +17,7 @@ object CallerTrafficLightListenerManager : CallerBase } fun invokeTrafficLightStatus(trafficLightResult: TrafficLightResult) { - CallerTrafficLightListenerManager.trafficLightResult = trafficLightResult + this.trafficLightResult = trafficLightResult M_LISTENERS.forEach { val listener = it.value listener.onTrafficLightStatus(trafficLightResult) @@ -57,10 +57,11 @@ object CallerTrafficLightListenerManager : CallerBase */ fun resetTrafficLightStatus(hideTrafficLight:Boolean = true) { trafficLightResult = null - // 隐藏traffic light - if(hideTrafficLight){ - disableTrafficLight() + M_LISTENERS.forEach { + val listener = it.value + listener.resetTrafficLight(hideTrafficLight) } + } fun showTrafficLight(checkLightId: TrafficLightEnum, lightSource: DataSourceType) { diff --git a/foudations/mogo-commons/src/main/java/com/mogo/commons/mvp/MvpActivity.java b/foudations/mogo-commons/src/main/java/com/mogo/commons/mvp/MvpActivity.java index 1adc5be2fb..ef25e2967e 100644 --- a/foudations/mogo-commons/src/main/java/com/mogo/commons/mvp/MvpActivity.java +++ b/foudations/mogo-commons/src/main/java/com/mogo/commons/mvp/MvpActivity.java @@ -12,6 +12,7 @@ import androidx.annotation.Nullable; import androidx.appcompat.app.AppCompatActivity; import com.mogo.eagle.core.utilcode.util.BarUtils; +import com.mogo.eagle.core.utilcode.util.ProcessUtils; import com.mogo.eagle.core.utilcode.util.SoftKeyBoardJobber; import me.jessyan.autosize.AutoSizeCompat; @@ -34,6 +35,9 @@ public abstract class MvpActivity> exten getWindow().setFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON, WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); super.onCreate(savedInstanceState); + if (!ProcessUtils.isMainProcess(this)) { + return; + } setContentView(getLayoutId()); initViews(); mPresenter = createPresenter(); @@ -112,7 +116,7 @@ public abstract class MvpActivity> exten @Override public Resources getResources() { - if ( Looper.myLooper() == Looper.getMainLooper()) { + if (Looper.myLooper() == Looper.getMainLooper()) { AutoSizeCompat.autoConvertDensityOfGlobal(super.getResources()); } return super.getResources(); diff --git a/gradle.properties b/gradle.properties index 4665e5d4c0..4ae3edb87c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -66,23 +66,23 @@ SERVICE_BIZ_VERSION=1.2.4 LOGLIB_VERSION=1.5.27 ######## MogoAiCloudSDK Version ######## # 网络请求LOGLIB_VERSION -MOGO_NETWORK_VERSION=1.4.6.7 +MOGO_NETWORK_VERSION=1.4.6.8 # 鉴权 -MOGO_PASSPORT_VERSION=1.4.6.7 +MOGO_PASSPORT_VERSION=1.4.6.8 # 常链接 -MOGO_SOCKET_VERSION=1.4.6.7 +MOGO_SOCKET_VERSION=1.4.6.8 # 数据采集 -MOGO_REALTIME_VERSION=1.4.6.7 +MOGO_REALTIME_VERSION=1.4.6.8 # 探路,道路事件发布,获取 -MOGO_TANLU_VERSION=1.4.6.7 +MOGO_TANLU_VERSION=1.4.6.8 # 直播推流 -MOGO_LIVE_VERSION=1.4.6.7 +MOGO_LIVE_VERSION=1.4.6.8 # 直播拉流 -MOGO_TRAFFICLIVE_VERSION=1.4.6.7 +MOGO_TRAFFICLIVE_VERSION=1.4.6.8 # 定位服务 -MOGO_LOCATION_VERSION=1.4.6.7 +MOGO_LOCATION_VERSION=1.4.6.8 # 远程通讯模块 -MOGO_TELEMATIC_VERSION=1.4.6.7 +MOGO_TELEMATIC_VERSION=1.4.6.8 ######## MogoAiCloudSDK Version ######## # 自研地图 MAP_SDK_VERSION=2.12.1.1