diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/MMsgBoxListView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/MMsgBoxListView.kt index 9109c47a41..f6f930fba8 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/MMsgBoxListView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/MMsgBoxListView.kt @@ -4,7 +4,9 @@ import android.app.Activity import android.content.Context import android.util.AttributeSet import android.view.LayoutInflater +import android.view.View import androidx.constraintlayout.widget.ConstraintLayout +import androidx.core.view.isVisible import androidx.recyclerview.widget.DividerItemDecoration import androidx.recyclerview.widget.LinearLayoutManager import com.mogo.eagle.core.data.msgbox.MsgBoxBean @@ -55,6 +57,11 @@ class MMsgBoxListView @JvmOverloads constructor( //获取通知消息列表 noticeList= CallerMsgBoxManager.getCachedNotifyData() as ArrayList? noticeList = noticeList?.let { ArrayList(it.reversed()) } + if(noticeList.isNullOrEmpty()){ + ivMsgEmpty.visibility = View.VISIBLE + }else{ + ivMsgEmpty.visibility = View.GONE + } noticeList?.let { mMsgBoxListAdapter?.setData(it) } @@ -68,6 +75,9 @@ class MMsgBoxListView @JvmOverloads constructor( || msgBoxList.type == MsgBoxType.OBU || msgBoxList.type == MsgBoxType.OPERATION){ noticeList?.add(0,msgBoxList) noticeList?.let { + if(it.isNotEmpty() && ivMsgEmpty.isVisible){ + ivMsgEmpty.visibility = View.GONE + } mMsgBoxListAdapter?.setData(it) } } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_m_msg_empty.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_m_msg_empty.png new file mode 100644 index 0000000000..1bfa26eea9 Binary files /dev/null and b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_m_msg_empty.png differ 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 70ec2ac202..2b25f97a94 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 @@ -31,6 +31,17 @@ android:layout_marginEnd="@dimen/dp_18" /> + +