[6.5.0][事件弹框] refactor: 修改UI 走查问题;
feat: 不在高精地图页面不弹事件框;
This commit is contained in:
@@ -18,7 +18,9 @@ import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.v2x.RoadV2NEventType
|
||||
import com.mogo.eagle.core.data.v2x.RoadV2NEventWindowBean
|
||||
import com.mogo.eagle.core.function.api.hmi.v2n.IRoadV2NEventWindowListener
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerRoadV2NEventWindowListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
@@ -47,7 +49,8 @@ class RoadV2NEventWindowView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr), IRoadV2NEventWindowListener {
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr), IRoadV2NEventWindowListener,
|
||||
IViewControlListener {
|
||||
|
||||
companion object {
|
||||
const val TAG = "RoadV2NEventWindowView"
|
||||
@@ -62,6 +65,7 @@ class RoadV2NEventWindowView @JvmOverloads constructor(
|
||||
map
|
||||
)
|
||||
}
|
||||
CallerLogger.i(TAG, msg)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,6 +75,9 @@ class RoadV2NEventWindowView @JvmOverloads constructor(
|
||||
|
||||
private var currentEventUUID: String = ""
|
||||
|
||||
// 只有在高精地图的tab才展示事件弹框
|
||||
private var canShowV2NEventWindowView = true
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.hmi_view_road_v2n_event_window, this, true)
|
||||
}
|
||||
@@ -101,7 +108,7 @@ class RoadV2NEventWindowView @JvmOverloads constructor(
|
||||
containerIconHintLayoutParams.width = LayoutParams.MATCH_PARENT
|
||||
containerIconHintLayoutParams.height = LayoutParams.WRAP_CONTENT
|
||||
containerIconHintLayoutParams.setMargins(
|
||||
AutoSizeUtils.dp2px(context, 50f - 17f), //乘客屏icon ivV2XImage带了白边
|
||||
AutoSizeUtils.dp2px(context, 50f - 17f), //乘客屏icon ivV2XImage带了白边, 高度、margin需要计算调整
|
||||
AutoSizeUtils.dp2px(context, 40f),
|
||||
AutoSizeUtils.dp2px(context, 50f),
|
||||
0
|
||||
@@ -109,18 +116,23 @@ class RoadV2NEventWindowView @JvmOverloads constructor(
|
||||
containerIconHint.layoutParams = containerIconHintLayoutParams
|
||||
|
||||
val ivV2XImageLayoutParams = ivV2XImage.layoutParams as RelativeLayout.LayoutParams
|
||||
ivV2XImageLayoutParams.width = AutoSizeUtils.dp2px(context, 69f + 34f) //乘客屏icon ivV2XImage带了白边
|
||||
ivV2XImageLayoutParams.height = AutoSizeUtils.dp2px(context, 69f + 34f) //乘客屏icon ivV2XImage带了白边
|
||||
ivV2XImageLayoutParams.width =
|
||||
AutoSizeUtils.dp2px(context, 69f + 34f) //乘客屏icon ivV2XImage带了白边, 高度、margin需要计算调整
|
||||
ivV2XImageLayoutParams.height =
|
||||
AutoSizeUtils.dp2px(context, 69f + 34f) //乘客屏icon ivV2XImage带了白边, 高度、margin需要计算调整
|
||||
ivV2XImage.layoutParams = ivV2XImageLayoutParams
|
||||
|
||||
val tvV2XHintContentLayoutParams =
|
||||
tvV2XHintContent.layoutParams as RelativeLayout.LayoutParams
|
||||
tvV2XHintContentLayoutParams.setMargins(
|
||||
AutoSizeUtils.dp2px(context, 30f - 17f), 0,//乘客屏icon ivV2XImage带了白边
|
||||
AutoSizeUtils.dp2px(context, 15f), 0
|
||||
AutoSizeUtils.dp2px(context, 30f - 17f), //乘客屏icon ivV2XImage带了白边, 高度、margin需要计算调整
|
||||
0,
|
||||
AutoSizeUtils.dp2px(context, 15f),
|
||||
0
|
||||
)
|
||||
tvV2XHintContent.layoutParams = tvV2XHintContentLayoutParams
|
||||
tvV2XHintContent.setTextColor(Color.parseColor("#131415"))
|
||||
tvV2XHintContent.setPadding(0, 0, 0, AutoSizeUtils.dp2px(context, 16f))
|
||||
|
||||
val containerImageAndLiveVideoLayoutParams =
|
||||
containerImageAndLiveVideo.layoutParams as ConstraintLayout.LayoutParams
|
||||
@@ -134,7 +146,7 @@ class RoadV2NEventWindowView @JvmOverloads constructor(
|
||||
)
|
||||
containerImageAndLiveVideo.layoutParams = containerImageAndLiveVideoLayoutParams
|
||||
|
||||
contentImageView.setRadius(AutoSizeUtils.dp2px(context, 16f).toFloat())
|
||||
contentImageView.setRadius(16f)
|
||||
|
||||
val tvV2XTimeStrLayoutParams =
|
||||
tvV2XTimeStr.layoutParams as ConstraintLayout.LayoutParams
|
||||
@@ -223,7 +235,7 @@ class RoadV2NEventWindowView @JvmOverloads constructor(
|
||||
)
|
||||
containerImageAndLiveVideo.layoutParams = containerImageAndLiveVideoLayoutParams
|
||||
|
||||
contentImageView.setRadius(AutoSizeUtils.dp2px(context, 12f).toFloat())
|
||||
contentImageView.setRadius(12f)
|
||||
|
||||
val tvV2XTimeStrLayoutParams =
|
||||
tvV2XTimeStr.layoutParams as ConstraintLayout.LayoutParams
|
||||
@@ -262,16 +274,22 @@ class RoadV2NEventWindowView @JvmOverloads constructor(
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
CallerRoadV2NEventWindowListenerManager.addListener(TAG, this)
|
||||
CallerHmiViewControlListenerManager.addListener(TAG, this)
|
||||
initView()
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
CallerRoadV2NEventWindowListenerManager.removeListener(TAG)
|
||||
CallerHmiViewControlListenerManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
override fun show(dataBean: RoadV2NEventWindowBean) {
|
||||
trackEvent("show --> ${dataBean.toString()}")
|
||||
if (!canShowV2NEventWindowView) {
|
||||
trackEvent("show --> 当前不在高精地图页面,跳过")
|
||||
return
|
||||
}
|
||||
UiThreadHandler.removeCallbacks(dismissRunnable)
|
||||
UiThreadHandler.post {
|
||||
currentEventUUID = dataBean.eventId
|
||||
@@ -335,4 +353,9 @@ class RoadV2NEventWindowView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun mainPageViewVisible(v: Int) {
|
||||
canShowV2NEventWindowView = (View.VISIBLE == v)
|
||||
trackEvent("mainPageViewVisible --> $canShowV2NEventWindowView")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user