[add] 添加顶部弹框java类文件

This commit is contained in:
liujing
2021-10-26 18:30:04 +08:00
parent bd707078da
commit 9afd58ae5d
5 changed files with 89 additions and 7 deletions

View File

@@ -0,0 +1,67 @@
package com.mogo.eagle.core.function.hmi.ui.notice;
import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.ConstraintLayout;
import com.mogo.eagle.core.data.notice.NoticeInfo;
import com.mogo.eagle.core.function.hmi.R;
/**
* @author liujing
* @description 云公告顶部弹框
* @since: 10/26/21
*/
public class NoticeBannerView extends ConstraintLayout {
private ImageView styleImageView;
private ImageView iconImageView;
private TextView noticePushTitle;
private TextView noticePushContent;
private TextView noticeBannerCheck;
private NoticeTrafficDialog mNoticeTrafficDialog;
private Context mContext;
public NoticeBannerView(@NonNull Context context) {
super(context);
mContext = context;
LayoutInflater.from(context).inflate(R.layout.notice_push_top_banner, this);
initView();
}
public NoticeBannerView(@NonNull Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
}
public NoticeBannerView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
public NoticeBannerView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
}
public void initView() {
styleImageView = findViewById(R.id.notice_push_style_image);
iconImageView = findViewById(R.id.notice_push_icon_video);
noticePushTitle = findViewById(R.id.notice_push_title);
noticePushContent = findViewById(R.id.notice_push_content);
noticeBannerCheck = findViewById(R.id.notice_push_banner_check);
noticeBannerCheck.setOnClickListener(v -> {
mNoticeTrafficDialog = new NoticeTrafficDialog(mContext);
mNoticeTrafficDialog.show();
});
}
//数据改变刷新UI
public void pushBeanChanged(NoticeInfo info){
}
}

View File

@@ -8,7 +8,7 @@
android:background="@drawable/notice_push_item_background">
<ImageView
android:id="@+id/module_push_image"
android:id="@+id/notice_push_style_image"
android:layout_width="@dimen/dp_230"
android:layout_height="@dimen/dp_230"
android:scaleType="fitXY"
@@ -17,6 +17,16 @@
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/notice_push_icon_video"
android:layout_width="@dimen/dp_62"
android:layout_height="@dimen/dp_45"
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" />
<LinearLayout
android:id="@+id/module_push_app_icon_title"
android:layout_width="0dp"
@@ -31,7 +41,7 @@
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/module_push_title"
android:id="@+id/notice_push_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
@@ -45,7 +55,7 @@
tools:text="官方公告" />
<TextView
android:id="@+id/module_push_content"
android:id="@+id/notice_push_content"
android:layout_width="@dimen/dp_588"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_22"
@@ -60,7 +70,7 @@
<View
android:id="@+id/module_push_line"
android:id="@+id/notice_banner_line"
android:layout_width="@dimen/dp_2"
android:layout_height="@dimen/dp_120"
android:layout_marginRight="@dimen/dp_208"
@@ -70,7 +80,7 @@
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/notice_traffic_push_check"
android:id="@+id/notice_push_banner_check"
android:layout_width="@dimen/dp_100"
android:layout_height="match_parent"
android:layout_marginRight="@dimen/dp_67"
@@ -81,7 +91,7 @@
android:textColor="@color/notice_banner_blue"
android:textSize="@dimen/dp_42"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="@+id/module_push_line"
app:layout_constraintLeft_toLeftOf="@+id/notice_banner_line"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />

View File

@@ -12,14 +12,17 @@
<dimen name="notice_traffic_info_height">290px</dimen>
<dimen name="notice_dialog_check_bg_corner">32px</dimen>
<dimen name="dp_18">18px</dimen>
<dimen name="dp_30">30px</dimen>
<dimen name="dp_36">36px</dimen>
<dimen name="dp_38">38px</dimen>
<dimen name="dp_42">42px</dimen>
<dimen name="dp_45">45px</dimen>
<dimen name="dp_50">50px</dimen>
<dimen name="dp_52">52px</dimen>
<dimen name="dp_54">54px</dimen>
<dimen name="dp_56">56px</dimen>
<dimen name="dp_62">62px</dimen>
<dimen name="dp_150">150px</dimen>
<dimen name="dp_180">180px</dimen>
<dimen name="dp_220">220px</dimen>

View File

@@ -11,16 +11,18 @@
<dimen name="notice_traffic_info_width">1160px</dimen>
<dimen name="notice_traffic_info_height">290px</dimen>
<dimen name="notice_dialog_check_bg_corner">32px</dimen>
<dimen name="dp_18">18px</dimen>
<dimen name="dp_30">30px</dimen>
<dimen name="dp_36">36px</dimen>
<dimen name="dp_38">38px</dimen>
<dimen name="dp_42">42px</dimen>
<dimen name="dp_45">45px</dimen>
<dimen name="dp_50">50px</dimen>
<dimen name="dp_52">52px</dimen>
<dimen name="dp_54">54px</dimen>
<dimen name="dp_56">56px</dimen>
<dimen name="dp_62">62px</dimen>
<dimen name="dp_150">150px</dimen>
<dimen name="dp_180">180px</dimen>
<dimen name="dp_220">220px</dimen>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB