From 082a766475445cc3d218de9cd2ec3ace5f86e98b Mon Sep 17 00:00:00 2001 From: xuxinchao Date: Fri, 17 Feb 2023 16:44:41 +0800 Subject: [PATCH] =?UTF-8?q?[m1]=E6=B6=88=E6=81=AF=E7=9B=92=E5=AD=90UI?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/m1/res/layout/bus_p_fragment.xml | 2 + .../function/hmi/ui/msgbox/SharpView.java | 59 +++++++++++++++++++ .../ui/msgbox/adapter/MMsgBoxBubbleAdapter.kt | 6 +- .../ui/msgbox/adapter/MMsgBoxListAdapter.kt | 6 +- .../main/res/drawable/rv_divider_line_m.xml | 2 +- .../main/res/layout/item_m_msg_box_notice.xml | 31 +++++----- .../res/layout/item_m_msg_box_summary.xml | 6 +- .../main/res/layout/item_m_msg_box_v2x.xml | 19 +++--- .../res/layout/item_m_msg_list_notice.xml | 31 +++++----- .../res/layout/item_m_msg_list_summary.xml | 4 +- .../main/res/layout/item_m_msg_list_v2x.xml | 21 +++---- .../res/layout/layout_m_msg_box_bubble.xml | 2 +- .../main/res/layout/layout_m_msg_box_list.xml | 49 ++++++++++----- .../res/layout/view_m1_msg_box_button.xml | 9 ++- 14 files changed, 167 insertions(+), 80 deletions(-) create mode 100644 core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/SharpView.java diff --git a/OCH/mogo-och-bus-passenger/src/m1/res/layout/bus_p_fragment.xml b/OCH/mogo-och-bus-passenger/src/m1/res/layout/bus_p_fragment.xml index 46d90af947..77eabef580 100644 --- a/OCH/mogo-och-bus-passenger/src/m1/res/layout/bus_p_fragment.xml +++ b/OCH/mogo-och-bus-passenger/src/m1/res/layout/bus_p_fragment.xml @@ -210,6 +210,7 @@ android:id="@+id/viewBusPM1MsgBoxList" android:layout_width="450dp" android:layout_height="520dp" + android:layout_marginTop="-30dp" android:visibility="gone" android:layout_marginEnd="@dimen/dp_34" app:layout_constraintEnd_toEndOf="@+id/viewBusPM1MsgBoxButton" @@ -220,6 +221,7 @@ android:id="@+id/viewBusPM1MsgBoxBubble" android:layout_width="450dp" android:layout_height="wrap_content" + android:layout_marginTop="-30dp" android:layout_marginEnd="@dimen/dp_34" android:visibility="visible" app:layout_constraintEnd_toEndOf="@+id/viewBusPM1MsgBoxButton" diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/SharpView.java b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/SharpView.java new file mode 100644 index 0000000000..af4567c9dd --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/SharpView.java @@ -0,0 +1,59 @@ +package com.mogo.eagle.core.function.hmi.ui.msgbox; + +import android.content.Context; +import android.graphics.Canvas; +import android.graphics.Color; +import android.graphics.Paint; +import android.graphics.Path; +import android.util.AttributeSet; +import android.view.View; + +import androidx.annotation.Nullable; + +public class SharpView extends View { + + private int mWidth =0; //三角形的宽度 + private int mHeight =0; //三角形的高度 + private Context mContext; + + public SharpView(Context context) { + super(context); + this.mContext=context; + initView(); + } + + public SharpView(Context context, @Nullable AttributeSet attrs) { + super(context, attrs); + this.mContext=context; + initView(); + } + + private void initView() { + mWidth = 25; + mHeight = 25; + } + @Override + protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { + super.onMeasure(widthMeasureSpec, heightMeasureSpec); + setMeasuredDimension(mWidth,mHeight); + } + + @Override + protected void onDraw(Canvas canvas) { + super.onDraw(canvas); + //创建画笔 + Paint paint = new Paint(); + paint.setColor(Color.parseColor("#FFFFFFFF")); + paint.setAntiAlias(true); //抗锯齿 + paint.setStyle(Paint.Style.FILL);//实线 + //创建路径 + Path path = new Path(); + path.moveTo(0,mHeight); + path.lineTo(mWidth,mHeight); + path.lineTo(mWidth/2,0); + path.close();//闭合路径 + //画在画布上 + canvas.drawPath(path,paint); + } + +} diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/MMsgBoxBubbleAdapter.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/MMsgBoxBubbleAdapter.kt index add1c7f5de..057bdf0cb6 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/MMsgBoxBubbleAdapter.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/MMsgBoxBubbleAdapter.kt @@ -65,7 +65,8 @@ class MMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter val noticeNormalData = noticeFrCloudMsg.noticeNormalData holder.tvMNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) holder.tvMNoticeContent.text = noticeNormalData?.content - GlideApp.with(activity).load(noticeNormalData?.imageUrl).optionalTransform( + GlideApp.with(activity).load(noticeNormalData?.imageUrl).placeholder(R.drawable.icon_passenger_operation) + .optionalTransform( GlideRoundedCornersTransform( 20f, GlideRoundedCornersTransform.CornerType.ALL @@ -79,7 +80,8 @@ class MMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter val noticeTrafficStylePushData = noticeFrCloudMsg.trafficPushData holder.tvMNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) holder.tvMNoticeContent.text = noticeTrafficStylePushData?.content - GlideApp.with(activity).load(noticeTrafficStylePushData?.poiImgUrl).optionalTransform( + GlideApp.with(activity).load(noticeTrafficStylePushData?.poiImgUrl).placeholder(R.drawable.icon_passenger_operation) + .optionalTransform( GlideRoundedCornersTransform( 20f, GlideRoundedCornersTransform.CornerType.ALL diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/MMsgBoxListAdapter.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/MMsgBoxListAdapter.kt index dc29be12d2..9e44371868 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/MMsgBoxListAdapter.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/MMsgBoxListAdapter.kt @@ -60,7 +60,8 @@ class MMsgBoxListAdapter(private val activity: Activity): RecyclerView.Adapter - + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_m_msg_box_notice.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_m_msg_box_notice.xml index ff62ba2a18..77fc05c317 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_m_msg_box_notice.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_m_msg_box_notice.xml @@ -1,18 +1,18 @@ \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_m_msg_box_summary.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_m_msg_box_summary.xml index d8b8480c30..c77dabafe0 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_m_msg_box_summary.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_m_msg_box_summary.xml @@ -4,9 +4,9 @@ android:layout_height="110dp" xmlns:app="http://schemas.android.com/apk/res-auto" android:background="#FFFFFFFF" - app:roundLayoutRadius="24dp" - android:layout_marginTop="16dp" - android:layout_marginBottom="16dp" + app:roundLayoutRadius="@dimen/dp_18" + android:layout_marginTop="@dimen/dp_10" + android:layout_marginBottom="@dimen/dp_10" > + app:roundLayoutRadius="@dimen/dp_18" + android:layout_marginTop="@dimen/dp_10" + android:layout_marginBottom="@dimen/dp_10"> \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_m_msg_list_notice.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_m_msg_list_notice.xml index b63bcf7478..b57c76a7c4 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_m_msg_list_notice.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_m_msg_list_notice.xml @@ -1,18 +1,18 @@ \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_m_msg_list_summary.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_m_msg_list_summary.xml index 6c41f48932..319543cb67 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_m_msg_list_summary.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_m_msg_list_summary.xml @@ -1,7 +1,7 @@ \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_m_msg_box_bubble.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_m_msg_box_bubble.xml index 43bd8f8e43..eed0956681 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_m_msg_box_bubble.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_m_msg_box_bubble.xml @@ -1,7 +1,7 @@ diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_m_msg_box_list.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_m_msg_box_list.xml index ffe09f8cfe..70ec2ac202 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_m_msg_box_list.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_m_msg_box_list.xml @@ -1,21 +1,38 @@ - + android:orientation="vertical" + > - - \ No newline at end of file + + + + + + + + + diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_m1_msg_box_button.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_m1_msg_box_button.xml index 7e98b72cdb..0eb0cb4f85 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_m1_msg_box_button.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_m1_msg_box_button.xml @@ -18,14 +18,13 @@ \ No newline at end of file