[3.2.0] add func of trafficlight support daylightmode and fix passport sn and token get problem

This commit is contained in:
zhongchao
2023-05-16 18:47:29 +08:00
parent 982139a078
commit c6737617f7
7 changed files with 44 additions and 15 deletions

View File

@@ -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))
}
}
}
}
/**
* 展示红绿灯预警
*

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#CCFFFFFF"/>
<corners android:radius="@dimen/hmi_traffic_light_layout_corner"/>
</shape>

View File

@@ -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"

View File

@@ -21,6 +21,7 @@
<color name="color_0099dd">#0099dd</color>
<color name="color_FFFFFF">#FFFFFF</color>
<color name="color_2C2E30">#2C2E30</color>
<color name="color_2D3E5F">#2D3E5F</color>
<color name="color_D4D8DC">#D4D8DC</color>
<color name="color_27FFFFFF">#27FFFFFF</color>
<color name="color_1E111111">#1E111111</color>