opt ui
This commit is contained in:
@@ -54,10 +54,10 @@ public class NoticeBannerView extends ConstraintLayout {
|
||||
mPushData = pushData;
|
||||
noticePushTitle.setText(pushData.getMsg());
|
||||
noticePushContent.setText(pushData.getContent());
|
||||
if (pushData.getType() == 1) {
|
||||
iconImageView.setVisibility(View.VISIBLE);
|
||||
if (pushData.getType() == 1) { //1 是图片, 2 是视频
|
||||
iconImageView.setVisibility(View.GONE);
|
||||
} else {
|
||||
iconImageView.setVisibility(View.INVISIBLE);
|
||||
iconImageView.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,8 @@ import android.widget.FrameLayout
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.annotation.LayoutRes
|
||||
import com.bumptech.glide.load.resource.bitmap.RoundedCorners
|
||||
import com.facebook.drawee.drawable.RoundedCornersDrawable
|
||||
import com.mogo.commons.context.ContextHolderUtil
|
||||
import com.mogo.eagle.core.data.notice.NoticeNormalData
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
@@ -18,6 +20,7 @@ import com.mogo.eagle.core.function.hmi.ui.utils.visible
|
||||
import com.mogo.service.windowview.IMogoTopViewManager
|
||||
import com.mogo.service.windowview.IMogoTopViewStatusListener
|
||||
import com.mogo.utils.glide.GlideApp
|
||||
import com.mogo.utils.glide.GlideRoundedCornersTransform
|
||||
|
||||
/**
|
||||
* 云公告弹框view
|
||||
@@ -45,12 +48,14 @@ class NoticeFloatView constructor(
|
||||
private lateinit var pushContent: TextView
|
||||
private lateinit var pushCheck: TextView
|
||||
private var pushData: NoticeNormalData? = null
|
||||
private lateinit var playIcon: ImageView
|
||||
|
||||
override fun inflateView(layoutId: Int) {
|
||||
LayoutInflater.from(context).inflate(layoutId, this, true)
|
||||
pushTitle = findViewById(R.id.notice_push_title)
|
||||
pushCheck = findViewById(R.id.notice_push_banner_check)
|
||||
pushImage = findViewById(R.id.notice_push_style_image)
|
||||
pushImage = findViewById(R.id.notice_push_style_image) //图片
|
||||
playIcon = findViewById(R.id.notice_push_icon_video) //视频指示图
|
||||
pushContent = findViewById(R.id.notice_push_content)
|
||||
titleIconContainer = findViewById(R.id.module_push_app_icon_title)
|
||||
|
||||
@@ -68,6 +73,13 @@ class NoticeFloatView constructor(
|
||||
|
||||
open fun setBean(bean: NoticeNormalData) {
|
||||
pushData = bean
|
||||
|
||||
if (bean.fileType == 2) {
|
||||
playIcon.visibility = View.VISIBLE
|
||||
} else {
|
||||
playIcon.visibility = View.GONE
|
||||
}
|
||||
|
||||
// title
|
||||
pushTitle.text = bean.title
|
||||
|
||||
@@ -76,7 +88,7 @@ class NoticeFloatView constructor(
|
||||
params.height = getImgHeight()
|
||||
pushImage.layoutParams = params
|
||||
pushImage.visible()
|
||||
GlideApp.with(this).load(bean.imageUrl).placeholder(R.drawable.notice_banner_default).into(pushImage)
|
||||
GlideApp.with(this).load(bean.imageUrl).optionalTransform(GlideRoundedCornersTransform(30f, GlideRoundedCornersTransform.CornerType.LEFT)).into(pushImage)
|
||||
|
||||
// content
|
||||
if (bean.content.isEmpty()) {
|
||||
|
||||
Reference in New Issue
Block a user