修复 模块加载 类型转换异常

Signed-off-by: 董宏宇 <martindhy@gmail.com>
This commit is contained in:
董宏宇
2021-10-15 18:57:07 +08:00
parent 0e119f8f55
commit da955835a2
35 changed files with 321 additions and 219 deletions

View File

@@ -16,6 +16,11 @@ import com.zhidao.support.adas.high.AdasManager
*/
@Route(path = MogoServicePaths.PATH_AUTO_PILOT)
class MoGoAutoPilotProvider : IMoGoAutoPilotProvider {
private val TAG = "MoGoAutoPilotProvider"
override val functionName: String
get() = TAG
override fun init(context: Context) {
// 初始化ADAS 域控制器
@@ -66,7 +71,4 @@ class MoGoAutoPilotProvider : IMoGoAutoPilotProvider {
return AdasManager.getInstance().recordPackage()
}
companion object {
private const val TAG = "MogoAutoPilotProvider"
}
}

View File

@@ -0,0 +1,25 @@
package com.mogo.eagle.core.function.hmi.ui.widget
import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import android.widget.FrameLayout
import com.mogo.eagle.core.function.hmi.R
/**
*@author xiaoyuzhou
*@date 2021/10/15 11:34 上午
* 视角切换按钮
*/
class PerspectiveSwitchView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
) : FrameLayout(context, attrs, defStyleAttr) {
init {
LayoutInflater.from(context).inflate(R.layout.view_perspective_switch, this, true)
}
}

View File

@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/module_switch_model_layout"
android:layout_width="@dimen/module_switch_map"
android:layout_height="@dimen/module_switch_map_height"
android:background="@drawable/module_switch_map_bg"
android:elevation="@dimen/dp_10"
android:padding="@dimen/dp_20">
<LinearLayout
android:id="@+id/module_switch_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:id="@+id/module_switch_model_icon"
android:layout_width="@dimen/module_switch_image"
android:layout_height="@dimen/module_switch_image"
android:layout_gravity="left|center_vertical"
android:paddingLeft="@dimen/module_switch_margin_left"
android:src="@drawable/module_switch_map_angle" />
<TextView
android:id="@+id/module_switch_model_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right|center"
android:paddingLeft="@dimen/module_switch_margin_left"
android:text="@string/module_map_model_normal"
android:textColor="@color/module_ext_color_voice_text"
android:textSize="@dimen/module_switch_text_size" />
</LinearLayout>
</FrameLayout>

View File

@@ -1,17 +1,18 @@
package com.mogo.eagle.core.function.notice;
package com.mogo.eagle.core.function.notice
import android.content.Context;
import com.mogo.eagle.core.function.api.notice.IMoGoNoticeProvider;
import android.content.Context
import com.mogo.eagle.core.function.api.notice.IMoGoNoticeProvider
/**
* @author xiaoyuzhou
* @date 2021/9/18 11:44 上午
* 处理云端下发通知、公告类的逻辑的接口
*/
public class MoGoNoticeProvider implements IMoGoNoticeProvider {
@Override
public void init(Context context) {
class MoGoNoticeProvider : IMoGoNoticeProvider {
private val TAG = "MoGoNoticeProvider"
}
}
override val functionName: String
get() = TAG
override fun init(context: Context) {}
}

View File

@@ -18,6 +18,10 @@ class MoGoObuProvider : IMoGoObuProvider {
private var mContext: Context? = null
override val functionName: String
get() = TAG
override fun init(context: Context) {
LogUtils.dTag(TAG, "初始化蘑菇自研OBU……")
mContext = context
@@ -34,4 +38,5 @@ class MoGoObuProvider : IMoGoObuProvider {
}
}
}

View File

@@ -1,5 +1,6 @@
package com.mogo.eagle.core.function.api.base
import android.util.Log
import com.alibaba.android.arouter.facade.template.IProvider
/**
@@ -8,5 +9,17 @@ import com.alibaba.android.arouter.facade.template.IProvider
* 处理没有页面的服务及交互逻辑的提供者
*/
interface IMoGoFunctionServerProvider : IProvider {
/**
* 功能模块唯一标识
*
* @return 功能模块名称
*/
val functionName: String
/**
* 功能销毁回调
*/
fun onDestroy() {
Log.d("IMoGoFunctionServerProvider", "onDestroy")
}
}

View File

@@ -0,0 +1,15 @@
package com.mogo.eagle.core.function.api.map.hd
/**
*@author xiaoyuzhou
*@date 2021/10/15 12:18 下午
* 地图样式改变回调监听
*/
interface IMoGoMapStyleChangeListener {
/**
* 地图样式改变回调监听
*/
fun onMapStyleModeChange(styleMode: Int)
}

View File

