From a927e491d36626bbed8c8810dff35374409072fb Mon Sep 17 00:00:00 2001 From: liujing Date: Wed, 13 Apr 2022 15:28:46 +0800 Subject: [PATCH] =?UTF-8?q?[add]=20=E8=92=99=E5=B1=82=E6=96=9C=E8=A7=92?= =?UTF-8?q?=E6=B8=90=E5=8F=98+=E5=8A=A8=E7=94=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../function/hmi/ui/widget/V2XWarningView.kt | 91 +++++++++++++------ .../res/layout/module_hmi_warning_v2x.xml | 50 +++++++++- .../module_hmi_warning_bkg_bottom.xml | 4 +- .../drawable/module_hmi_warning_bkg_left.xml | 2 +- .../module_hmi_warning_bkg_left_bottom.xml | 8 ++ .../module_hmi_warning_bkg_left_top.xml | 8 ++ .../drawable/module_hmi_warning_bkg_right.xml | 2 +- .../module_hmi_warning_bkg_right_bottom.xml | 8 ++ .../module_hmi_warning_bkg_right_top.xml | 8 ++ .../drawable/module_hmi_warning_bkg_top.xml | 2 +- .../src/main/res/values/color.xml | 2 + 11 files changed, 149 insertions(+), 36 deletions(-) create mode 100644 core/mogo-core-res/src/main/function-hmi-res/drawable/module_hmi_warning_bkg_left_bottom.xml create mode 100644 core/mogo-core-res/src/main/function-hmi-res/drawable/module_hmi_warning_bkg_left_top.xml create mode 100644 core/mogo-core-res/src/main/function-hmi-res/drawable/module_hmi_warning_bkg_right_bottom.xml create mode 100644 core/mogo-core-res/src/main/function-hmi-res/drawable/module_hmi_warning_bkg_right_top.xml diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/V2XWarningView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/V2XWarningView.kt index 8ceca5e6fe..52e42c7373 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/V2XWarningView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/V2XWarningView.kt @@ -2,6 +2,7 @@ package com.mogo.eagle.core.function.hmi.ui.widget import android.content.Context import android.util.AttributeSet +import android.util.Log import android.view.LayoutInflater import android.view.View import android.widget.RelativeLayout @@ -18,9 +19,9 @@ import kotlinx.android.synthetic.main.module_hmi_warning_v2x.view.* *@date 2021/9/10 7:44 下午 */ class V2XWarningView @JvmOverloads constructor( - context: Context, - attrs: AttributeSet? = null, - defStyleAttr: Int = 0 + context: Context, + attrs: AttributeSet? = null, + defStyleAttr: Int = 0 ) : RelativeLayout(context, attrs, defStyleAttr) { companion object { @@ -60,67 +61,107 @@ class V2XWarningView @JvmOverloads constructor( removeCallbacks(closeWarningTask) postDelayed(closeWarningTask, closeTime) } - when (direction) { + when (ALERT_WARNING_TOP_RIGHT) { ALERT_WARNING_NON -> { removeCallbacks(closeWarningTask) hmiWarningTopImg.visibility = View.GONE hmiWarningRightImg.visibility = View.GONE hmiWarningBottomImg.visibility = View.GONE hmiWarningLeftImg.visibility = View.GONE + hmiWarningLeftTopImg.visibility = View.GONE + hmiWarningLeftBottomImg.visibility = View.GONE + hmiWarningRightTopImg.visibility = View.GONE + hmiWarningRightBottomImg.visibility = View.GONE } ALERT_WARNING_TOP -> { hmiWarningTopImg.visibility = View.VISIBLE hmiWarningRightImg.visibility = View.GONE hmiWarningBottomImg.visibility = View.GONE hmiWarningLeftImg.visibility = View.GONE + hmiWarningLeftTopImg.visibility = View.GONE + hmiWarningLeftBottomImg.visibility = View.GONE + hmiWarningRightTopImg.visibility = View.GONE + hmiWarningRightBottomImg.visibility = View.GONE } ALERT_WARNING_RIGHT -> { hmiWarningTopImg.visibility = View.GONE hmiWarningRightImg.visibility = View.VISIBLE hmiWarningBottomImg.visibility = View.GONE hmiWarningLeftImg.visibility = View.GONE + hmiWarningLeftTopImg.visibility = View.GONE + hmiWarningLeftBottomImg.visibility = View.GONE + hmiWarningRightTopImg.visibility = View.GONE + hmiWarningRightBottomImg.visibility = View.GONE } ALERT_WARNING_BOTTOM -> { hmiWarningTopImg.visibility = View.GONE hmiWarningRightImg.visibility = View.GONE hmiWarningBottomImg.visibility = View.VISIBLE hmiWarningLeftImg.visibility = View.GONE + hmiWarningLeftTopImg.visibility = View.GONE + hmiWarningLeftBottomImg.visibility = View.GONE + hmiWarningRightTopImg.visibility = View.GONE + hmiWarningRightBottomImg.visibility = View.GONE } ALERT_WARNING_LEFT -> { hmiWarningTopImg.visibility = View.GONE hmiWarningRightImg.visibility = View.GONE hmiWarningBottomImg.visibility = View.GONE hmiWarningLeftImg.visibility = View.VISIBLE + hmiWarningLeftTopImg.visibility = View.GONE + hmiWarningLeftBottomImg.visibility = View.GONE + hmiWarningRightTopImg.visibility = View.GONE + hmiWarningRightBottomImg.visibility = View.GONE } ALERT_WARNING_TOP_RIGHT -> { - hmiWarningTopImg.visibility = View.VISIBLE - hmiWarningRightImg.visibility = View.VISIBLE + hmiWarningTopImg.visibility = View.GONE + hmiWarningRightImg.visibility = View.GONE hmiWarningBottomImg.visibility = View.GONE hmiWarningLeftImg.visibility = View.GONE + hmiWarningLeftTopImg.visibility = View.GONE + hmiWarningLeftBottomImg.visibility = View.GONE + hmiWarningRightTopImg.visibility = View.VISIBLE + hmiWarningRightBottomImg.visibility = View.GONE } ALERT_WARNING_BOTTOM_RIGHT -> { hmiWarningTopImg.visibility = View.GONE - hmiWarningRightImg.visibility = View.VISIBLE - hmiWarningBottomImg.visibility = View.VISIBLE + hmiWarningRightImg.visibility = View.GONE + hmiWarningBottomImg.visibility = View.GONE hmiWarningLeftImg.visibility = View.GONE + hmiWarningLeftTopImg.visibility = View.GONE + hmiWarningLeftBottomImg.visibility = View.GONE + hmiWarningRightTopImg.visibility = View.VISIBLE + hmiWarningRightBottomImg.visibility = View.VISIBLE } ALERT_WARNING_BOTTOM_LEFT -> { hmiWarningTopImg.visibility = View.GONE hmiWarningRightImg.visibility = View.GONE - hmiWarningBottomImg.visibility = View.VISIBLE - hmiWarningLeftImg.visibility = View.VISIBLE + hmiWarningBottomImg.visibility = View.GONE + hmiWarningLeftImg.visibility = View.GONE + hmiWarningLeftTopImg.visibility = View.GONE + hmiWarningLeftBottomImg.visibility = View.VISIBLE + hmiWarningRightTopImg.visibility = View.GONE + hmiWarningRightBottomImg.visibility = View.GONE } ALERT_WARNING_TOP_LEFT -> { hmiWarningTopImg.visibility = View.VISIBLE hmiWarningRightImg.visibility = View.GONE hmiWarningBottomImg.visibility = View.GONE - hmiWarningLeftImg.visibility = View.VISIBLE + hmiWarningLeftImg.visibility = View.GONE + hmiWarningLeftTopImg.visibility = View.VISIBLE + hmiWarningLeftBottomImg.visibility = View.GONE + hmiWarningRightTopImg.visibility = View.GONE + hmiWarningRightBottomImg.visibility = View.GONE } ALERT_WARNING_ALL -> { - hmiWarningTopImg.visibility = View.VISIBLE - hmiWarningRightImg.visibility = View.VISIBLE - hmiWarningBottomImg.visibility = View.VISIBLE - hmiWarningLeftImg.visibility = View.VISIBLE + hmiWarningTopImg.visibility = View.GONE + hmiWarningRightImg.visibility = View.GONE + hmiWarningBottomImg.visibility = View.GONE + hmiWarningLeftImg.visibility = View.GONE + hmiWarningLeftTopImg.visibility = View.VISIBLE + hmiWarningLeftBottomImg.visibility = View.VISIBLE + hmiWarningRightTopImg.visibility = View.VISIBLE + hmiWarningRightBottomImg.visibility = View.VISIBLE } } } @@ -145,26 +186,22 @@ class V2XWarningView @JvmOverloads constructor( hmiWarningLeftImg.visibility = View.GONE } ALERT_WARNING_TOP_RIGHT -> { - hmiWarningTopImg.visibility = View.GONE - hmiWarningRightImg.visibility = View.GONE + hmiWarningRightTopImg.visibility = View.GONE } ALERT_WARNING_BOTTOM_RIGHT -> { - hmiWarningRightImg.visibility = View.GONE - hmiWarningBottomImg.visibility = View.GONE + hmiWarningRightBottomImg.visibility = View.GONE } ALERT_WARNING_BOTTOM_LEFT -> { - hmiWarningBottomImg.visibility = View.GONE - hmiWarningLeftImg.visibility = View.GONE + hmiWarningLeftBottomImg.visibility = View.GONE } ALERT_WARNING_TOP_LEFT -> { - hmiWarningTopImg.visibility = View.GONE - hmiWarningLeftImg.visibility = View.GONE + hmiWarningLeftTopImg.visibility = View.GONE } ALERT_WARNING_ALL -> { - hmiWarningTopImg.visibility = View.GONE - hmiWarningRightImg.visibility = View.GONE - hmiWarningBottomImg.visibility = View.GONE - hmiWarningLeftImg.visibility = View.GONE + hmiWarningLeftTopImg.visibility = View.GONE + hmiWarningLeftBottomImg.visibility = View.GONE + hmiWarningRightTopImg.visibility = View.GONE + hmiWarningRightBottomImg.visibility = View.GONE } else -> { CallerLogger.d("$M_HMI$TAG", "Not Support Direction") diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/module_hmi_warning_v2x.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/module_hmi_warning_v2x.xml index 0c1a3e25ea..ee46c71e06 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/module_hmi_warning_v2x.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/module_hmi_warning_v2x.xml @@ -4,22 +4,43 @@ android:layout_width="match_parent" android:layout_height="match_parent"> + + tools:visibility="invisible" /> + + tools:visibility="invisible" /> + + + + + + + + tools:visibility="invisible" /> + + + + + + + + tools:visibility="invisible" /> \ No newline at end of file diff --git a/core/mogo-core-res/src/main/function-hmi-res/drawable/module_hmi_warning_bkg_bottom.xml b/core/mogo-core-res/src/main/function-hmi-res/drawable/module_hmi_warning_bkg_bottom.xml index 74097c2465..bf08199996 100644 --- a/core/mogo-core-res/src/main/function-hmi-res/drawable/module_hmi_warning_bkg_bottom.xml +++ b/core/mogo-core-res/src/main/function-hmi-res/drawable/module_hmi_warning_bkg_bottom.xml @@ -3,6 +3,6 @@ + android:startColor="@color/module_hmi_warning_bg_color" + android:type="linear" /> \ No newline at end of file diff --git a/core/mogo-core-res/src/main/function-hmi-res/drawable/module_hmi_warning_bkg_left.xml b/core/mogo-core-res/src/main/function-hmi-res/drawable/module_hmi_warning_bkg_left.xml index a9b438c963..aa8f02910c 100644 --- a/core/mogo-core-res/src/main/function-hmi-res/drawable/module_hmi_warning_bkg_left.xml +++ b/core/mogo-core-res/src/main/function-hmi-res/drawable/module_hmi_warning_bkg_left.xml @@ -3,6 +3,6 @@ \ No newline at end of file diff --git a/core/mogo-core-res/src/main/function-hmi-res/drawable/module_hmi_warning_bkg_left_bottom.xml b/core/mogo-core-res/src/main/function-hmi-res/drawable/module_hmi_warning_bkg_left_bottom.xml new file mode 100644 index 0000000000..1edc95bf47 --- /dev/null +++ b/core/mogo-core-res/src/main/function-hmi-res/drawable/module_hmi_warning_bkg_left_bottom.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/core/mogo-core-res/src/main/function-hmi-res/drawable/module_hmi_warning_bkg_left_top.xml b/core/mogo-core-res/src/main/function-hmi-res/drawable/module_hmi_warning_bkg_left_top.xml new file mode 100644 index 0000000000..1cf7b8045d --- /dev/null +++ b/core/mogo-core-res/src/main/function-hmi-res/drawable/module_hmi_warning_bkg_left_top.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/core/mogo-core-res/src/main/function-hmi-res/drawable/module_hmi_warning_bkg_right.xml b/core/mogo-core-res/src/main/function-hmi-res/drawable/module_hmi_warning_bkg_right.xml index 1a6e8c89b3..96d008ba4f 100644 --- a/core/mogo-core-res/src/main/function-hmi-res/drawable/module_hmi_warning_bkg_right.xml +++ b/core/mogo-core-res/src/main/function-hmi-res/drawable/module_hmi_warning_bkg_right.xml @@ -3,6 +3,6 @@ \ No newline at end of file diff --git a/core/mogo-core-res/src/main/function-hmi-res/drawable/module_hmi_warning_bkg_right_bottom.xml b/core/mogo-core-res/src/main/function-hmi-res/drawable/module_hmi_warning_bkg_right_bottom.xml new file mode 100644 index 0000000000..4524166cb2 --- /dev/null +++ b/core/mogo-core-res/src/main/function-hmi-res/drawable/module_hmi_warning_bkg_right_bottom.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/core/mogo-core-res/src/main/function-hmi-res/drawable/module_hmi_warning_bkg_right_top.xml b/core/mogo-core-res/src/main/function-hmi-res/drawable/module_hmi_warning_bkg_right_top.xml new file mode 100644 index 0000000000..cd4f977de2 --- /dev/null +++ b/core/mogo-core-res/src/main/function-hmi-res/drawable/module_hmi_warning_bkg_right_top.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/core/mogo-core-res/src/main/function-hmi-res/drawable/module_hmi_warning_bkg_top.xml b/core/mogo-core-res/src/main/function-hmi-res/drawable/module_hmi_warning_bkg_top.xml index 1188f9c6d0..4225002fff 100644 --- a/core/mogo-core-res/src/main/function-hmi-res/drawable/module_hmi_warning_bkg_top.xml +++ b/core/mogo-core-res/src/main/function-hmi-res/drawable/module_hmi_warning_bkg_top.xml @@ -3,6 +3,6 @@ \ No newline at end of file diff --git a/core/mogo-core-res/src/main/res/values/color.xml b/core/mogo-core-res/src/main/res/values/color.xml index b2c628bf52..2c85694472 100644 --- a/core/mogo-core-res/src/main/res/values/color.xml +++ b/core/mogo-core-res/src/main/res/values/color.xml @@ -6,5 +6,7 @@ #323C6F #FFFFFF + #8C7F2503 + \ No newline at end of file