[6.7.0][接口] refactor: 将鹰眼base接口和och 接口根据调用方法区分开;
This commit is contained in:
@@ -6,7 +6,7 @@ import androidx.fragment.app.Fragment
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.enums.Carmodel
|
||||
import com.mogo.eagle.core.function.call.och.CallerOchFunctionCallManager
|
||||
import com.mogo.eagle.core.function.call.och.CallerEagleBaseFunctionCall4OchManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
@@ -152,8 +152,8 @@ class LoginProvider : LoginService {
|
||||
this.loginInfo = loginInfo
|
||||
}
|
||||
|
||||
CallerOchFunctionCallManager.setOchCarModel(Carmodel.getCarModelFromServerName(loginInfo.carModel))
|
||||
CallerOchFunctionCallManager.setOchPlateNumber(loginInfo.plateNumber)
|
||||
CallerEagleBaseFunctionCall4OchManager.setOchCarModel(Carmodel.getCarModelFromServerName(loginInfo.carModel))
|
||||
CallerEagleBaseFunctionCall4OchManager.setOchPlateNumber(loginInfo.plateNumber)
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,17 +1,18 @@
|
||||
package com.mogo.och.common.module.manager.transform
|
||||
|
||||
import com.mogo.eagle.core.function.api.och.IOchCommonFunctionCall
|
||||
import com.mogo.eagle.core.function.api.och.IOchBizFunctionCall4Eagle
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
import com.mogo.eagle.core.function.call.och.CallerOchBizFunctionCall4EagleManager
|
||||
|
||||
object OchTransform : CallerBase<OchTransformDispatch>(),IOchCommonFunctionCall {
|
||||
object OchTransform : CallerBase<OchTransformDispatch>(), IOchBizFunctionCall4Eagle {
|
||||
|
||||
init {
|
||||
CallerOchBizFunctionCall4EagleManager.setOchBizFunctionCall4EagleInstance(this)
|
||||
}
|
||||
|
||||
override fun logout() {
|
||||
M_LISTENERS.forEach {
|
||||
it.value.logout()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -6,13 +6,11 @@ import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.data.enums.Carmodel
|
||||
import com.mogo.eagle.core.function.api.och.IOchFunctionCall
|
||||
import com.mogo.eagle.core.function.api.och.IOchFunctionCallNotify
|
||||
import com.mogo.eagle.core.function.call.och.CallerOchFunctionCallManager
|
||||
import com.mogo.eagle.core.function.call.och.CallerOchBizFunctionCall4EagleManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import kotlinx.android.synthetic.main.view_bone_container.view.clBoneBiz
|
||||
import kotlinx.android.synthetic.main.view_bone_container.view.clBoneTab
|
||||
import kotlinx.android.synthetic.main.view_bone_tab.view.carInfoTabView
|
||||
|
||||
class BoneContainerView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
@@ -33,17 +31,15 @@ class BoneContainerView @JvmOverloads constructor(
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
CallerOchFunctionCallManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
CallerOchFunctionCallManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
private fun initView() {
|
||||
clBoneTab.loginOut {
|
||||
CallerOchFunctionCallManager.invokeLoginOut()
|
||||
CallerOchBizFunctionCall4EagleManager.logout()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
package com.mogo.eagle.core.function.api.och
|
||||
|
||||
import android.view.View
|
||||
import com.mogo.eagle.core.data.enums.Carmodel
|
||||
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 IEagleBaseFunctionCall4Och {
|
||||
|
||||
/**
|
||||
* 注册 工具箱 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>) {}
|
||||
|
||||
/**
|
||||
* Och设置车型
|
||||
*/
|
||||
fun setOchCarModel(carModel: Carmodel) {}
|
||||
|
||||
/**
|
||||
* Och设置 车牌
|
||||
*/
|
||||
fun setOchPlateNumber(plateNumber: String?) {}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.mogo.eagle.core.function.api.och
|
||||
|
||||
/**
|
||||
* 定义提供给 鹰眼底层 调用的接口
|
||||
*/
|
||||
interface IOchBizFunctionCall4Eagle {
|
||||
/**
|
||||
* 退出登录
|
||||
*/
|
||||
fun logout()
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
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.IEagleBaseFunctionCall4Och
|
||||
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.hmi.CallerHmiManager
|
||||
|
||||
/**
|
||||
* 鹰眼底层提供给 Och业务层 调用的接口
|
||||
*/
|
||||
object CallerEagleBaseFunctionCall4OchManager : IEagleBaseFunctionCall4Och {
|
||||
|
||||
const val TAG = "CallerEagleBaseFunctionCall4OchManager"
|
||||
|
||||
|
||||
/**
|
||||
* 注册 工具箱 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)
|
||||
}
|
||||
|
||||
/**
|
||||
* Och设置车型 E70 H9 B1 B2 M1 金旅牌XML6606JEVY0(小巴车) NJL6450ICEV(小巴) BJ5122TXSEV-H1(环卫车)
|
||||
*/
|
||||
override fun setOchCarModel(carModel: Carmodel) {
|
||||
//this.carModel = carModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Och设置 车牌
|
||||
*/
|
||||
override fun setOchPlateNumber(plateNumber: String?) {
|
||||
// this.plateNumber = plateNumber
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.mogo.eagle.core.function.call.och
|
||||
|
||||
import com.mogo.eagle.core.function.api.och.IOchBizFunctionCall4Eagle
|
||||
|
||||
/**
|
||||
* 实现提供给 鹰眼底层 调用的接口
|
||||
*/
|
||||
object CallerOchBizFunctionCall4EagleManager : IOchBizFunctionCall4Eagle {
|
||||
|
||||
const val TAG = "CallerOchBizFunctionCall4EagleManager"
|
||||
|
||||
private var _ochBizFunctionCall4EagleInstance: IOchBizFunctionCall4Eagle? = null
|
||||
|
||||
val ochBizFunctionCall4EagleInstance: IOchBizFunctionCall4Eagle?
|
||||
get() = _ochBizFunctionCall4EagleInstance
|
||||
|
||||
fun setOchBizFunctionCall4EagleInstance(caller: IOchBizFunctionCall4Eagle) {
|
||||
this._ochBizFunctionCall4EagleInstance = caller
|
||||
}
|
||||
|
||||
/**
|
||||
* 退出登录
|
||||
*/
|
||||
override fun logout() {
|
||||
ochBizFunctionCall4EagleInstance?.logout()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user