From 9ee29d133ebc155a0585f27517de1e1a15d9379b Mon Sep 17 00:00:00 2001 From: aibingbing Date: Tue, 24 Sep 2024 11:53:40 +0800 Subject: [PATCH] =?UTF-8?q?[6.7.0][=E6=8E=A5=E5=8F=A3]=20refactor:=20?= =?UTF-8?q?=E5=B0=86=E9=B9=B0=E7=9C=BCbase=E6=8E=A5=E5=8F=A3=E5=92=8Coch?= =?UTF-8?q?=20=E6=8E=A5=E5=8F=A3=E6=A0=B9=E6=8D=AE=E8=B0=83=E7=94=A8?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E5=8C=BA=E5=88=86=E5=BC=80=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/och/IOchCommonFunctionCall.kt | 14 -- .../core/function/api/och/IOchFunctionCall.kt | 68 -------- .../call/och/CallerOchFunctionCallManager.kt | 148 ------------------ 3 files changed, 230 deletions(-) delete mode 100644 core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/och/IOchCommonFunctionCall.kt delete mode 100644 core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/och/IOchFunctionCall.kt delete mode 100644 core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/och/CallerOchFunctionCallManager.kt diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/och/IOchCommonFunctionCall.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/och/IOchCommonFunctionCall.kt deleted file mode 100644 index 2d352c8dde..0000000000 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/och/IOchCommonFunctionCall.kt +++ /dev/null @@ -1,14 +0,0 @@ -package com.mogo.eagle.core.function.api.och - -/** - * 定义给 Och 业务层调用的接口 - */ -interface IOchCommonFunctionCall { - - /** - * 退出登录 - */ - fun logout() - - -} \ No newline at end of file diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/och/IOchFunctionCall.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/och/IOchFunctionCall.kt deleted file mode 100644 index d60bc7c78d..0000000000 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/och/IOchFunctionCall.kt +++ /dev/null @@ -1,68 +0,0 @@ -package com.mogo.eagle.core.function.api.och - -import android.view.View -import com.mogo.eagle.core.function.api.och.toolkit.IToolKitItemClickListener -import com.mogo.eagle.core.function.api.och.toolkit.ToolKitCustomItemAddParam -import com.mogo.eagle.core.function.api.och.toolkit.ToolKitDefaultItemAddParam - -/** - * 定义给 Och 业务层调用的接口 - */ -interface IOchFunctionCall { - - /** - * 注册 工具箱 item点击事件监听 (默认样式item的点击事件监听,自定义样式的item的点击交给view自己处理) - */ - fun addToolKitDefaultItemClickListener(tag: String, listener: IToolKitItemClickListener) - - /** - * 增加单个默认样式的工具箱item - * @param toolTag 唯一标识tag,和前面toolTag重复的,默认不添加,跳过 - * @param toolTitle 工具名称 - * @param toolDrawableIcon icon drawable 资源文件id - * @param position 在列表中排列位置 (1...N), position大于当前列表size最大值的默认放列表最后 - */ - fun addSingleToolKitDefaultItem( - toolTag: String, - toolTitle: String, - toolDrawableIcon: Int, - position: Int - ) { - } - - /** - * 增加多个默认样式的工具箱item - */ - fun addMultiToolkitDefaultItem(list: ArrayList) {} - - /** - * 增加单个自定义样式的工具箱item - * @param toolTag 唯一标识tag,和前面toolTag重复的,默认不添加,跳过 - * @param customView 自定义View - * @param position 在列表中排列位置 (1...N), position大于当前列表size最大值的默认放列表最后 - */ - fun addSingleToolKitCustomItem(toolTag: String, customView: View, position: Int) {} - - /** - * 增加多个自定义样式的工具箱item - */ - fun addMultiToolkitCustomItem(list: ArrayList) {} - - /** - * 获取当前所有工具箱中各工具的tag - */ - fun getToolkitAllTags(): Set { - return emptySet() - } - - /** - * 根据toolTag 移除工具箱中工具 - */ - fun removeToolkitByTag(toolTagList: List) {} - - /** - * 网约车回调登陆信息 - */ - fun invokeLoginInfo() {} - -} \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/och/CallerOchFunctionCallManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/och/CallerOchFunctionCallManager.kt deleted file mode 100644 index 0fa75e4ef2..0000000000 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/och/CallerOchFunctionCallManager.kt +++ /dev/null @@ -1,148 +0,0 @@ -package com.mogo.eagle.core.function.call.och - -import android.view.View -import com.mogo.eagle.core.data.enums.Carmodel -import com.mogo.eagle.core.function.api.och.IOchCommonFunctionCall -import com.mogo.eagle.core.function.api.och.IOchFunctionCall -import com.mogo.eagle.core.function.api.och.IOchFunctionCallNotify -import com.mogo.eagle.core.function.api.och.toolkit.IToolKitItemClickListener -import com.mogo.eagle.core.function.api.och.toolkit.ToolKitCustomItemAddParam -import com.mogo.eagle.core.function.api.och.toolkit.ToolKitDefaultItemAddParam -import com.mogo.eagle.core.function.call.base.CallerBase -import com.mogo.eagle.core.function.call.hmi.CallerHmiManager -import kotlin.properties.Delegates - -/** - * 实现给 Och 业务层调用的接口 - */ -object CallerOchFunctionCallManager : CallerBase(), IOchFunctionCall { - const val TAG = "CallerOchFunctionCallManager" - - override fun doSomeAfterAddListener(tag: String, listener: IOchFunctionCallNotify) { - super.doSomeAfterAddListener(tag, listener) - listener.notifyCarMode(carModel) - listener.notifyPlateNumber(plateNumber) - listener.notifyLoginInfo() - } - - // 车的类型 - private var carModel: Carmodel? by Delegates.observable(null) { _, oldValue, newValue -> - if (oldValue != newValue) { - M_LISTENERS.forEach { - it.value.notifyCarMode(carModel) - } - } - } - - private var plateNumber: String? by Delegates.observable(null) { _, oldValue, newValue -> - if (oldValue != newValue) { - M_LISTENERS.forEach { - it.value.notifyPlateNumber(plateNumber) - } - } - } - - private var _ochCallFuncation: IOchCommonFunctionCall? = null - - val ochCallFunction: IOchCommonFunctionCall? - get() = _ochCallFuncation - - fun setOchCommonFunctionCall(caller: IOchCommonFunctionCall) { - this._ochCallFuncation = caller - } - - /** - * 注册 工具箱 item点击事件监听 (默认样式item的点击事件监听,自定义样式的item的点击交给view自己处理) - */ - override fun addToolKitDefaultItemClickListener( - tag: String, - listener: IToolKitItemClickListener - ) { - CallerHmiManager.addToolKitDefaultItemClickListener(tag, listener) - } - - /** - * 增加单个默认样式的工具箱item - * @param toolTag 唯一标识tag,和前面toolTag重复的,默认不添加,跳过 - * @param toolTitle 工具名称 - * @param toolDrawableIcon icon drawable 资源文件id - * @param position 在列表中排列位置 (1...N), position大于当前列表size最大值的默认放列表最后 - */ - override fun addSingleToolKitDefaultItem( - toolTag: String, - toolTitle: String, - toolDrawableIcon: Int, - position: Int - ) { - CallerHmiManager.addSingleToolKitDefaultItem( - toolTag, - toolTitle, - toolDrawableIcon, - position - ) - } - - /** - * 增加多个默认样式的工具箱item - */ - override fun addMultiToolkitDefaultItem(list: ArrayList) { - CallerHmiManager.addMultiToolkitDefaultItem(list) - } - - /** - * 增加单个自定义样式的工具箱item - * @param toolTag 唯一标识tag,和前面toolTag重复的,默认不添加,跳过 - * @param customView 自定义View - * @param position 在列表中排列位置 (1...N), position大于当前列表size最大值的默认放列表最后 - */ - override fun addSingleToolKitCustomItem(toolTag: String, customView: View, position: Int) { - CallerHmiManager.addSingleToolKitCustomItem(toolTag, customView, position) - } - - /** - * 增加多个自定义样式的工具箱item - */ - override fun addMultiToolkitCustomItem(list: ArrayList) { - CallerHmiManager.addMultiToolkitCustomItem(list) - } - - /** - * 获取当前所有工具箱中各工具的tag - */ - override fun getToolkitAllTags(): Set { - return CallerHmiManager.getToolkitAllTags() - } - - /** - * 根据toolTag 移除工具箱中工具 - */ - override fun removeToolkitByTag(toolTagList: List) { - //CallerHmiManager.removeToolkitByTag(toolTagList) - } - - /** - * 车型 E70 H9 B1 B2 M1 金旅牌XML6606JEVY0(小巴车) NJL6450ICEV(小巴) BJ5122TXSEV-H1(环卫车) - */ - fun setOchCarModel(carModel: Carmodel) { - this.carModel = carModel - } - - // 车牌 - fun setOchPlateNumber(plateNumber: String?) { - this.plateNumber = plateNumber - } - - - override fun invokeLoginInfo() { - M_LISTENERS.forEach { - val listener = it.value - listener.notifyLoginInfo() - } - } - - fun invokeLoginOut(){ - M_LISTENERS.forEach { - it.value.LoginOut() - } - } -} \ No newline at end of file