[6.7.0][接口] refactor: 将鹰眼base接口和och 接口根据调用方法区分开;

This commit is contained in:
aibingbing
2024-09-24 11:53:40 +08:00
parent e94083f1fd
commit 9ee29d133e
3 changed files with 0 additions and 230 deletions

View File

@@ -1,14 +0,0 @@
package com.mogo.eagle.core.function.api.och
/**
* 定义给 Och 业务层调用的接口
*/
interface IOchCommonFunctionCall {
/**
* 退出登录
*/
fun logout()
}

View File

@@ -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<ToolKitDefaultItemAddParam>) {}
/**
* 增加单个自定义样式的工具箱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<ToolKitCustomItemAddParam>) {}
/**
* 获取当前所有工具箱中各工具的tag
*/
fun getToolkitAllTags(): Set<String> {
return emptySet()
}
/**
* 根据toolTag 移除工具箱中工具
*/
fun removeToolkitByTag(toolTagList: List<String>) {}
/**
* 网约车回调登陆信息
*/
fun invokeLoginInfo() {}
}

View File

@@ -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<IOchFunctionCallNotify>(), 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<ToolKitDefaultItemAddParam>) {
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<ToolKitCustomItemAddParam>) {
CallerHmiManager.addMultiToolkitCustomItem(list)
}
/**
* 获取当前所有工具箱中各工具的tag
*/
override fun getToolkitAllTags(): Set<String> {
return CallerHmiManager.getToolkitAllTags()
}
/**
* 根据toolTag 移除工具箱中工具
*/
override fun removeToolkitByTag(toolTagList: List<String>) {
//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()
}
}
}