@@ -0,0 +1,77 @@
package com.mogo.eagle.core.function.call.map
import androidx.annotation.Nullable
import com.mogo.eagle.core.function.api.map.hd.IMoGoMapStyleChangeListener
import com.mogo.eagle.core.function.call.base.CallerBase
import com.mogo.eagle.core.utilcode.util.LogUtils
/**
* @author xiaoyuzhou
* @date 2021/9/30 5:48 下午
* 地图 监听管理
*/
object CallerMapListenerManager : CallerBase() {
private val TAG = "CallerMapListenerManager"
// 记录地图样式
private var mMapStyleMode = 0
// 存储所有注册了监听的对象invokeXXXX进行遍历回调将信息同步
private val mMapStyleChangeListeners: HashMap<String, IMoGoMapStyleChangeListener> = HashMap()
/**
* 添加 地图样式改变 监听
* @param tag 标记,用来注销监听使用
* @param listener 监听回调
*/
fun addMapStyleChangeListener(
@Nullable tag: String,
@Nullable listener: IMoGoMapStyleChangeListener
) {
mMapStyleChangeListeners[tag] = listener
listener.onMapStyleModeChange(mMapStyleMode)
}
/**
* 删除 地图样式改变 监听
* @param tag 标记,用来注销监听使用
*/
fun removeMapStyleChangeListener(@Nullable tag: String) {
mMapStyleChangeListeners.remove(tag)
}
/**
* 删除 地图样式改变 监听
* @param listener 要删除的监听对象
*/
fun removeMapStyleChangeListener(@Nullable listener: IMoGoMapStyleChangeListener) {
mMapStyleChangeListeners.forEach {
if (it.value == listener) {
mMapStyleChangeListeners.remove(it.key)
}
}
}
/**
* 触发 地图样式改变 监听
*/
fun invokeMapStyleChangeListener() {
invokeMapStyleChangeListener(mMapStyleMode)
}
/**
* 触发 地图样式改变 监听
* @param mapStyleMode 选中状态
*/
fun invokeMapStyleChangeListener(mapStyleMode: Int) {
LogUtils.dTag(TAG, "mapStyleMode:$mapStyleMode")
mMapStyleMode = mapStyleMode
mMapStyleChangeListeners.forEach {
val tag = it.key
val listener = it.value
LogUtils.dTag(TAG, "tag:$tag listener:$listener")
listener.onMapStyleModeChange(mMapStyleMode)
}
}
}

View File

@@ -22,21 +22,21 @@ object CallerObuListenerManager : CallerBase() {
private val mObuStatusListeners: HashMap<String, IMoGoObuStatusListener> = HashMap()
/**
* 查询OBU状态
* 查询 OBU状态
*/
fun getObuStatusInfo(): ObuStatusInfo {
return mObuStatusInfo
}
/**
* 查询OBU状态
* 查询 OBU状态
*/
fun getObuStatusInfoJsonString(): String {
return GsonUtils.toJson(mObuStatusInfo)
}
/**
* 添加自动驾驶按钮选中监听
* 添加 OBU状态 监听
* @param tag 标记,用来注销监听使用
* @param listener 监听回调
*/
@@ -49,7 +49,7 @@ object CallerObuListenerManager : CallerBase() {
}
/**
* 删除 监听
* 删除 OBU状态 监听
* @param tag 标记,用来注销监听使用
*/
fun removeListener(@Nullable tag: String) {
@@ -57,7 +57,7 @@ object CallerObuListenerManager : CallerBase() {
}
/**
* 删除自动驾驶按钮选中监听
* 删除 OBU状态 监听
* @param listener 要删除的监听对象
*/
fun removeListener(@Nullable listener: IMoGoObuStatusListener) {
@@ -69,19 +69,18 @@ object CallerObuListenerManager : CallerBase() {
}
/**
* 触发自动驾驶按钮选中监听
* 触发 OBU状态 监听
*/
fun invokeListener() {
LogUtils.dTag(TAG, "isChecked:$mObuStatusInfo")
invokeListener(mObuStatusInfo)
}
/**
* 触发自动驾驶按钮选中监听
* 触发 OBU状态 监听
* @param obuStatusInfo 选中状态
*/
fun invokeListener(obuStatusInfo: ObuStatusInfo) {
LogUtils.dTag(TAG, "isChecked:$obuStatusInfo")
LogUtils.dTag(TAG, "obuStatusInfo:$obuStatusInfo")
mObuStatusInfo = obuStatusInfo
mObuStatusListeners.forEach {
val tag = it.key

Binary file not shown.

After

Width:  |  Height:  |  Size: 862 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 862 B

View File

@@ -32,4 +32,13 @@
<dimen name="module_hmi_btn_text_size">44px</dimen>
<dimen name="module_switch_map">279px</dimen>
<dimen name="module_switch_map_height">119px</dimen>
<dimen name="module_switch_margin_left">22px</dimen>
<dimen name="module_switch_text_size">36px</dimen>
<dimen name="module_switch_image">50px</dimen>
<dimen name="module_switch_image_circle">60px</dimen>
</resources>

View File

@@ -5,4 +5,6 @@
<color name="module_switch_map_bg">#323C6F</color>
<color name="module_ext_color_voice_text">#FFFFFF</color>
</resources>

View File

@@ -32,4 +32,13 @@
<dimen name="module_hmi_btn_text_size">33px</dimen>
<dimen name="module_switch_map">190px</dimen>
<dimen name="module_switch_map_height">76px</dimen>
<dimen name="module_switch_margin_left">16px</dimen>
<dimen name="module_switch_text_size">24px</dimen>
<dimen name="module_switch_image">35px</dimen>
<dimen name="module_switch_image_circle">38px</dimen>
</resources>

View File

@@ -4,4 +4,7 @@
<string name="VideoView_info_text_video_not_supported">"不支持该视频。"</string>
<string name="file_not_support">此文件不支持播放</string>
<string name="module_map_model_normal">近距视角</string>
<string name="module_map_model_faster">远距视角</string>
</resources>