[V2X]修正乘客端预警弹窗位置不对
This commit is contained in:
@@ -28,6 +28,7 @@ import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.config.HmiBuildConfig
|
||||
import com.mogo.eagle.core.data.constants.MoGoFragmentPaths
|
||||
import com.mogo.eagle.core.data.enums.SidePattern
|
||||
import com.mogo.eagle.core.data.enums.SidePattern.*
|
||||
import com.mogo.eagle.core.data.enums.WarningDirectionEnum
|
||||
import com.mogo.eagle.core.data.notice.NoticeNormalData
|
||||
import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData
|
||||
@@ -140,6 +141,7 @@ import kotlin.collections.ArrayList
|
||||
|
||||
private var speakJob: Job? = null
|
||||
|
||||
private var showingV2XTip: IReminder? = null
|
||||
override fun vipIdentification(visible: Boolean) {
|
||||
ThreadUtils.runOnUiThread {
|
||||
if (visible) {
|
||||
@@ -582,7 +584,13 @@ import kotlin.collections.ArrayList
|
||||
itx.isFocusable = false
|
||||
itx.isClippingEnabled = false
|
||||
itx.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
|
||||
val transition = Slide(Gravity.TOP).also { t ->
|
||||
val transition = Slide(when(content.sidePattern) {
|
||||
LEFT, RESULT_LEFT-> Gravity.LEFT
|
||||
RIGHT, RESULT_RIGHT -> Gravity.RIGHT
|
||||
TOP, RESULT_TOP -> Gravity.TOP
|
||||
BOTTOM, RESULT_BOTTOM -> Gravity.BOTTOM
|
||||
else -> Gravity.TOP
|
||||
}).also { t ->
|
||||
t.interpolator = AccelerateDecelerateInterpolator()
|
||||
t.duration = 200
|
||||
}
|
||||
@@ -594,7 +602,7 @@ import kotlin.collections.ArrayList
|
||||
override fun show() {
|
||||
val parent = it.window.decorView
|
||||
parent.doOnAttach {
|
||||
popupWindow.showAtLocation(parent, Gravity.TOP, 0, 0)
|
||||
popupWindow.showAtLocation(parent, content.layoutGravity, 0, 0)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -624,6 +632,7 @@ import kotlin.collections.ArrayList
|
||||
if (reminder == null) {
|
||||
return
|
||||
}
|
||||
showingV2XTip = reminder
|
||||
lifecycleScope.launch {
|
||||
delay(expireTime)
|
||||
reminder?.hide()
|
||||
@@ -662,6 +671,7 @@ import kotlin.collections.ArrayList
|
||||
activity?.let {
|
||||
WarningFloat.dismiss(tag)
|
||||
}
|
||||
showingV2XTip?.takeIf { it.isShowing() }?.also { it.hide() }
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -30,7 +30,7 @@ class V2XNotificationView @JvmOverloads constructor(
|
||||
LayoutInflater.from(context).inflate(R.layout.notification_v2x_msg_vr, this, true)
|
||||
// 设置View的出场位置
|
||||
sidePattern = SidePattern.RESULT_TOP
|
||||
layoutGravity = Gravity.CENTER_HORIZONTAL
|
||||
layoutGravity = Gravity.CENTER_HORIZONTAL or Gravity.TOP
|
||||
// 设置View的停留位置
|
||||
setPadding(0, 110, 0, 0)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user