[UI] 交警类型弹窗

This commit is contained in:
liujing
2021-10-30 19:18:20 +08:00
parent 10f4ff3dbb
commit 45109aabb9
5 changed files with 15 additions and 6 deletions

View File

@@ -217,6 +217,9 @@ class MoGoHmiFragment : MvpFragment<MoGoWarningContract.View?, WaringPresenter?>
override fun showNoticeForTrafficWithData(trafficStylePushData: NoticeTrafficStylePushData) {
activity.let {
val noticeBannerView = this.getContext()?.let { it1 -> NoticeBannerView(it1) }
if (noticeBannerView != null) {
noticeBannerView.refreshWithData(trafficStylePushData)
}
mWarningFloat = it?.let { it1 ->
noticeBannerView?.let { it2 ->
WarningFloat.with(it1)

View File

@@ -11,6 +11,7 @@ import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.ConstraintLayout;
import com.mogo.eagle.core.data.notice.NoticeTrafficStyleInfo;
import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData;
import com.mogo.eagle.core.function.hmi.R;
/**
@@ -47,6 +48,10 @@ public class NoticeBannerView extends ConstraintLayout {
super(context, attrs, defStyleAttr, defStyleRes);
}
public void refreshWithData(NoticeTrafficStylePushData pushData){
noticePushTitle.setText(pushData.getMsg());
noticePushContent.setText(pushData.getContent());
}
public void initView() {
styleImageView = findViewById(R.id.notice_push_style_image);
iconImageView = findViewById(R.id.notice_push_icon_video);
@@ -55,8 +60,8 @@ public class NoticeBannerView extends ConstraintLayout {
noticeBannerCheck = findViewById(R.id.notice_push_banner_check);
noticeBannerCheck.setOnClickListener(v -> {
mNoticeTrafficDialog = new NoticeTrafficDialog(mContext);
mNoticeTrafficDialog.show();
// mNoticeTrafficDialog = new NoticeTrafficDialog(mContext);
// mNoticeTrafficDialog.show();
});
}

View File

@@ -24,8 +24,8 @@
android:layout_marginLeft="@dimen/dp_18"
android:layout_marginBottom="@dimen/dp_18"
android:src="@drawable/notice_banner_icon_video"
app:layout_constraintBottom_toBottomOf="@+id/notice_push_image"
app:layout_constraintLeft_toLeftOf="@+id/notice_push_image" />
app:layout_constraintBottom_toBottomOf="@+id/notice_push_style_image"
app:layout_constraintLeft_toLeftOf="parent" />
<LinearLayout
android:id="@+id/module_push_app_icon_title"
@@ -46,12 +46,11 @@
android:layout_height="wrap_content"
android:ellipsize="end"
android:gravity="center_vertical|left"
android:maxWidth="@dimen/dp_184"
android:maxLength="25"
android:singleLine="true"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_46"
app:layout_constrainedWidth="true"
android:textStyle="bold"
tools:text="官方公告" />
<TextView

View File

@@ -18,6 +18,7 @@
<dimen name="dp_38">38px</dimen>
<dimen name="dp_42">42px</dimen>
<dimen name="dp_45">45px</dimen>
<dimen name="dp_46">46px</dimen>
<dimen name="dp_50">50px</dimen>
<dimen name="dp_52">52px</dimen>
<dimen name="dp_54">54px</dimen>

View File

@@ -18,6 +18,7 @@
<dimen name="dp_38">38px</dimen>
<dimen name="dp_42">42px</dimen>
<dimen name="dp_45">45px</dimen>
<dimen name="dp_46">46px</dimen>
<dimen name="dp_50">50px</dimen>
<dimen name="dp_52">52px</dimen>
<dimen name="dp_54">54px</dimen>