1、升级换肤框架SDK,增加 app:isUseSkin="true" 属性用来开启换肤,防止换肤对代码动态设置的数据、图片造成冲刷。
This commit is contained in:
donghongyu-pc
2024-10-25 17:51:52 +08:00
parent 4358b32a7c
commit ce79c18d09
42 changed files with 96 additions and 27 deletions

View File

@@ -21,6 +21,7 @@ import com.mogo.eagle.core.utilcode.mogo.glide.transform.GlideRoundedCornersTran
import com.mogo.eagle.core.utilcode.util.TimeUtils
import com.mogo.eagle.core.utilcode.util.TimeUtils.getHourMinFormat
import com.mogo.eagle.core.widget.RoundCanClickConstraintLayout
import com.mogo.skin.utils.SkinResources
class MMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter<RecyclerView.ViewHolder>() {
@@ -66,11 +67,15 @@ class MMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter
is BubbleNoticeHolder -> {
data?.let {
val noticeFrCloudMsg = it[position].msgBoxBean.bean as NoticeFrCloudMsg
val placeholderDrawable =
SkinResources.getInstance().getDrawable(R.drawable.icon_passenger_operation)
if(noticeFrCloudMsg.type == 0){
val noticeNormalData = noticeFrCloudMsg.noticeNormalData
holder.tvMNoticeTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat())
holder.tvMNoticeContent.text = noticeNormalData?.content
GlideApp.with(activity).load(noticeNormalData?.imageUrl).placeholder(R.drawable.icon_passenger_operation)
GlideApp.with(activity).load(noticeNormalData?.imageUrl).placeholder(placeholderDrawable)
.optionalTransform(
GlideRoundedCornersTransform(
20f,
@@ -85,7 +90,7 @@ class MMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter
val noticeTrafficStylePushData = noticeFrCloudMsg.trafficPushData
holder.tvMNoticeTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat())
holder.tvMNoticeContent.text = noticeTrafficStylePushData?.content
GlideApp.with(activity).load(noticeTrafficStylePushData?.poiImgUrl).placeholder(R.drawable.icon_passenger_operation)
GlideApp.with(activity).load(noticeTrafficStylePushData?.poiImgUrl).placeholder(placeholderDrawable)
.optionalTransform(
GlideRoundedCornersTransform(
20f,

View File

@@ -10,15 +10,20 @@ import androidx.core.content.res.ResourcesCompat
import androidx.recyclerview.widget.RecyclerView
import com.mogo.eagle.core.data.enums.DataSourceType
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
import com.mogo.eagle.core.data.msgbox.*
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.msgbox.MsgBoxType
import com.mogo.eagle.core.data.msgbox.NoticeFrCloudMsg
import com.mogo.eagle.core.data.msgbox.OperationMsg
import com.mogo.eagle.core.data.msgbox.V2XMsg
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxEventListenerManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.function.hmi.ui.widget.ExpandableTextView
import com.mogo.eagle.core.utilcode.mogo.glide.GlideApp
import com.mogo.eagle.core.utilcode.mogo.glide.transform.GlideRoundedCornersTransform
import com.mogo.eagle.core.utilcode.util.TimeUtils
import com.mogo.eagle.core.utilcode.util.TimeUtils.getHourMinFormat
import com.mogo.eagle.core.utilcode.mogo.glide.GlideApp
import com.mogo.skin.utils.SkinResources
class MMsgBoxListAdapter(private val activity: Activity): RecyclerView.Adapter<RecyclerView.ViewHolder>() {
@@ -60,11 +65,14 @@ class MMsgBoxListAdapter(private val activity: Activity): RecyclerView.Adapter<R
is ListNoticeHolder -> {
data?.let {
val noticeFrCloudMsg = it[position].bean as NoticeFrCloudMsg
val placeholderDrawable =
SkinResources.getInstance().getDrawable(R.drawable.icon_notice_default)
if(noticeFrCloudMsg.type == 0){
val noticeNormalData = noticeFrCloudMsg.noticeNormalData
holder.tvMNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvMNoticeContent.text = noticeNormalData?.content
GlideApp.with(activity).load(noticeNormalData?.imageUrl).placeholder(R.drawable.icon_notice_default)
GlideApp.with(activity).load(noticeNormalData?.imageUrl).placeholder(placeholderDrawable)
.optionalTransform(
GlideRoundedCornersTransform(
20f,
@@ -79,7 +87,7 @@ 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).placeholder(R.drawable.icon_notice_default)
GlideApp.with(activity).load(noticeTrafficStylePushData?.poiImgUrl).placeholder(placeholderDrawable)
.optionalTransform(
GlideRoundedCornersTransform(
20f,

View File

@@ -11,7 +11,6 @@ import androidx.constraintlayout.widget.ConstraintLayout
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.widget.media.video.SimpleVideoPlayer
import com.mogo.eagle.core.widget.media.video.SkinSimpleVideoPlayer
import com.mogo.skin.utils.SkinResources
import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder

View File

@@ -18,6 +18,7 @@
app:layout_constraintLeft_toLeftOf="parent"
android:src="@drawable/icon_bus_passenger_logo"
android:layout_marginStart="@dimen/dp_26"
app:isUseSkin="true"
/>
<TextView

View File

@@ -18,6 +18,7 @@
app:layout_constraintLeft_toLeftOf="parent"
android:src="@drawable/icon_bus_passenger_logo"
android:layout_marginStart="@dimen/dp_26"
app:isUseSkin="true"
/>
<TextView

View File

@@ -17,6 +17,7 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:src="@drawable/icon_passenger_operation"
app:isUseSkin="true"
/>
<TextView

View File

@@ -16,6 +16,7 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:src="@drawable/icon_passenger_operation"
app:isUseSkin="true"
/>
<TextView

View File

@@ -17,6 +17,7 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:src="@drawable/icon_passenger_operation"
app:isUseSkin="true"
/>
<TextView

View File

@@ -16,6 +16,7 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:src="@drawable/icon_passenger_operation"
app:isUseSkin="true"
/>
<TextView

View File

@@ -17,6 +17,7 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:src="@drawable/icon_passenger_operation"
app:isUseSkin="true"
/>
<TextView

View File

@@ -13,6 +13,7 @@
app:layout_constraintLeft_toLeftOf="parent"
android:src="@drawable/icon_passenger_operation"
android:layout_marginStart="@dimen/dp_16"
app:isUseSkin="true"
/>
<TextView

View File

@@ -15,6 +15,7 @@
android:src="@drawable/icon_passenger_operation"
android:layout_marginTop="@dimen/dp_16"
android:layout_marginBottom="@dimen/dp_16"
app:isUseSkin="true"
/>
<TextView

View File

@@ -13,6 +13,7 @@
app:layout_constraintLeft_toLeftOf="parent"
android:src="@drawable/icon_passenger_operation"
android:layout_marginStart="@dimen/dp_16"
app:isUseSkin="true"
/>
<TextView

View File

@@ -21,6 +21,7 @@
app:layout_constraintLeft_toLeftOf="parent"
android:layout_marginStart="15dp"
android:src="@drawable/icon_notice_default"
app:isUseSkin="true"
/>
<TextView

View File

@@ -21,6 +21,7 @@
app:layout_constraintLeft_toLeftOf="parent"
android:layout_marginStart="15dp"
android:src="@drawable/icon_notice_default"
app:isUseSkin="true"
/>
<TextView

View File

@@ -19,6 +19,7 @@
app:layout_constraintLeft_toLeftOf="parent"
android:layout_marginStart="15dp"
android:src="@drawable/icon_notice_default"
app:isUseSkin="true"
/>
<TextView

View File

@@ -19,6 +19,7 @@
app:layout_constraintLeft_toLeftOf="parent"
android:layout_marginStart="15dp"
android:src="@drawable/icon_notice_default"
app:isUseSkin="true"
/>
<TextView

View File

@@ -17,6 +17,7 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:src="@drawable/icon_passenger_operation"
app:isUseSkin="true"
/>
<TextView

View File

@@ -12,6 +12,7 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:src="@drawable/icon_passenger_operation"
app:isUseSkin="true"
/>
<TextView

View File

@@ -12,6 +12,7 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:src="@drawable/icon_passenger_operation"
app:isUseSkin="true"
/>
<TextView

View File

@@ -30,7 +30,8 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toTopOf="parent"
app:isUseSkin="true" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.recyclerview.widget.RecyclerView

View File

@@ -19,6 +19,7 @@
android:background="@drawable/road_video_bg"
android:minWidth="1736dp"
android:minHeight="974dp"
app:isUseSkin="true"
>
<com.mogo.eagle.core.widget.media.video.SimpleVideoPlayer
android:id="@+id/roadVideoPlayer"

View File

@@ -47,6 +47,7 @@
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:isUseSkin="true"
tools:ignore="ContentDescription" />
<TextView

View File

@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_status_bar_height"
tools:background="#A6000000"
@@ -113,5 +114,6 @@
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@drawable/icon_status_bar_logo"
android:contentDescription="@null"/>
android:contentDescription="@null"
app:isUseSkin="true"/>
</merge>

View File

@@ -10,13 +10,13 @@
android:id="@+id/svp_cold_start"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:isUseSkin="true"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<com.mogo.eagle.core.function.hmi.ui.widget.ColdStartView
android:id="@+id/view_cold_start_again"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
android:layout_height="match_parent" />
</androidx.constraintlayout.widget.ConstraintLayout>