[m1]消息盒子UI调整

This commit is contained in:
xuxinchao
2023-02-17 16:44:41 +08:00
parent 5f1ac507a6
commit 082a766475
14 changed files with 167 additions and 80 deletions

View File

@@ -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);
}
}

View File

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

View File

@@ -60,7 +60,8 @@ class MMsgBoxListAdapter(private val activity: Activity): RecyclerView.Adapter<R
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_notice_default)
.optionalTransform(
GlideRoundedCornersTransform(
20f,
GlideRoundedCornersTransform.CornerType.ALL
@@ -74,7 +75,8 @@ class MMsgBoxListAdapter(private val activity: Activity): RecyclerView.Adapter<R
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_notice_default)
.optionalTransform(
GlideRoundedCornersTransform(
20f,
GlideRoundedCornersTransform.CornerType.ALL

View File

@@ -2,7 +2,7 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#C0C7DA"/>
<solid android:color="#FFC0C7DA"/>
<size android:height="1dp" />
</shape>

View File

@@ -1,18 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<com.mogo.eagle.core.widget.RoundConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="450dp"
android:layout_height="110dp"
android:layout_width="@dimen/dp_450"
android:layout_height="@dimen/dp_110"
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"
>
<ImageView
android:id="@+id/ivMNoticeImage"
android:layout_width="110dp"
android:layout_height="110dp"
android:layout_width="@dimen/dp_110"
android:layout_height="@dimen/dp_110"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
@@ -25,8 +25,9 @@
android:layout_height="wrap_content"
android:text="官方公告"
android:textColor="#FF203555"
android:textSize="25dp"
android:layout_marginStart="10dp"
android:textSize="@dimen/dp_25"
android:textStyle="bold"
android:layout_marginStart="@dimen/dp_10"
app:layout_constraintLeft_toRightOf="@id/ivMNoticeImage"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@id/tvMNoticeContent"
@@ -49,11 +50,11 @@
<TextView
android:id="@+id/tvMNoticeCheck"
android:layout_width="110dp"
android:layout_height="110dp"
android:layout_width="@dimen/dp_100"
android:layout_height="@dimen/dp_110"
android:text="查 看"
android:textColor="#FF1366FB"
android:textSize="20dp"
android:textSize="@dimen/dp_20"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent"
@@ -63,7 +64,7 @@
<View
android:layout_width="1dp"
android:layout_height="64dp"
android:background="#C0C7DA"
android:background="#FFC0C7DA"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toLeftOf="@id/tvMNoticeCheck"
@@ -74,11 +75,11 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#B34A5B77"
android:textSize="18dp"
android:textSize="@dimen/dp_18"
app:layout_constraintTop_toTopOf="@id/tvMNoticeTitle"
app:layout_constraintBottom_toBottomOf="@id/tvMNoticeTitle"
app:layout_constraintRight_toLeftOf="@id/tvMNoticeCheck"
android:layout_marginEnd="10dp"
android:layout_marginEnd="@dimen/dp_15"
/>
</com.mogo.eagle.core.widget.RoundConstraintLayout>

View File

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

View File

@@ -5,18 +5,18 @@
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">
<ImageView
android:id="@+id/ivMV2XImage"
android:layout_width="83dp"
android:layout_height="83dp"
android:layout_width="@dimen/dp_83"
android:layout_height="@dimen/dp_83"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:layout_marginStart="10dp"
android:layout_marginStart="@dimen/dp_13"
/>
<TextView
@@ -28,7 +28,7 @@
app:layout_constraintRight_toRightOf="parent"
android:textColor="#99203555"
android:textSize="18dp"
android:layout_marginEnd="20dp"
android:layout_marginEnd="@dimen/dp_20"
/>
<TextView
@@ -44,8 +44,9 @@
android:ellipsize="end"
android:textColor="#FF203555"
android:textSize="25dp"
android:layout_marginStart="20dp"
android:layout_marginEnd="20dp"
android:textStyle="bold"
android:layout_marginStart="@dimen/dp_13"
android:layout_marginEnd="@dimen/dp_13"
/>
</com.mogo.eagle.core.widget.RoundCanClickConstraintLayout>

View File

@@ -1,18 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="100dp"
android:layout_height="@dimen/dp_100"
xmlns:app="http://schemas.android.com/apk/res-auto">
<ImageView
android:id="@+id/ivMNoticeImage"
android:layout_width="68dp"
android:layout_height="68dp"
android:layout_width="@dimen/dp_68"
android:layout_height="@dimen/dp_68"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:src="@drawable/icon_passenger_operation"
android:layout_marginStart="10dp"
android:layout_marginStart="@dimen/dp_16"
/>
<TextView
@@ -21,11 +21,12 @@
android:layout_height="wrap_content"
android:text="官方公告"
android:textColor="#FF203555"
android:textSize="25dp"
android:layout_marginStart="10dp"
android:textSize="@dimen/dp_25"
android:layout_marginStart="@dimen/dp_16"
app:layout_constraintLeft_toRightOf="@id/ivMNoticeImage"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@id/tvMNoticeContent"
android:textStyle="bold"
/>
<TextView
@@ -45,11 +46,13 @@
<TextView
android:id="@+id/tvMNoticeCheck"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_width="wrap_content"
android:layout_height="@dimen/dp_100"
android:text="查 看"
android:textColor="#FF1366FB"
android:textSize="20dp"
android:paddingEnd="@dimen/dp_10"
android:paddingStart="@dimen/dp_20"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent"
@@ -57,9 +60,9 @@
/>
<View
android:layout_width="1dp"
android:layout_height="50dp"
android:background="#C0C7DA"
android:layout_width="@dimen/dp_1"
android:layout_height="@dimen/dp_55"
android:background="#FFC0C7DA"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toLeftOf="@id/tvMNoticeCheck"
@@ -69,12 +72,12 @@
android:id="@+id/tvMNoticeTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#CC203555"
android:textSize="18dp"
android:textColor="#FF4A5B76"
android:textSize="@dimen/dp_18"
app:layout_constraintTop_toTopOf="@id/tvMNoticeTitle"
app:layout_constraintBottom_toBottomOf="@id/tvMNoticeTitle"
app:layout_constraintRight_toLeftOf="@id/tvMNoticeCheck"
android:layout_marginEnd="10dp"
android:layout_marginEnd="@dimen/dp_15"
/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="100dp"
android:layout_height="@dimen/dp_100"
xmlns:app="http://schemas.android.com/apk/res-auto">
<ImageView
@@ -12,7 +12,7 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:src="@drawable/icon_passenger_operation"
android:layout_marginStart="10dp"
android:layout_marginStart="@dimen/dp_16"
/>
<TextView

View File

@@ -1,17 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="100dp"
android:layout_height="@dimen/dp_100"
xmlns:app="http://schemas.android.com/apk/res-auto">
<ImageView
android:id="@+id/ivMV2XImage"
android:layout_width="68dp"
android:layout_height="68dp"
android:layout_width="@dimen/dp_68"
android:layout_height="@dimen/dp_68"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:layout_marginStart="10dp"
android:layout_marginStart="@dimen/dp_16"
/>
<TextView
@@ -21,9 +21,9 @@
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent"
android:textColor="#CC203555"
android:textSize="18dp"
android:layout_marginEnd="10dp"
android:textColor="#FF4A5B76"
android:textSize="@dimen/dp_18"
android:layout_marginEnd="@dimen/dp_10"
/>
<TextView
@@ -34,13 +34,14 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/ivMV2XImage"
app:layout_constraintRight_toLeftOf="@id/tvMV2XTime"
android:textStyle="bold"
android:gravity="start"
android:maxLines="1"
android:ellipsize="end"
android:textColor="#FF203555"
android:textSize="25dp"
android:layout_marginStart="20dp"
android:layout_marginEnd="20dp"
android:textSize="@dimen/dp_25"
android:layout_marginStart="@dimen/dp_16"
android:layout_marginEnd="@dimen/dp_16"
/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.recyclerview.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/rvMBubbleList"
android:layout_width="450dp"
android:layout_width="@dimen/dp_450"
android:layout_height="wrap_content"
>

View File

@@ -1,21 +1,38 @@
<com.mogo.eagle.core.widget.RoundConstraintLayout
android:layout_width="450dp"
android:layout_height="520dp"
android:background="#FFFFFFFF"
app:roundLayoutRadius="40dp"
<LinearLayout
android:layout_width="@dimen/dp_450"
android:layout_height="@dimen/dp_520"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_marginBottom="16dp">
android:orientation="vertical"
>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvMList"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
android:layout_marginStart="30dp"
android:layout_marginEnd="30dp"
<com.mogo.eagle.core.function.hmi.ui.msgbox.SharpView
android:layout_width="@dimen/dp_25"
android:layout_height="@dimen/dp_25"
android:layout_gravity="end"
android:layout_marginEnd="@dimen/dp_35"
/>
</com.mogo.eagle.core.widget.RoundConstraintLayout>
<com.mogo.eagle.core.widget.RoundConstraintLayout
android:layout_width="@dimen/dp_450"
android:layout_height="@dimen/dp_490"
android:background="#FFFFFFFF"
app:roundLayoutRadius="@dimen/dp_18"
>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvMList"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
android:layout_marginStart="@dimen/dp_18"
android:layout_marginEnd="@dimen/dp_18"
/>
</com.mogo.eagle.core.widget.RoundConstraintLayout>
</LinearLayout>

View File

@@ -18,14 +18,13 @@
<!--乘客端消息提示-->
<View
android:id="@+id/msgBoxMTipView"
android:layout_width="15dp"
android:layout_height="15dp"
android:layout_width="8dp"
android:layout_height="8dp"
android:background="@drawable/version_upgrade_tips_background"
android:translationZ="30dp"
android:visibility="gone"
app:layout_constraintCircle="@id/cbMsgBoxM1"
app:layout_constraintCircleAngle="40"
app:layout_constraintCircleRadius="50dp"
app:layout_constraintCircleAngle="35"
app:layout_constraintCircleRadius="25dp"
tools:ignore="MissingConstraints" />
</androidx.constraintlayout.widget.ConstraintLayout>