[Change]
增加CallerHmiManager.INSTANCE.setProxyNotificationView(view)设置HMI中V2X弹窗预警,参考V2XNotificationView初始化方式 Signed-off-by: donghongyu <donghongyu@zhidaoauto.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.mogo.eagle.core.function.api.hmi
|
||||
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewLimitingVelocity
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewNotification
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewTrafficLight
|
||||
|
||||
/**
|
||||
@@ -9,6 +10,12 @@ import com.mogo.eagle.core.function.api.hmi.view.IViewTrafficLight
|
||||
interface IMoGoHmiViewProxy {
|
||||
|
||||
|
||||
/**
|
||||
* 设置 V2X预警 代理View
|
||||
* @param view
|
||||
*/
|
||||
fun setProxyNotificationView(view: IViewNotification)
|
||||
|
||||
/**
|
||||
* 设置 红绿灯 代理View
|
||||
* @param view
|
||||
@@ -19,5 +26,5 @@ interface IMoGoHmiViewProxy {
|
||||
* 设置 限速 代理View
|
||||
* @param view
|
||||
*/
|
||||
fun setLimitingSpeedView(view: IViewLimitingVelocity)
|
||||
fun setProxyLimitingSpeedView(view: IViewLimitingVelocity)
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.mogo.eagle.core.function.api.hmi.view
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.util.AttributeSet
|
||||
import android.view.Gravity
|
||||
import android.widget.LinearLayout
|
||||
import androidx.annotation.DrawableRes
|
||||
import androidx.annotation.IntDef
|
||||
import androidx.annotation.Nullable
|
||||
import androidx.annotation.StringRes
|
||||
import com.mogo.eagle.core.data.enums.SidePattern
|
||||
|
||||
/**
|
||||
* 定义 通知视图 接口
|
||||
*/
|
||||
abstract class IViewNotification(context: Context?, attrs: AttributeSet?, defStyleAttr: Int) :
|
||||
LinearLayout(context, attrs, defStyleAttr) {
|
||||
|
||||
@kotlin.annotation.Retention(AnnotationRetention.SOURCE)
|
||||
@IntDef(*[
|
||||
Gravity.LEFT, Gravity.RIGHT,
|
||||
Gravity.TOP, Gravity.BOTTOM,
|
||||
Gravity.START, Gravity.END,
|
||||
Gravity.CENTER_HORIZONTAL, Gravity.CENTER_VERTICAL,
|
||||
Gravity.FILL_HORIZONTAL, Gravity.FILL_VERTICAL,
|
||||
])
|
||||
annotation class GravityFlag
|
||||
|
||||
/**
|
||||
* 视图布局
|
||||
*/
|
||||
@GravityFlag
|
||||
open var layoutGravity: Int = Gravity.CENTER_HORIZONTAL
|
||||
|
||||
/**
|
||||
* 视图动画的出场方式
|
||||
*/
|
||||
open var sidePattern: SidePattern = SidePattern.RESULT_TOP
|
||||
|
||||
/**
|
||||
* 距离屏幕左上角 0,0点 X 轴距离,单位:px
|
||||
*/
|
||||
open var offsetX: Int = 0
|
||||
|
||||
/**
|
||||
* 距离屏幕左上角 0,0点 Y 轴距离,单位:px
|
||||
*/
|
||||
open var offsetY: Int = 0
|
||||
|
||||
open fun setWarningIcon(@DrawableRes warningIcon: Int) {}
|
||||
|
||||
open fun setWarningIcon(@Nullable drawable: Drawable) {}
|
||||
|
||||
open fun setWarningContent(@Nullable warningContent: CharSequence) {}
|
||||
|
||||
open fun setWarningContent(@StringRes warningContentId: Int) {}
|
||||
}
|
||||
Reference in New Issue
Block a user